示例#1
0
        /// <summary>
        ///冲红状态(bit)(二)原来的 单号
        /// </summary>
        public ActionResult UpdateExamineNot(int WarHouserid, bool state)
        {
            //添加(这个类(bit 类型类))
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                             where tbbool.WareHouseID == WarHouserid
                                             select tbbool).Single(); //查询原状态
                wafrtbool.CrushRedNot           = state;              //改变是否为冲红单状态
                myModels.Entry(wafrtbool).State = EntityState.Modified;


                if (myModels.SaveChanges() > 0)//保存
                {
                    returnJson.State = true;
                    returnJson.Text  = "修改成功";
                }
                else
                {
                    returnJson.State = false;
                    returnJson.Text  = "修改失败";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                returnJson.State = false;
                returnJson.Text  = "数据异常";
            }
            return(Json(returnJson, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        /// <summary>
        /// 状态()
        /// </summary>
        public ActionResult UpdateExamineNotStoop(int goodsListedID, bool state)
        {
            //添加(这个类(bit 类型类))
            ReturnJsonVo returnJson = new ReturnJsonVo();

            B_GoodsListedList wafrtbool = (from tbbool in myModels.B_GoodsListedList
                                           where tbbool.GoodsListedID == goodsListedID
                                           select tbbool).Single(); //查询原状态

            wafrtbool.StoopSellNot          = state;                //改变状态
            myModels.Entry(wafrtbool).State = EntityState.Modified;

            if (myModels.SaveChanges() > 0)//保存
            {
                returnJson.State = false;
                returnJson.Text  = "修改成功";
            }
            else
            {
                returnJson.State = true;
                returnJson.Text  = "修改失败";
            }

            return(Json(returnJson, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public ActionResult ShenHeWareHouss(bool state)
        {
            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_WareHouseList WareHouse = new B_WareHouseList();
                WareHouse.WareHouseID = Convert.ToInt32(Request.Form["WareHouseID"]);         //进仓单ID

                WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                WareHouse.Appendix        = Request.Form["Appendix"];                         //附件张数

                WareHouse.StaffID      = Convert.ToInt32(Request.Form["StaffID"]);            //收货人
                WareHouse.RegisterName = Request.Form["RegisterName"];                        //登记人
                WareHouse.RegisterTime = Convert.ToDateTime(Request.Form["RegisterTime"]);    //登记时间
                WareHouse.ExamineName  = Request.Form["ExamineName"];                         //审核人
                WareHouse.ExamineTime  = Convert.ToDateTime(Request.Form["ExamineTime"]);     //审核时间

                myModels.Entry(WareHouse).State = System.Data.Entity.EntityState.Modified;
                myModels.SaveChanges();

                if (WareHouse.WareHouseID > 0)
                {
                    B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                                 where tbbool.WareHouseID == WareHouse.WareHouseID
                                                 select tbbool).Single(); //查询原状态
                    wafrtbool.ExamineNot            = state;              //改变审核
                    myModels.Entry(wafrtbool).State = EntityState.Modified;

                    B_WareHouseList wafrtboodl = (from tbbool in myModels.B_WareHouseList
                                                  where tbbool.WareHouseID == WareHouse.WareHouseID
                                                  select tbbool).Single(); //查询原状态
                    wafrtboodl.Status = state;                             //改变生效
                    myModels.Entry(wafrtboodl).State = EntityState.Modified;

                    if (myModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }

                return(Json("success", JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#4
0
        /// <summary>
        /// 修改状态、开启、关闭
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateUnitDeclareState(int unitDeclareId, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                var unitDeclare = (from tbUnitDeclare in myModels.B_UnitDeclare
                                   where tbUnitDeclare.UnitDeclareID == unitDeclareId
                                   select tbUnitDeclare).Single();
                unitDeclare.ToVoidNo = state;
                myModels.Entry(unitDeclare).State = EntityState.Modified;
                if (myModels.SaveChanges() > 0)
                {
                    returnJson.State = true;
                    returnJson.Text  = "修改成功";
                }
                else
                {
                    returnJson.State = false;
                    returnJson.Text  = "修改失败";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                returnJson.State = false;
                returnJson.Text  = "数据异常";
            }
            return(Json(returnJson, JsonRequestBehavior.AllowGet));
        }
示例#5
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="unitDeclareId"></param>
        /// <returns></returns>
        public ActionResult DeleteUnitDeclareState(int unitDeclareId)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_UnitDeclare dbunitDeclare = (from tbUnitDeclare in myModels.B_UnitDeclare
                                               where tbUnitDeclare.UnitDeclareID == unitDeclareId
                                               select tbUnitDeclare).Single();
                myModels.B_UnitDeclare.Remove(dbunitDeclare);
                if (myModels.SaveChanges() > 0)
                {
                    returnJson.State = true;
                    returnJson.Text  = "删除成功";
                }
                else
                {
                    returnJson.State = false;
                    returnJson.Text  = "删除失败";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                returnJson.State = false;
                returnJson.Text  = "数据异常";
            }
            return(Json(returnJson, JsonRequestBehavior.AllowGet));
        }
示例#6
0
        public ActionResult Uptcon_gfdf(bool state, int ShooppingOrderFountID)
        {
            Session["ShooppingOrderFtID"] = ShooppingOrderFountID;

            ReturnJsonVo retfdurnJson = new ReturnJsonVo();

            try
            {
                B_ShooppingOrderFountList wafrtbool = (from tbbool in MyModels.B_ShooppingOrderFountList
                                                       where tbbool.ShooppingOrderFountID == ShooppingOrderFountID
                                                       select tbbool).Single();//
                wafrtbool.ExamineNot            = state;
                MyModels.Entry(wafrtbool).State = EntityState.Modified;

                if (MyModels.SaveChanges() > 0)//保存
                {
                    retfdurnJson.State = true;
                    retfdurnJson.Text  = "修改成功";
                }
                else
                {
                    retfdurnJson.State = false;
                    retfdurnJson.Text  = "修改失败";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(retfdurnJson, JsonRequestBehavior.AllowGet));
        }
示例#7
0
        public ActionResult Insect_ShooppingOrderFountList(B_ShooppingOrderFountList OK, int ShoppingID, bool state)
        {
            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                //
                int oldWareHouseRows = (from tb in myModels.B_ShooppingOrderFountList
                                        where tb.ShooppingNumber == OK.ShooppingNumber
                                        select tb).Count();

                if (oldWareHouseRows == 0)
                {
                    B_ShooppingOrderFountList MyB_ConverList = new B_ShooppingOrderFountList();


                    MyB_ConverList.ShooppingNumber = OK.ShooppingNumber;
                    MyB_ConverList.ShooppingTime   = OK.ShooppingTime;
                    MyB_ConverList.Message         = OK.Message;

                    myModels.B_ShooppingOrderFountList.Add(MyB_ConverList);

                    if (myModels.SaveChanges() > 0)
                    {
                        B_ShoppingList wafrtbool = (from tbbool in myModels.B_ShoppingList
                                                    where tbbool.ShoppingID == ShoppingID
                                                    select tbbool).Single(); //
                        wafrtbool.SubmitNot             = state;             //购物
                        myModels.Entry(wafrtbool).State = EntityState.Modified;

                        if (myModels.SaveChanges() > 0)//保存
                        {
                            returnJson.State = true;
                            returnJson.Text  = "修改成功";
                        }
                        else
                        {
                            returnJson.State = false;
                            returnJson.Text  = "修改失败";
                        }

                        strMag = "succsee";
                        B_ShooppingDateilIDOrderFounList ShooppingDeTailList = new B_ShooppingDateilIDOrderFounList();

                        ShooppingDeTailList.ShooppingOrderFountID = MyB_ConverList.ShooppingOrderFountID; //定单ID
                        ShooppingDeTailList.ShoppingID            = ShoppingID;                           //ShoppingID
                        myModels.B_ShooppingDateilIDOrderFounList.Add(ShooppingDeTailList);
                        myModels.SaveChanges();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#8
0
        // <summary>
        ///取消设置完成
        /// </summary>
        /// <returns></returns>
        public ActionResult QuXiaogCheckgh(B_CheckRemerbenList OK, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                B_CheckRemerbenList ConverDeTailList = new B_CheckRemerbenList();

                ConverDeTailList.CheckRermeberID = OK.CheckRermeberID; //盘点ID
                ConverDeTailList.Remter          = OK.Remter;          //盘点ID
                ConverDeTailList.PablData        = OK.PablData;        //盘点ID
                ConverDeTailList.CommodityType   = OK.CommodityType;   //盘点ID
                ConverDeTailList.DrugType        = OK.DrugType;        //盘点ID
                ConverDeTailList.StockPlaceID    = OK.StockPlaceID;    //盘点ID
                ConverDeTailList.OrderFormPactID = OK.OrderFormPactID; //盘点ID
                ConverDeTailList.GoodsClassifyID = OK.GoodsClassifyID; //盘点ID
                ConverDeTailList.GoodsChopID     = OK.GoodsChopID;     //盘点ID
                ConverDeTailList.ExamineName     = OK.ExamineName;     //盘点ID
                ConverDeTailList.ExamineTime     = OK.ExamineTime;     //盘点ID

                ConverDeTailList.DrugTypeID   = OK.DrugTypeID;         //
                ConverDeTailList.StaffID      = OK.StaffID;            //
                ConverDeTailList.YingKuiMoney = OK.YingKuiMoney;       //


                MyModels.Entry(ConverDeTailList).State = System.Data.Entity.EntityState.Modified;

                if (MyModels.SaveChanges() > 0)
                {
                    //保存
                    strMag = "succsee";

                    B_CheckRemerbenList Goofrtbool = (from tbbool in MyModels.B_CheckRemerbenList
                                                      where tbbool.CheckRermeberID == ConverDeTailList.CheckRermeberID
                                                      select tbbool).Single(); //查询原状态
                    Goofrtbool.GoodsNot = state;                               //改变是否为商品状态
                    MyModels.Entry(Goofrtbool).State = EntityState.Modified;

                    if (MyModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#9
0
        public ActionResult Uptcon_FountList(B_GoodsListedDetailList OK, bool state)
        {
            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_GoodsListedDetailList MyB_ConverList = new B_GoodsListedDetailList();


                MyB_ConverList.GoodsListedDetailID = OK.GoodsListedDetailID;
                MyB_ConverList.GoodsListedID       = OK.GoodsListedID;
                MyB_ConverList.ConverDateilID      = OK.ConverDateilID;
                MyB_ConverList.SongHuoJianShu      = OK.SongHuoJianShu;
                MyB_ConverList.SongHuoXiShu        = OK.SongHuoXiShu;
                MyB_ConverList.MumberOfPackages    = OK.MumberOfPackages;
                MyB_ConverList.Subdivision         = OK.Subdivision;
                MyB_ConverList.ShouChuLiang        = OK.ShouChuLiang;

                MyModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified;

                if (MyModels.SaveChanges() > 0)
                {
                    if (MyB_ConverList.MumberOfPackages == 0 || MyB_ConverList.MumberOfPackages < 0)
                    {
                        B_GoodsListedDetailList wafrtbool = (from tbbool in MyModels.B_GoodsListedDetailList
                                                             where tbbool.GoodsListedDetailID == MyB_ConverList.GoodsListedDetailID
                                                             select tbbool).Single(); //
                        wafrtbool.ShiFouNot             = state;                      //购物
                        MyModels.Entry(wafrtbool).State = EntityState.Modified;

                        if (MyModels.SaveChanges() > 0)//保存
                        {
                            returnJson.State = true;
                            returnJson.Text  = "修改成功";
                        }
                        else
                        {
                            returnJson.State = false;
                            returnJson.Text  = "修改失败";
                        }
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                    strMag = "succsee";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#10
0
        public ActionResult ShenHePeiZaiDan(B_RetureFactoryList OK, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                B_RetureFactoryList MyB_ConverList = new B_RetureFactoryList();

                MyB_ConverList.RetureFactoryID = OK.RetureFactoryID;
                MyB_ConverList.ConverID        = OK.ConverID;
                MyB_ConverList.Remember        = OK.Remember;
                MyB_ConverList.SpouseBRanchID  = OK.SpouseBRanchID;
                MyB_ConverList.StockPlaceID    = OK.StockPlaceID;
                MyB_ConverList.ReturnofID      = OK.ReturnofID;
                MyB_ConverList.Settlement      = OK.Settlement;
                MyB_ConverList.Appendix        = OK.Appendix;
                MyB_ConverList.Evidences       = OK.Evidences;
                MyB_ConverList.RegisterName    = OK.RegisterName;
                MyB_ConverList.RegisterTime    = OK.RegisterTime;

                MyB_ConverList.ExamineName = OK.ExamineName;
                MyB_ConverList.ExamineTime = OK.ExamineTime;

                MyB_ConverList.MumberOfPackages = OK.MumberOfPackages;
                MyB_ConverList.Number           = OK.Number;

                MyModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified;
                if (MyModels.SaveChanges() > 0)
                {
                    strMag = "succsee";
                    B_RetureFactoryList wafrtbool = (from tbbool in MyModels.B_RetureFactoryList
                                                     where tbbool.RetureFactoryID == MyB_ConverList.RetureFactoryID
                                                     select tbbool).Single(); //查询原状态
                    wafrtbool.ExamineNot            = state;                  //改变是否为冲红单状态
                    MyModels.Entry(wafrtbool).State = EntityState.Modified;


                    if (MyModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#11
0
        public ActionResult ShneheanDan(B_SellRetuerList OK, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                B_SellRetuerList MyB_ConverList = new B_SellRetuerList();

                MyB_ConverList.SellRetuerID   = OK.SellRetuerID;
                MyB_ConverList.SellID         = OK.SellID;
                MyB_ConverList.Remember       = OK.Remember;
                MyB_ConverList.payName        = OK.payName;
                MyB_ConverList.furlName       = OK.furlName;
                MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID;
                MyB_ConverList.StockPlaceID   = OK.StockPlaceID;
                MyB_ConverList.RegisterName   = OK.RegisterName;
                MyB_ConverList.RegisterTime   = OK.RegisterTime;

                MyB_ConverList.ExamineName = OK.ExamineName;
                MyB_ConverList.ExamineTime = OK.ExamineTime;
                MyB_ConverList.Remarks     = OK.Remarks;

                MyModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified;
                if (MyModels.SaveChanges() > 0)
                {
                    strMag = "succsee";
                    B_SellRetuerList wafrtbool = (from tbbool in MyModels.B_SellRetuerList
                                                  where tbbool.SellRetuerID == MyB_ConverList.SellRetuerID
                                                  select tbbool).Single(); //查询原状态
                    wafrtbool.ExamineNot            = state;               //改变是否为冲红单状态
                    MyModels.Entry(wafrtbool).State = EntityState.Modified;


                    if (MyModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#12
0
        public ActionResult InsectJingCangDan(B_GoodsKuCunList GoodsKuCunL, Array JieId, Array JieZuiDi, Array JieZuiGao, Array JieAnQuanTi)
        {
            string strMag = "fali";

            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                //一
                string   Z      = ((string[])JieId)[0];
                string[] intsId = Z.Split(',');
                //二
                string   M     = ((string[])JieZuiDi)[0];
                string[] intsD = M.Split(',');
                //三
                string   N     = ((string[])JieZuiGao)[0];
                string[] intsG = N.Split(',');

                //四
                string   T     = ((string[])JieAnQuanTi)[0];
                string[] intsT = T.Split(',');

                for (int H = 0; H < intsId.Length;)
                {
                    for (int D = 0; D < intsD.Length;)
                    {
                        for (int G = 0; G < intsG.Length;)
                        {
                            for (int Ti = 0; Ti < intsT.Length; Ti++)
                            {
                                GoodsKuCunL.GoodsIDs         = Convert.ToInt32(intsId[H]);;  //
                                GoodsKuCunL.MumberOfPackages = Convert.ToInt32(intsD[D]);;   //
                                GoodsKuCunL.Subdivision      = Convert.ToDecimal(intsG[G]);  //
                                GoodsKuCunL.AnQuanTianShu    = Convert.ToDecimal(intsT[Ti]); //
                                myModels.B_GoodsKuCunList.Add(GoodsKuCunL);
                                myModels.SaveChanges();                                      //保存
                                G++;
                                D++;
                                H++;
                                strMag = "succsee";
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(strMag, JsonRequestBehavior.AllowGet));
        }
示例#13
0
        public ActionResult ShenHeZaiDan(B_SellCheckBatchList OK, B_SellCheckBatchDetaiList OKDetai, bool state)
        {
            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_SellCheckBatchList MyB_ConverList = new B_SellCheckBatchList();

                MyB_ConverList.SellCheckBatchID = OK.SellCheckBatchID;
                MyB_ConverList.Remember         = OK.Remember;
                MyB_ConverList.MaiChangID       = OK.MaiChangID;
                MyB_ConverList.SpouseBRanchID   = OK.SpouseBRanchID;
                MyB_ConverList.DrugTypeID       = OK.DrugTypeID;
                MyB_ConverList.StaffID          = OK.StaffID;
                MyB_ConverList.RegisterTime     = OK.RegisterTime;
                MyB_ConverList.StaffIDTwo       = OK.StaffIDTwo;
                MyB_ConverList.ExamineTime      = OK.ExamineTime;

                myModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified;
                myModels.SaveChanges();

                if (MyB_ConverList.SellCheckBatchID > 0)
                {
                    strMag = "succsee";
                    B_SellCheckBatchList wafrtbool = (from tbbool in myModels.B_SellCheckBatchList
                                                      where tbbool.SellCheckBatchID == OK.SellCheckBatchID
                                                      select tbbool).Single(); //查询原状态
                    wafrtbool.ExamineNot            = state;                   //改变是否为冲红单状态
                    myModels.Entry(wafrtbool).State = EntityState.Modified;


                    if (myModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#14
0
        /// <summary>
        /// 点击填写审核信息(一)
        /// </summary>
        /// <param name="WareHouse"></param>
        /// <param name="WarHouserid"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public ActionResult ShenHeCiDan(B_WareHouseList WareHouse, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                WareHouse.WareHouseID     = Convert.ToInt32(Request.Form["WareHouseID"]);     //进仓单ID
                WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                WareHouse.OrderFormID     = Convert.ToInt32(Request.Form["OrdernFromIDs"]);   //订单ID
                WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                WareHouse.StaffID         = Convert.ToInt32(Request.Form["StaffID"]);         //收货人
                WareHouse.RegisterTime    = Convert.ToDateTime(Request.Form["RegisterTime"]); //登记时间
                WareHouse.RegisterName    = Request.Form["RegisterName"];                     //登记人
                WareHouse.ExamineName     = Request.Form["ExamineName"];                      //审核人
                WareHouse.ExamineTime     = Convert.ToDateTime(Request.Form["ExamineTime"]);  //审核时间

                myModels.Entry(WareHouse).State = System.Data.Entity.EntityState.Modified;
                myModels.SaveChanges();

                if (WareHouse.WareHouseID > 0)
                {
                    B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                                 where tbbool.WareHouseID == WareHouse.WareHouseID
                                                 select tbbool).Single();   //查询原状态
                    wafrtbool.HoveNot = state;                              //改变是否为有订单
                    myModels.Entry(wafrtbool).State = EntityState.Modified; //EntityState (生成 using)  这句代码意思把它进行修改

                    if (myModels.SaveChanges() > 0)                         //保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#15
0
        /// <summary>
        /// 删除进仓单
        /// </summary>
        /// <returns></returns>
        public ActionResult DeleteWareHert(int WarHouserid, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMsg     = "fail";

            try
            {
                var linq = (from tbWarHouser in myModels.B_WareHouseList
                            where tbWarHouser.WareHouseID == WarHouserid
                            select new LY.WareHouseDeitaLL
                {
                    OrdernFromIDs = tbWarHouser.OrderFormID
                }).ToList();
                Session["OrdernFromIDsgh"] = linq[0].OrdernFromIDs;//订单ID
                int OrdernFromIDid = Convert.ToInt32(Session["OrdernFromIDsgh"]);

                B_WareHouseList WarHouser = (from tbWarHouser in myModels.B_WareHouseList
                                             where tbWarHouser.WareHouseID == WarHouserid
                                             select tbWarHouser).Single();
                myModels.B_WareHouseList.Remove(WarHouser);

                int waDetialid = (int)WarHouser.WareHouseID;

                //查询对应对应明细(总数量)
                var WarHouserDetial = (from tbWarHouserDetial in myModels.B_WareHouseDetiailList
                                       where tbWarHouserDetial.WareHouseID == waDetialid
                                       select tbWarHouserDetial).ToList();
                int thyCount = WarHouserDetial.Count();

                if (thyCount > 0)
                {
                    for (int i = 0; i < thyCount; i++)
                    {
                        myModels.B_WareHouseDetiailList.Remove(WarHouserDetial[i]);
                        myModels.SaveChanges();
                        strMsg = "success";


                        B_OrderFormList wafrtbool = (from tbbool in myModels.B_OrderFormList
                                                     where tbbool.OrderFormID == OrdernFromIDid
                                                     select tbbool).Single(); //查询原状态
                        wafrtbool.ShiFouShouHuo         = state;              //改变是否为收货状态
                        myModels.Entry(wafrtbool).State = EntityState.Modified;

                        if (myModels.SaveChanges() > 0)//保存
                        {
                            returnJson.State = false;
                            returnJson.Text  = "修改成功";
                        }
                        else
                        {
                            returnJson.State = true;
                            returnJson.Text  = "修改失败";
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMsg, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#16
0
        public ActionResult InsectCher(B_CheckRemerbenDetillList Ok, Array JiShangPiID, Array JiRuJianShu, Array JiRuXiShu, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                //一
                string   Z      = ((string[])JiShangPiID)[0];
                string[] intsid = Z.Split(',');
                //二
                string   M          = ((string[])JiRuJianShu)[0];
                string[] intsRuJian = M.Split(',');
                //三
                string   N          = ((string[])JiRuXiShu)[0];
                string[] intsNXiShu = N.Split(',');

                B_CheckRemerbenDetillList ConverDeTailList = new B_CheckRemerbenDetillList();

                for (int H = 0; H < intsNXiShu.Length;)
                {
                    for (int E = 0; E < intsRuJian.Length;)
                    {
                        for (int d = 0; d < intsid.Length; d++)
                        {
                            ConverDeTailList.CheckRermeberID  = Ok.CheckRermeberID;               //
                            ConverDeTailList.GoodsID          = Convert.ToInt32(intsid[d]);;      //商品ID
                            ConverDeTailList.Subdivision      = Convert.ToDecimal(intsNXiShu[H]); //入库细数
                            ConverDeTailList.MumberOfPackages = Convert.ToDecimal(intsRuJian[E]); //入库件数
                            MyModels.B_CheckRemerbenDetillList.Add(ConverDeTailList);
                            MyModels.SaveChanges();                                               //保存
                            H++;
                            E++;
                            strMag = "succsee";
                        }
                    }
                }

                B_CheckRemerbenList wafrtbool = (from tbbool in MyModels.B_CheckRemerbenList
                                                 where tbbool.CheckRermeberID == Ok.CheckRermeberID
                                                 select tbbool).Single();//查询原状态
                wafrtbool.GoodsNot = state;
                MyModels.Entry(wafrtbool).State = EntityState.Modified;

                if (MyModels.SaveChanges() > 0)//保存
                {
                    returnJson.State = true;
                    returnJson.Text  = "修改成功";
                }
                else
                {
                    returnJson.State = false;
                    returnJson.Text  = "修改失败";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#17
0
        public ActionResult InsectJingCangDan(B_WareHouseList WareHouse, Array JieShouID, Array JieShouJianShu, Array JieShouRuKuXiShu, bool state)
        {
            string strMag = "fali";

            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                //一
                string   Z     = ((string[])JieShouID)[0];
                string[] intsZ = Z.Split(',');
                //二
                string   M     = ((string[])JieShouJianShu)[0];
                string[] intsM = M.Split(',');
                //三
                string   N     = ((string[])JieShouRuKuXiShu)[0];
                string[] intsN = N.Split(',');


                //判断记录编号是否存在
                int oldWareHouseRows = (from tbWareHouse in myModels.B_WareHouseList
                                        where tbWareHouse.Remember == WareHouse.Remember
                                        select tbWareHouse).Count();
                if (oldWareHouseRows == 0)
                {
                    WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                    WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                    WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                    WareHouse.OrderFormID     = Convert.ToInt32(Request.Form["OrdernFromIDs"]);   //订单ID
                    WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                    WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                    WareHouse.StaffID         = Convert.ToInt32(Request.Form["StaffID"]);         //收货人
                    WareHouse.RegisterTime    = Convert.ToDateTime(Request.Form["RegisterTime"]); //登记时间
                    WareHouse.RegisterName    = Request.Form["RegisterName"];                     //登记人

                    if (WareHouse.OrderFormID > 0 && WareHouse.SpouseBRanchID > 0 && WareHouse.StockPlaceID > 0 && WareHouse.StaffID > 0 &&
                        WareHouse.RegisterName != null && WareHouse.RegisterTime != null)
                    {
                        myModels.B_WareHouseList.Add(WareHouse);
                        myModels.SaveChanges();


                        B_OrderFormList wafrtbool = (from tbbool in myModels.B_OrderFormList
                                                     where tbbool.OrderFormID == WareHouse.OrderFormID
                                                     select tbbool).Single(); //查询原状态
                        wafrtbool.ShiFouShouHuo         = state;              //改变是否为收货状态
                        myModels.Entry(wafrtbool).State = EntityState.Modified;

                        myModels.SaveChanges();


                        B_WareHouseList wafrtboolWa = (from tbbool in myModels.B_WareHouseList
                                                       where tbbool.WareHouseID == WareHouse.WareHouseID
                                                       select tbbool).Single();   //查询原状态
                        wafrtboolWa.HoveNot = state;                              //有无订单
                        myModels.Entry(wafrtboolWa).State = EntityState.Modified; //EntityState (生成 using)  这句代码意思把它进行修改

                        if (myModels.SaveChanges() > 0)                           //保存
                        {
                            returnJson.State = true;
                            returnJson.Text  = "修改成功";
                        }
                        else
                        {
                            returnJson.State = false;
                            returnJson.Text  = "修改失败";
                        }



                        B_WareHouseDetiailList WareHouseDetiail = new B_WareHouseDetiailList();
                        for (int H = 0; H < intsN.Length;)
                        {
                            for (int E = 0; E < intsM.Length;)
                            {
                                for (int d = 0; d < intsZ.Length; d++)
                                {
                                    WareHouseDetiail.WareHouseID       = WareHouse.WareHouseID;       //进货单ID
                                    WareHouseDetiail.OrderFormDetailID = Convert.ToInt32(intsZ[d]);;  //订单明细ID
                                    WareHouseDetiail.Subdivision       = Convert.ToDecimal(intsN[H]); //入库细数
                                    WareHouseDetiail.MumberOfPackages  = Convert.ToDecimal(intsM[E]); //入库件数

                                    WareHouseDetiail.YuanMumberOfPack = Convert.ToDecimal(intsN[H]);  //原入库细数
                                    WareHouseDetiail.YuanSubdivision  = Convert.ToDecimal(intsM[E]);  //原入库件数


                                    myModels.B_WareHouseDetiailList.Add(WareHouseDetiail);
                                    myModels.SaveChanges();//保存
                                    E++;
                                    H++;
                                    strMag = "succsse";
                                }
                            }
                        }
                    }
                    else
                    {
                        return(Json(strMag, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#18
0
        public ActionResult UptaleJingCangDan(Array JieShouMingXiID, Array JieShouID, Array JieShouJianShu, Array JieShouRuKuXiShu, bool state)
        {
            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();
            //声明字符串接收“数组的信息”
            //一(订单明细ID)
            string Z = ((string[])JieShouID)[0];

            string[] intsZ = Z.Split(',');//剪切出来
            //二(入库件数)
            string M = ((string[])JieShouJianShu)[0];

            string[] intsM = M.Split(',');
            //三(入库细数)
            string N = ((string[])JieShouRuKuXiShu)[0];

            string[] intsN = N.Split(',');
            //四(进仓明细ID)
            string V = ((string[])JieShouMingXiID)[0];

            string[] intsV = V.Split(',');//剪切出来

            try
            {
                B_WareHouseList WareHouse = new B_WareHouseList();
                WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                WareHouse.WareHouseID     = Convert.ToInt32(Request.Form["WareHouseID"]);     //进仓单ID
                WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                WareHouse.OrderFormID     = Convert.ToInt32(Request.Form["OrdernFromIDs"]);   //订单ID
                WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                WareHouse.StaffID         = Convert.ToInt32(Request.Form["StaffID"]);         //收货人
                WareHouse.RegisterTime    = Convert.ToDateTime(Request.Form["RegisterTime"]); //登记时间
                WareHouse.RegisterName    = Request.Form["RegisterName"];                     //登记人

                myModels.Entry(WareHouse).State = System.Data.Entity.EntityState.Modified;
                myModels.SaveChanges();


                if (WareHouse.WareHouseID > 0)
                {
                    var ling = (from tbWarHreDiell in myModels.B_WareHouseDetiailList
                                where tbWarHreDiell.WareHouseID == WareHouse.WareHouseID
                                select tbWarHreDiell).Count();
                    if (ling > 0)
                    {
                        if (V.Length > 0)
                        {
                            for (int H = 0; H < intsN.Length;)
                            {
                                for (int E = 0; E < intsM.Length;)
                                {
                                    for (int d = 0; d < intsZ.Length; d++)
                                    {
                                        for (int m = 0; m < intsV.Length; m++)
                                        {
                                            B_WareHouseDetiailList WareHouseDetial = new B_WareHouseDetiailList();

                                            WareHouseDetial.WareHouseDetiailID = Convert.ToInt32(intsV[m]);                    //进仓单明细ID
                                            WareHouseDetial.WareHouseID        = Convert.ToInt32(Request.Form["WareHouseID"]); //进仓单ID
                                            WareHouseDetial.OrderFormDetailID  = Convert.ToInt32(intsZ[d]);                    //订单明细ID
                                            WareHouseDetial.Subdivision        = Convert.ToDecimal(intsN[H]);                  //入库细数
                                            WareHouseDetial.MumberOfPackages   = Convert.ToDecimal(intsM[E]);                  //入库件数

                                            WareHouseDetial.YuanMumberOfPack = Convert.ToDecimal(intsN[H]);                    //入库细数
                                            WareHouseDetial.YuanSubdivision  = Convert.ToDecimal(intsM[E]);                    //入库件数

                                            myModels.Entry(WareHouseDetial).State = System.Data.Entity.EntityState.Modified;
                                            myModels.SaveChanges();//保存


                                            strMag = "succsse";
                                            H++;
                                            E++;
                                            d++;
                                        }
                                    }
                                }
                            }
                        }
                        B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                                     where tbbool.WareHouseID == WareHouse.WareHouseID
                                                     select tbbool).Single();   //查询原状态
                        wafrtbool.HoveNot = state;                              //改变是否为冲红单状态
                        myModels.Entry(wafrtbool).State = EntityState.Modified; //EntityState (生成 using)  这句代码意思把它进行修改

                        if (myModels.SaveChanges() > 0)                         //保存
                        {
                            returnJson.State = true;
                            returnJson.Text  = "修改成功";
                        }
                        else
                        {
                            returnJson.State = false;
                            returnJson.Text  = "修改失败";
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#19
0
        /// <summary>
        /// 新增供应商
        /// </summary>
        /// <param name="SupplierList"></param>
        /// <param name="SupplierInformationList"></param>
        /// <param name="EnterpriseNatureList"></param>
        /// <returns></returns>


        public ActionResult SelectGoods(B_SupplierList SupplierListgf)
        {
            B_SupplierList SupplierList = new B_SupplierList();
            string         strMag       = "fali";
            ReturnJsonVo   returnJson   = new ReturnJsonVo();

            try
            {
                SupplierList.SupplierNumber            = SupplierListgf.SupplierNumber;
                SupplierList.SupplierName              = SupplierListgf.SupplierName;
                SupplierList.SupplierCHName            = SupplierListgf.SupplierCHName;
                SupplierList.SupplierEnglishName       = SupplierListgf.SupplierEnglishName;
                SupplierList.SupplierAbbreviation      = SupplierListgf.SupplierAbbreviation;
                SupplierList.SupplierPTCode            = SupplierListgf.SupplierPTCode;
                SupplierList.SupplierDependency        = SupplierListgf.SupplierDependency;
                SupplierList.SupplierRegisteredAddress = SupplierListgf.SupplierRegisteredAddress;
                SupplierList.SupplierRegisteredEnglish = SupplierListgf.SupplierRegisteredEnglish;

                SupplierList.PaymentID        = Convert.ToInt32(SupplierListgf.PaymentID);
                SupplierList.CompanyID        = Convert.ToInt32(SupplierListgf.CompanyID);
                SupplierList.SupplierRankID   = Convert.ToInt32(SupplierListgf.SupplierRankID);
                SupplierList.UnitCharacterID  = Convert.ToInt32(SupplierListgf.UnitCharacterID);
                SupplierList.AgreementTypeID  = Convert.ToInt32(SupplierListgf.AgreementTypeID);
                SupplierList.AgreementStateID = Convert.ToInt32(SupplierListgf.AgreementStateID);


                SupplierList.SupplierInformationName = SupplierListgf.SupplierInformationName;
                SupplierList.SupplierTelephone       = SupplierListgf.SupplierTelephone;
                SupplierList.SupplierContacts        = SupplierListgf.SupplierContacts;
                SupplierList.SupplierPost            = SupplierListgf.SupplierPost;
                SupplierList.SupplierEmail           = SupplierListgf.SupplierEmail;
                SupplierList.SupplierZipCode         = SupplierListgf.SupplierZipCode;
                SupplierList.SupplierPortraiture     = SupplierListgf.SupplierPortraiture;
                SupplierList.SupplierAddress         = SupplierListgf.SupplierAddress;
                SupplierList.SupplierURL             = SupplierListgf.SupplierURL;

                SupplierList.EnterpriseBank     = SupplierListgf.EnterpriseBank;
                SupplierList.EnterpriseNumber   = SupplierListgf.EnterpriseNumber;
                SupplierList.EnterpriseNatureID = Convert.ToInt32(SupplierListgf.EnterpriseNatureID);
                SupplierList.NationalTaxNumber  = SupplierListgf.NationalTaxNumber;
                SupplierList.EnterpriseTypeID   = Convert.ToInt32(SupplierListgf.EnterpriseTypeID);
                SupplierList.LocalTaxNumber     = SupplierListgf.LocalTaxNumber;
                SupplierList.EnterprisePassword = SupplierListgf.EnterprisePassword;


                SupplierList.Registrant     = SupplierListgf.Registrant;
                SupplierList.Registranttime = Convert.ToDateTime(SupplierListgf.Registranttime);

                if (SupplierList.SupplierNumber != "")
                {
                    MyModels.B_SupplierList.Add(SupplierList);
                    MyModels.SaveChanges();
                    strMag = "success";
                }
            }
            catch (Exception)
            {
                return(Json(strMag, JsonRequestBehavior.AllowGet));
            }
            return(Json(strMag, JsonRequestBehavior.AllowGet));
        }
示例#20
0
        public ActionResult ChongHongWareHouss(Array JieShouID, Array JieShouJianShu, Array JieShouRuKuXiShu, bool state)
        {
            //一
            string Z = ((string[])JieShouID)[0];

            string[] intsZ = Z.Split(',');
            //二
            string M = ((string[])JieShouJianShu)[0];

            string[] intsM = M.Split(',');
            //三
            string N = ((string[])JieShouRuKuXiShu)[0];

            string[] intsN = N.Split(',');


            string       strMag     = "fali";
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                B_WareHouseList WareHouse = new B_WareHouseList();

                WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                WareHouse.Appendix        = Request.Form["Appendix"];                         //附件张数
                WareHouse.Evidences       = Request.Form["Evidences"];                        //原始单号
                WareHouse.StaffID         = Convert.ToInt32(Request.Form["StaffID"]);         //收货人ID
                WareHouse.RegisterName    = Request.Form["RegisterName"];                     //登记人
                WareHouse.RegisterTime    = Convert.ToDateTime(Request.Form["RegisterTime"]); //登记时间
                WareHouse.ExamineName     = Request.Form["ExamineName"];                      //审核人
                WareHouse.ExamineTime     = Convert.ToDateTime(Request.Form["ExamineTime"]);  //审核时间

                myModels.B_WareHouseList.Add(WareHouse);
                myModels.SaveChanges();

                if (WareHouse.WareHouseID > 0)
                {
                    B_WareHouseDetiailList WareHouseDetiail = new B_WareHouseDetiailList();

                    for (int H = 0; H < intsN.Length;)
                    {
                        for (int E = 0; E < intsM.Length;)
                        {
                            for (int d = 0; d < intsZ.Length; d++)
                            {
                                WareHouseDetiail.WareHouseID       = WareHouse.WareHouseID;       //进货单ID
                                WareHouseDetiail.OrderFormDetailID = Convert.ToInt32(intsZ[d]);;  //商品ID
                                WareHouseDetiail.Subdivision       = Convert.ToDecimal(intsN[H]); //入库细数
                                WareHouseDetiail.MumberOfPackages  = Convert.ToDecimal(intsM[E]); //入库件数
                                myModels.B_WareHouseDetiailList.Add(WareHouseDetiail);
                                myModels.SaveChanges();                                           //保存
                                H++;
                                E++;
                            }
                        }
                    }

                    B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                                 where tbbool.WareHouseID == WareHouse.WareHouseID
                                                 select tbbool).Single(); //查询原状态
                    wafrtbool.ExamineNot            = state;              //改变审核
                    myModels.Entry(wafrtbool).State = EntityState.Modified;

                    B_WareHouseList wafrtboodl = (from tbbool in myModels.B_WareHouseList
                                                  where tbbool.WareHouseID == WareHouse.WareHouseID
                                                  select tbbool).Single(); //查询原状态
                    wafrtboodl.Status = state;                             //改变生效
                    myModels.Entry(wafrtboodl).State = EntityState.Modified;


                    B_WareHouseList wafrtboosdl = (from tbbool in myModels.B_WareHouseList
                                                   where tbbool.WareHouseID == WareHouse.WareHouseID
                                                   select tbbool).Single(); //查询原状态
                    wafrtboosdl.CrushRedNot           = state;              //改变冲红
                    myModels.Entry(wafrtboosdl).State = EntityState.Modified;

                    if (myModels.SaveChanges() > 0)//保存
                    {
                        returnJson.State = true;
                        returnJson.Text  = "修改成功";
                    }
                    else
                    {
                        returnJson.State = false;
                        returnJson.Text  = "修改失败";
                    }
                    strMag = "success";
                }

                //return Json("success", JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#21
0
        public ActionResult InsectJingCangDan(B_WareHouseList WareHouse, Array JieShouID, Array JieShouJianShu, Array JieShouRuKuXiShu, bool state)
        {
            string strMag = "fali";
            //添加(这个类(bit 类型类))
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                //声明字符串接收“数组的信息”
                //一
                string   Z     = ((string[])JieShouID)[0];
                string[] intsZ = Z.Split(',');//剪切出来
                //二
                string   M     = ((string[])JieShouJianShu)[0];
                string[] intsM = M.Split(',');
                //三
                string   N     = ((string[])JieShouRuKuXiShu)[0];
                string[] intsN = N.Split(',');



                //判断记录编号是否存在
                int oldWareHouseRows = (from tbWareHouse in myModels.B_WareHouseList
                                        where tbWareHouse.Remember == WareHouse.Remember
                                        select tbWareHouse).Count();
                if (oldWareHouseRows == 0)
                {
                    WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                    WareHouse.Remember        = Request.Form["CrRemember"];                       //记录编号
                    WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门
                    WareHouse.OrderFormID     = Convert.ToInt32(Request.Form["OrdernFromIDs"]);   //订单ID
                    WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                    WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点
                    WareHouse.StaffID         = Convert.ToInt32(Request.Form["StaffID"]);         //收货人
                    WareHouse.RegisterTime    = Convert.ToDateTime(Request.Form["RegisterTime"]); //登记时间
                    WareHouse.RegisterName    = Request.Form["RegisterName"];                     //登记人
                    WareHouse.ExamineName     = Request.Form["ExamineName"];                      //审核人
                    WareHouse.ExamineTime     = Convert.ToDateTime(Request.Form["ExamineTime"]);  //审核时间
                    WareHouse.Appendix        = Request.Form["Appendix"];                         //附件
                    WareHouse.Evidences       = Request.Form["Evidences"];                        //原始单号

                    if (WareHouse.OrderFormID > 0 && WareHouse.SpouseBRanchID > 0 && WareHouse.StockPlaceID > 0 && WareHouse.StaffID > 0 &&
                        WareHouse.RegisterName != null && WareHouse.RegisterTime != null && WareHouse.ExamineName != null && WareHouse.ExamineTime != null)
                    {
                        myModels.B_WareHouseList.Add(WareHouse);
                        myModels.SaveChanges();


                        if (WareHouse.WareHouseID > 0)
                        {
                            B_WareHouseDetiailList WareHouseDetiail = new B_WareHouseDetiailList();

                            for (int H = 0; H < intsN.Length;)
                            {
                                for (int E = 0; E < intsM.Length;)
                                {
                                    for (int d = 0; d < intsZ.Length; d++)
                                    {
                                        WareHouseDetiail.WareHouseID       = WareHouse.WareHouseID;       //进货单ID
                                        WareHouseDetiail.OrderFormDetailID = Convert.ToInt32(intsZ[d]);;  //订单明细ID
                                        WareHouseDetiail.Subdivision       = Convert.ToDecimal(intsN[H]); //入库细数
                                        WareHouseDetiail.MumberOfPackages  = Convert.ToDecimal(intsM[E]); //入库件数
                                        myModels.B_WareHouseDetiailList.Add(WareHouseDetiail);
                                        myModels.SaveChanges();                                           //保存
                                        H++;
                                        E++;
                                    }
                                }
                            }
                            B_WareHouseList wafrtbool = (from tbbool in myModels.B_WareHouseList
                                                         where tbbool.WareHouseID == WareHouse.WareHouseID
                                                         select tbbool).Single(); //查询原状态
                            wafrtbool.CrushRedNot           = state;              //改变是否为冲红单状态
                            myModels.Entry(wafrtbool).State = EntityState.Modified;


                            B_WareHouseList wafrtboodl = (from tbbool in myModels.B_WareHouseList
                                                          where tbbool.WareHouseID == WareHouse.WareHouseID
                                                          select tbbool).Single(); //查询原状态
                            wafrtboodl.ExamineNot            = state;              //改变审核状态
                            myModels.Entry(wafrtboodl).State = EntityState.Modified;


                            B_WareHouseList wafrtboole = (from tbbool in myModels.B_WareHouseList
                                                          where tbbool.WareHouseID == WareHouse.WareHouseID
                                                          select tbbool).Single(); //查询原状态
                            wafrtboole.Status = state;                             //改变生效状态
                            myModels.Entry(wafrtboole).State = EntityState.Modified;

                            B_WareHouseList wafrtboojgfle = (from tbbool in myModels.B_WareHouseList
                                                             where tbbool.WareHouseID == WareHouse.WareHouseID
                                                             select tbbool).Single(); //查询原状态
                            wafrtboojgfle.HoveNot = state;                            //改变是否订单
                            myModels.Entry(wafrtboojgfle).State = EntityState.Modified;


                            if (myModels.SaveChanges() > 0)//保存
                            {
                                returnJson.State = true;
                                returnJson.Text  = "修改成功";
                            }
                            else
                            {
                                returnJson.State = false;
                                returnJson.Text  = "修改失败";
                            }
                        }
                    }
                    else
                    {
                        return(Json("fail", JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }
示例#22
0
        public ActionResult InsectJingCangDan(B_WareHouseList WareHouse, Array JieShouID, Array JieShouJianShu, Array JieShouRuKuXiShu)
        {
            string strMag = "fali";
            //添加(这个类(bit 类型类))
            ReturnJsonVo returnJson = new ReturnJsonVo();

            try
            {
                //一
                string   Z     = ((string[])JieShouID)[0];
                string[] intsZ = Z.Split(',');
                //二
                string   M     = ((string[])JieShouJianShu)[0];
                string[] intsM = M.Split(',');
                //三
                string   N     = ((string[])JieShouRuKuXiShu)[0];
                string[] intsN = N.Split(',');


                //判断记录编号是否存在
                int oldWareHouseRows = (from tbWareHouse in myModels.B_WareHouseList
                                        where tbWareHouse.Remember == WareHouse.Remember
                                        select tbWareHouse).Count();
                if (oldWareHouseRows == 0)
                {
                    WareHouse.QuFenLeiXingID  = Convert.ToInt32(Request.Form["QuFenLeiXingID"]);  //进仓类型ID
                    WareHouse.Remember        = Request.Form["Remember"];                         //记录编号
                    WareHouse.SpouseBRanchID  = Convert.ToInt32(Request.Form["SpouseBRanchID"]);  //进货部门(采购)
                    WareHouse.OrderFormPactID = Convert.ToInt32(Request.Form["OrderFormPactID"]); //合同ID
                    WareHouse.StockPlaceID    = Convert.ToInt32(Request.Form["StockPlaceID"]);    //库存地点(销售部门)
                    WareHouse.Appendix        = Request.Form["Appendix"];                         //附件张数

                    WareHouse.StaffID      = Convert.ToInt32(Request.Form["StaffID"]);            //收货人
                    WareHouse.RegisterName = Request.Form["RegisterName"];                        //登记人
                    WareHouse.RegisterTime = Convert.ToDateTime(Request.Form["RegisterTime"]);    //登记时间


                    if (WareHouse.QuFenLeiXingID > 0 && WareHouse.SpouseBRanchID > 0 && WareHouse.StockPlaceID > 0 && WareHouse.StaffID > 0 &&
                        WareHouse.RegisterName != null && WareHouse.RegisterTime != null && WareHouse.OrderFormPactID > 0)
                    {
                        myModels.B_WareHouseList.Add(WareHouse);
                        myModels.SaveChanges();

                        B_WareHouseDetiailList WareHouseDetiail = new B_WareHouseDetiailList();

                        for (int H = 0; H < intsN.Length;)
                        {
                            for (int E = 0; E < intsM.Length;)
                            {
                                for (int d = 0; d < intsZ.Length; d++)
                                {
                                    WareHouseDetiail.WareHouseID       = WareHouse.WareHouseID;       //进货单ID
                                    WareHouseDetiail.OrderFormDetailID = Convert.ToInt32(intsZ[d]);;  //订单明细ID
                                    WareHouseDetiail.Subdivision       = Convert.ToDecimal(intsN[H]); //入库细数
                                    WareHouseDetiail.MumberOfPackages  = Convert.ToDecimal(intsM[E]); //入库件数
                                    myModels.B_WareHouseDetiailList.Add(WareHouseDetiail);
                                    myModels.SaveChanges();                                           //保存
                                    E++;
                                    H++;
                                }
                            }
                        }
                    }
                    else
                    {
                        return(Json("fali", JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(strMag, JsonRequestBehavior.AllowGet));
        }
示例#23
0
        public ActionResult UptuarPiCiBaoCun(Array JieGoodsShuZu, Array JiePiCiChShuZu, Array CheckReIDShuZu,
                                             Array CheckReDetailIDShuZu, Array MumberOfPacShuZu, Array SubdivisiShuZu, bool state)
        {
            ReturnJsonVo returnJson   = new ReturnJsonVo();
            ReturnJsonVo ChreturnJson = new ReturnJsonVo();
            string       strMag       = "fali";

            try
            {
                //一
                string   Z      = ((string[])JieGoodsShuZu)[0];
                string[] intsid = Z.Split(',');
                //二
                string   M        = ((string[])JiePiCiChShuZu)[0];
                string[] intsPiCi = M.Split(',');
                //三
                string   X = ((string[])CheckReIDShuZu)[0];
                string[] intsFanChangID = X.Split(',');
                //四
                string   D = ((string[])CheckReDetailIDShuZu)[0];
                string[] intsFanChangMingXiID = D.Split(',');
                //五
                string   Mun = ((string[])MumberOfPacShuZu)[0];
                string[] intMumberJianShu = Mun.Split(',');
                //六
                string   Su            = ((string[])SubdivisiShuZu)[0];
                string[] intSubdiviShu = Su.Split(',');



                B_CheckRemerbenDetillList ConverDeTailList = new B_CheckRemerbenDetillList();
                strMag = "succsee";
                for (int H = 0; H < intsFanChangMingXiID.Length;)
                {
                    for (int E = 0; E < intsFanChangID.Length;)
                    {
                        for (int d = 0; d < intsid.Length;)
                        {
                            for (int i = 0; i < intsPiCi.Length;)
                            {
                                for (int JianShu = 0; JianShu < intMumberJianShu.Length;)
                                {
                                    for (int XiShu = 0; XiShu < intSubdiviShu.Length;)
                                    {
                                        ConverDeTailList.CheckRemerbenDetillD = Convert.ToInt32(intsFanChangMingXiID[H]); //返仓明细ID

                                        ConverDeTailList.CheckRermeberID  = Convert.ToInt32(intsFanChangID[E]);           //返仓ID
                                        ConverDeTailList.GoodsID          = Convert.ToInt32(intsid[d]);                   //商品ID
                                        ConverDeTailList.PiCiHao          = Convert.ToDecimal(intsPiCi[i]);               //批号
                                        ConverDeTailList.MumberOfPackages = Convert.ToDecimal(intMumberJianShu[JianShu]); //入库件数
                                        ConverDeTailList.Subdivision      = Convert.ToDecimal(intSubdiviShu[H]);          //入库细数

                                        MyModels.Entry(ConverDeTailList).State = System.Data.Entity.EntityState.Modified;
                                        MyModels.SaveChanges();//保存

                                        XiShu++;
                                        JianShu++;
                                        i++;
                                        d++;
                                        E++;
                                        H++;


                                        B_CheckRemerbenDetillList Goofrtbool = (from tbbool in MyModels.B_CheckRemerbenDetillList
                                                                                where tbbool.CheckRemerbenDetillD == ConverDeTailList.CheckRemerbenDetillD
                                                                                select tbbool).Single(); //查询原状态
                                        Goofrtbool.JiaZaiFou             = state;                        //改变是否为商品状态
                                        MyModels.Entry(Goofrtbool).State = EntityState.Modified;

                                        B_CheckRemerbenList CherGoofrtbool = (from tbbool in MyModels.B_CheckRemerbenList
                                                                              where tbbool.CheckRermeberID == ConverDeTailList.CheckRermeberID
                                                                              select tbbool).Single(); //查询原状态
                                        CherGoofrtbool.YiJiaZaiGoodsNot      = state;                  //改变是否为主单状态
                                        MyModels.Entry(CherGoofrtbool).State = EntityState.Modified;

                                        if (MyModels.SaveChanges() > 0)//保存
                                        {
                                            returnJson.State = true;
                                            returnJson.Text  = "修改成功";
                                        }
                                        else
                                        {
                                            returnJson.State = false;
                                            returnJson.Text  = "修改失败";
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet));
        }