public JsonResult AddSave(Book.Model.T_Stock_InHead Head, Book.Model.T_Stock_InItems[] Items) { Book.BLL.T_Stock_In bll = new BLL.T_Stock_In(); Book.Model.T_Stock_In inStock = new Model.T_Stock_In(); inStock.Head = Head; inStock.Items = Items.ToList(); bool result = bll.Add(inStock); return(Json(new Book.Model.Message() { Code = 1, Content = "保存成功" })); }
public JsonResult EditSave(Book.Model.T_Stock_InHead Head, Book.Model.T_Stock_InItems[] Items) { Book.BLL.T_Stock_In bll = new BLL.T_Stock_In(); String [] tmp = new String[1]; tmp[0] = "" + Head.Id; bll.Delete(tmp); Book.Model.T_Stock_In inStock = new Model.T_Stock_In(); inStock.Head = Head; inStock.Items = Items.ToList(); bool result = bll.Add(inStock); return(Json(new Book.Model.Message() { Code = 1, Content = "保存成功" })); }
public ActionResult AddSave() { Book.Model.T_STOCK_InHead head = new Book.Model.T_STOCK_InHead(); head.CeateTime = Convert.ToDateTime(Request.Form["CreateName"]); head.OrderNumber = Convert.ToString(Request.Form["OrderNumber"]); head.ProviderID = Convert.ToInt32(Request.Form["json.ID"]); head.ProviderName = Convert.ToString(Request.Form["json.Name"]); head.UserID = 1; head.UserName = "******"; List <Book.Model.T_STOCK_InBody> lst = new List <Book.Model.T_STOCK_InBody>(); int i = 0; while (Request.Form["items[" + i + "].book.ID"] != null) { Book.Model.T_STOCK_InBody body = new Book.Model.T_STOCK_InBody(); string BookID = Request.Form["items[" + i + "].book.ID"]; BookID = BookID.Replace(",", ""); body.BookID = Convert.ToInt32(BookID); body.Discount = Convert.ToDecimal(Request.Form["items[" + i + "].book.Discount"]); body.InHeadID = 0; body.Num = Convert.ToInt32(Request.Form["items[" + i + "].book.Num"]); body.Price = Convert.ToDecimal(Request.Form["items[" + i + "].book.Price"]); lst.Add(body); i++; } BLL.T_Stock_In bll = new BLL.T_Stock_In(); bool result = bll.Add(head, lst); if (result) { MODEL.Message message = new MODEL.Message(); message = BookProject.Public.T_CloseSMess("InList", "InList", "添加入库单成功!"); return(Json(message)); } else { MODEL.Message message = new MODEL.Message(); message = BookProject.Public.T_CloseFMess("InList", "InList", "添加入库单失败!"); return(Json(message)); } }
public JsonResult AddSave(Book.Model.T_Stock_InHead head, Book.Model.T_Stock_InItems[] items) { //保存 Book.BLL.T_Stock_In bll = new BLL.T_Stock_In(); bool result = bll.Add(head, items); if (result) { return(Json(new Book.Model.Message() { Code = 1, Content = "保存成功" })); } else { return(Json(new Book.Model.Message() { Code = 0, Content = "保存失败" })); } }