Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. public static Employee GetEmployee(String EmployeeNam)
  2.             {
  3.                 List<Employee> LB = new List<Employee>();
  4.                 Task<FirebaseResponse> Resp = StaticValues._8080_MainFClient.GetAsync("/Employee");
  5.                 JArray jA;
  6.                 if (Resp.Result.Body.ToString() != "null")
  7.                     jA = JArray.Parse(Resp.Result.Body.ToString());
  8.                 else
  9.                     jA = JArray.Parse("[]");
  10.  
  11.                 Employee L = new Employee();
  12.  
  13.                 foreach (JObject A in jA)
  14.                 {
  15.                     if (A["Name"].ToString() == EmployeeNam)
  16.                     {
  17.                         L.Name = A["Name"].ToString();
  18.                         L.ImageURL = A["ImageURL"].ToString();
  19.                         L.BranchName = A["BranchName"].ToString();
  20.                         L.ISACTIVE = A["ISACTIVE"].ToString();
  21.                         L.date = JsonConvert.DeserializeObject<Dictionary<string, string>>(A["data"].ToString());
  22.                     }
  23.                 }
  24.                 return L;
  25.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement