public string Show() { string result = HttpClientHelpers.Send("get", "/api/WangLuChao/ShowEmployee", null); List <Employee> jias = JsonConvert.DeserializeObject <List <Employee> >(result); return(JsonConvert.SerializeObject(jias)); }
/// <summary> /// 下拉框 /// </summary> /// <returns></returns> /// public string HHer() { string result = HttpClientHelpers.Send("get", "/api/WangLuChao/ShowDepartMent", null); List <DepartMent> jias = JsonConvert.DeserializeObject <List <DepartMent> >(result); return(JsonConvert.SerializeObject(jias)); }
public string finace() { string fin = HttpClientHelpers.Send("get", "/api/WangLuChao/ShowFinances", null); List <Finance> ss = JsonConvert.DeserializeObject <List <Finance> >(fin); return(JsonConvert.SerializeObject(ss)); }
public void AddDepartMent(DepartMent mm) { mm.Num = 0; string json = JsonConvert.SerializeObject(mm); string result = HttpClientHelpers.Send("post", "/api/WangLuChao/AddDepartMent", json); if (Convert.ToInt32(result) > 0) { Response.Write("<script>alert('ok');location.href='/WangLuChao/ShowDepartMent'</script>"); } else { Response.Write("<script>alert('bu ok')</script>"); } }
public string AddEmployees(Employee mm, HttpPostedFileBase E_Img) { string ee = Server.MapPath("/employImg/"); string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + E_Img.FileName; E_Img.SaveAs(ee + filename); mm.E_Img = "/employImg/" + filename; mm.E_State = 1;//状态为 string json = JsonConvert.SerializeObject(mm); string result = HttpClientHelpers.Send("post", "/api/WangLuChao/AddEmployee", json); if (Convert.ToInt32(result) > 0) { Response.Write("<script>alert('ok');location.href='/WangLuChao/ShowEmployee'</script>"); } else { Response.Write("<script>alert('bu ok')</script>"); } return("1"); }
public void UpdEmployees(Employee mm, HttpPostedFileBase E_Img) { if (E_Img != null) { string ee = Server.MapPath("/employImg/"); string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + E_Img.FileName; E_Img.SaveAs(ee + filename); mm.E_Img = "/employImg/" + filename; } mm.E_State = 1;//状态为 string json = JsonConvert.SerializeObject(mm); string result = HttpClientHelpers.Send("post", "/api/WangLuChao/UpdEmployee", json); if (Convert.ToInt32(result) > 0) { Response.Write("<script>alert('success');location.href='/XJW/Login'</script>"); } else { Response.Write("<script>alert('lose')</script>"); } }