コード例 #1
0
        public string Show()
        {
            string          result = HttpClientHelpers.Send("get", "/api/WangLuChao/ShowEmployee", null);
            List <Employee> jias   = JsonConvert.DeserializeObject <List <Employee> >(result);

            return(JsonConvert.SerializeObject(jias));
        }
コード例 #2
0
        /// <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));
        }
コード例 #3
0
        public string finace()
        {
            string         fin = HttpClientHelpers.Send("get", "/api/WangLuChao/ShowFinances", null);
            List <Finance> ss  = JsonConvert.DeserializeObject <List <Finance> >(fin);

            return(JsonConvert.SerializeObject(ss));
        }
コード例 #4
0
        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>");
            }
        }
コード例 #5
0
        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");
        }
コード例 #6
0
        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>");
            }
        }