Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1.             public static async Task<HttpStatusCode> ADD(Employee A)
  2.             {
  3.                 dynamic jsonObject = new JObject();
  4.                 jsonObject.Name = A.Name;
  5.                 jsonObject.BranchName = A.BranchName;
  6.                 jsonObject.CreationDate = A.CreationDate;
  7.                 jsonObject.Last_Modified_Date = A.Last_Modified_Date;
  8.                 jsonObject.ISACTIVE = 1;
  9.                 jsonObject.ImageURL = A.ImageURL;
  10.                 jsonObject["data"] = JObject.FromObject(A.date);
  11.                 Task<FirebaseResponse> Respos_State = MainFClient.GetAsync("/Employee");
  12.                 SetResponse response;
  13.                 try
  14.                 {
  15.  
  16.                     JArray jA = (Respos_State.Result != null) ? JArray.Parse(Respos_State.Result.Body.ToString()) : new JArray();
  17.                     response = StaticValues._8080_MainFClient.Set<JObject>("/Employee/" + jA.Count(), jsonObject);
  18.  
  19.                 }
  20.                 catch (Exception i)
  21.                 {
  22.                     response = StaticValues._8080_MainFClient.Set<JObject>("/Employee/" + 0, jsonObject);
  23.                 }
  24.                 return response.StatusCode;
  25.             }
  26.  
  27.  
  28. ////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement