Exemple #1
0
        public ActionResult GetModel(Check_Model model)
        {
            Check_Func db = new Check_Func();

            ViewData["Taskno"] = db.GetTableID("SEQ_CHECK_NO").ToString();
            return(View());
        }
Exemple #2
0
        public ActionResult Add(Check_Model model, string strAll)
        {
            model.CHECKSTATUS = "新建";
            model.CHECKTYPE   = "货位";
            model.CREATER     = currentUser.UserName;
            List <CheckArea_Model> list = new List <CheckArea_Model>();

            string[] strsp = strAll.Split(';');
            foreach (string item in strsp)
            {
                if (item.Contains(','))
                {
                    CheckArea_Model m      = new CheckArea_Model();
                    string[]        strsp2 = item.Split(',');
                    m.AREANO = strsp2[1];
                    m.ID     = Convert.ToInt32(strsp2[0]);
                    list.Add(m);
                }
            }
            string ErrMsg = "";
            bool   bSucc  = tfun.SaveCheck(model, list, ref ErrMsg);

            if (!bSucc)
            {
                ErrMsg = "保存失败!" + ErrMsg;
            }
            else
            {
                ErrMsg = "保存成功!";
            }
            return(Json(ErrMsg, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult GetModelList(DividPage page, Check_Model model)
        {
            List <Check_Model> modelList = new List <Check_Model>();
            string             strError  = "";

            tfun.GetCheckInfo(model, ref page, ref modelList, ref strError);
            ViewData["PageData"] = new PageData <Check_Model> {
                data = modelList, dividPage = page, link = Common.PageTag.ModelToUriParam(model, "/Check/GetModelList")
            };
            return(View("GetModelList", model));
        }
Exemple #4
0
        public bool SaveCheck2(Check_Model model, List <T_StockInfoEX> list, ref string ErrMsg)
        {
            Check_DB db = new Check_DB();

            return(db.SaveCheck2(model, list, ref ErrMsg));
        }
Exemple #5
0
        public bool SaveCheck(Check_Model model, List <CheckArea_Model> list, ref string ErrMsg)
        {
            Check_DB db = new Check_DB();

            return(db.SaveCheck(model, list, ref ErrMsg));
        }
Exemple #6
0
        public bool GetCheckInfo(Check_Model taskmo, ref DividPage dividpage, ref List <Check_Model> lsttask, ref string strErrMsg)
        {
            Check_DB db = new Check_DB();

            return(db.GetCheckInfo(taskmo, ref dividpage, ref lsttask, ref strErrMsg));
        }
Exemple #7
0
 public ActionResult Delete(Check_Model model)
 {
     return(RedirectToAction("GetModelList"));
 }
Exemple #8
0
        //保存盘点单
        public JsonResult SaveCheck(T_StockInfoEX model)
        {
            try
            {
                if (string.IsNullOrEmpty(model.WarehouseNo))
                {
                    return(Json(new { state = false }, JsonRequestBehavior.AllowGet));
                }
                T_WareHouse_DB TWareHouseDB       = new T_WareHouse_DB();
                string         StrongHoldCode     = "";
                string         StrongHoldCodeName = "";
                TWareHouseDB.GetStrongholdcode(model.WarehouseNo, ref StrongHoldCode, ref StrongHoldCodeName);

                Check_DB checkdb  = new Check_DB();
                string   ErrorMsg = "";
                if (!checkdb.CheckIsSvae(model.MaterialNo, model.WarehouseNo, ref ErrorMsg))
                {
                    return(Json(new { state = false, ErrMsg = "待发或者待收库区有该物料不能生成盘点单!【" + ErrorMsg + "】" }, JsonRequestBehavior.AllowGet));
                }


                string strErrMsg             = string.Empty;
                List <T_StockInfoEX> lsttask = new List <T_StockInfoEX>();
                Query_DB             db      = new Query_DB();
                if (!db.GetStockCombineInfo2(model, ref lsttask, ref strErrMsg))
                {
                    return(Json(new { Result = 0, ErrMsg = strErrMsg }, JsonRequestBehavior.AllowGet));
                }
                if (model.Check == "0")
                {
                    //检验WMS库存和U9是否一致
                    T_Material_Batch_Func FUNC      = new T_Material_Batch_Func();
                    List <U9Stock>        erp_stock = FUNC.GetStockInfo(model.WarehouseNo, StrongHoldCode, model.MaterialNo);
                    bool isOk = true;
                    lsttask.ForEach(itemWMS =>
                    {
                        if (erp_stock.FindAll(itemerp => { return(itemerp.MaterialNo == itemWMS.MaterialNo && itemerp.BatchNo == itemWMS.BatchNo && itemerp.Qty == itemWMS.Qty); }).Count != 1)
                        {
                            isOk = false;
                        }
                    });
                    if (!isOk)
                    {
                        return(Json(new { state = false, ErrMsg = "WMS库存和U9不匹配不能生成盘点单!" }, JsonRequestBehavior.AllowGet));
                    }
                }



                Check_Model cm = new Check_Model();
                //cm.REMARKS = strremark + txt_remarkD.Text + txt_remark.Text;
                cm.CHECKSTATUS = "新建";
                cm.CREATER     = currentUser.UserNo;
                cm.CHECKDESC   = "明盘";
                string ErrMsg = "";
                if (checkdb.SaveCheck2(cm, lsttask, ref ErrMsg))
                {
                    return(Json(new { state = true }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new { state = false }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { state = false, ErrMsg = ex.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }