public HttpResponseMessage AddInstocks(Zfdx_InstocksModel model) { int success = bll.AddInstocks(model); Zfdx_StocksModel z = new Zfdx_StocksModel(); //HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request; string type = model.storagetype; z.deviceid = (int)model.deviceid; if (type == "3") { if (model.number != null) { z.stocknum = (int)model.number; } } else { if (model.number != null) { z.devicesum = (int)model.number; z.stocknum = (int)model.number; } } s.EditZfdxStocks(z); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (success > 0) { response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html"); } else { response.Content = new StringContent("{\"success\":false}", Encoding.GetEncoding("UTF-8"), "text/html"); } return(response); }
//更新 public int EditZfdxStocks(Zfdx_StocksModel model) { return(dal.EditZfdxStocks(model)); }
//增加 public int AddZfdxStocks(Zfdx_StocksModel model) { return(dal.AddZfdxStocks(model)); }