public StaffModel StaffLogin(string email, string pass)
        {
            StaffModel _staff = new StaffModel();

            try
            {
                var    webclient = new WebClient();
                string url       = string.Format(BASE_URL + "staffLogin/{0}", email);
                var    json      = webclient.DownloadString(url);
                var    js        = new JavaScriptSerializer();
                _staff = js.Deserialize <StaffModel>(json);
                if (_staff.PASS.Equals(pass))
                {
                    return(_staff);
                }
                else
                {
                    return(null);
                }
            }
            catch
            {
                return(null);
            }
        }
        //updateSTaff
        public bool updateStaff(StaffModel staff, string id)
        {
            string     response = null;
            string     data     = null;
            StaffModel _staff   = null;

            try
            {
                _staff = new StaffModel();
                DataContractJsonSerializer ser = new DataContractJsonSerializer(
                    typeof(StaffModel));
                MemoryStream mem = new MemoryStream();
                ser.WriteObject(mem, staff);
                data = Encoding.UTF8.GetString(mem.ToArray(), 0, (int)mem.Length);
                WebClient webClient = new WebClient();
                webClient.Headers["Content-type"] = "application/json";
                webClient.Encoding = Encoding.UTF8;
                response           = webClient.UploadString(BASE_URL + "updateSTaff/" + id, "PUT", data);
                _staff             = JsonConvert.DeserializeObject <StaffModel>(response);
                if (_staff != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
                //   return _staff;
            }
            catch
            {
                return(false);
            }
        }
 public bool createStaff(StaffModel _staff)
 {
     try
     {
         DataContractJsonSerializer ser = new DataContractJsonSerializer(
             typeof(StaffModel));
         MemoryStream mem = new MemoryStream();
         ser.WriteObject(mem, _staff);
         string    data      = Encoding.UTF8.GetString(mem.ToArray(), 0, (int)mem.Length);
         WebClient webClient = new WebClient();
         webClient.Headers["Content-type"] = "application/json";
         webClient.Encoding = Encoding.UTF8;
         string response = webClient.UploadString(BASE_URL + "createStaff", "POST", data);
         return(true);
     }
     catch
     {
         return(false);
     }
 }