public JsonResult Shengdan(string ID) { try { string strError = string.Empty; List <T_OutStockCreateInfo> lstCreate = new List <T_OutStockCreateInfo>(); string[] strId = ID.Split(','); for (int i = 0; i < strId.Length; i++) { if (!string.IsNullOrEmpty(strId[i])) { T_OutStockCreateInfo model = new T_OutStockCreateInfo(); model.ID = Convert.ToInt32(strId[i]); if (!tfunc_OutStockCreate.GetModelByID(ref model, ref strError)) { return(Json(new { state = false, obj = strError }, JsonRequestBehavior.AllowGet)); } lstCreate.Add(model); } } lstCreate.ForEach(t => t.OKSelect = true); if (!tfunc_OutStockCreate.SaveModelListBySqlToDB(currentUser, lstCreate, ref strError)) { return(Json(new { state = false, obj = strError }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = true, obj = "拣货单生成成功!" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { state = false, obj = ex.ToString() }, JsonRequestBehavior.AllowGet)); } }
public JsonResult Shengdan(string ID) { try { if (currentUser == null) { return(Json(new { state = false, obj = "Cookie失效,重新登陆!" }, JsonRequestBehavior.AllowGet)); } //获取全部的生单明细 T_OutStockCreateInfo createModel = new T_OutStockCreateInfo(); string strErrMsg = ""; string cHeaderID = string.Empty; List <T_OutStockCreateInfo> lstCreate = new List <T_OutStockCreateInfo>(); ID = ID.TrimEnd(','); createModel.SelectHeaderID = ID; DividPage _serverPage = new DividPage(); _serverPage.CurrentPageShowCounts = 100000; if (!tfunc_OutStockCreate.GetModelListByPage(ref lstCreate, currentUser, createModel, ref _serverPage, ref strErrMsg)) { return(Json(new { state = false, obj = strErrMsg }, JsonRequestBehavior.AllowGet)); } lstCreate.ForEach(t => t.OKSelect = true); if (!tfunc_OutStockCreate.SaveModelListBySqlToDB(currentUser, lstCreate, ref strErrMsg)) { return(Json(new { state = false, obj = strErrMsg }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = true, obj = "拣货单生成成功!" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { state = false, obj = ex.ToString() }, JsonRequestBehavior.AllowGet)); } }
public bool SaveT_OutStockCreateList(UserInfo user, List <T_OutStockCreateInfo> modelList, ref string strError) { T_OutStockCreate_Func tfunc = new T_OutStockCreate_Func(); return(tfunc.SaveModelListBySqlToDB(user, modelList, ref strError)); }