Beispiel #1
0
        /// <summary>
        /// 删除(销售单)
        /// </summary>
        /// <returns></returns>
        public ActionResult DeleteWareHert(int sellID)
        {
            string strMsg = "fail";

            try
            {
                B_SellList conver = (from tbWarHouser in MyModels.B_SellList
                                     where tbWarHouser.SellID == sellID
                                     select tbWarHouser).Single();
                MyModels.B_SellList.Remove(conver);

                int waDetialid = (int)conver.SellID;

                //查询对应对应明细(总数量)
                var converDetial = (from tbWarHouserDetial in MyModels.B_SellDeTaLsit
                                    where tbWarHouserDetial.SellID == waDetialid
                                    select tbWarHouserDetial).ToList();
                int thyCount = converDetial.Count();

                if (thyCount > 0)
                {
                    for (int i = 0; i < thyCount; i++)
                    {
                        MyModels.B_SellDeTaLsit.Remove(converDetial[i]);
                        MyModels.SaveChanges();
                        strMsg = "success";
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(strMsg, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        /// <summary>
        /// 记录编号
        /// </summary>
        /// <returns></returns>
        public ActionResult getEmpCodef()
        {
            string Std   = "";
            var    listy = (from tbem in MyModels.B_SellList
                            orderby tbem.Remember
                            select tbem).ToList();

            if (listy.Count > 0)
            {
                int        intcoun  = listy.Count;
                B_SellList mymodell = listy[intcoun - 1];
                int        inemp    = Convert.ToInt32(mymodell.Remember.Substring(1, 8));
                inemp++;
                Std = inemp.ToString();
                for (int i = 0; i < 8; i++)
                {
                    Std = Std.Length < 8 ? "0" + Std : Std;
                }
            }
            else
            {
                Std = "00000001";
            }
            return(Json(Std, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult UptuSelllist(B_SellList OK, Array JieShouID, Array JieShouJianShu, Array JieSellDateIDShu)
        {
            string strMag = "fali";

            try
            {
                //一
                string   Z      = ((string[])JieShouID)[0];
                string[] intsid = Z.Split(',');
                //二
                string   M          = ((string[])JieShouJianShu)[0];
                string[] intsRuJian = M.Split(',');

                //三
                string   B             = ((string[])JieSellDateIDShu)[0];
                string[] intsSellDeTal = B.Split(',');

                B_SellList MyB_ConverList = new B_SellList();
                MyB_ConverList.SellID         = OK.SellID;
                MyB_ConverList.Remember       = OK.Remember;
                MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID;
                MyB_ConverList.PanlDate       = OK.PanlDate;
                MyB_ConverList.RegisterName   = OK.RegisterName;
                MyB_ConverList.RegisterTime   = OK.RegisterTime;

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

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

                    B_SellDeTaLsit ConverDeTailList = new B_SellDeTaLsit();

                    for (int H = 0; H < intsid.Length;)
                    {
                        for (int E = 0; E < intsRuJian.Length;)
                        {
                            for (int S = 0; S < intsSellDeTal.Length; S++)
                            {
                                ConverDeTailList.SellID                = MyB_ConverList.SellID;
                                ConverDeTailList.ConverDeTaiID         = Convert.ToInt32(intsid[H]);        //配货ID
                                ConverDeTailList.ConverID              = Convert.ToInt32(intsRuJian[E]);    //配货明细ID
                                ConverDeTailList.SellDeTaliID          = Convert.ToInt32(intsSellDeTal[S]); //配货明细ID
                                MyModels.Entry(ConverDeTailList).State = System.Data.Entity.EntityState.Modified;
                                MyModels.SaveChanges();                                                     //保存
                                E++;
                                H++;
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(strMag, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        public ActionResult InterDiaoBa(B_SellList OK, Array JieShouID, Array JieShouJianShu)
        {
            string strMag = "fali";

            try
            {
                //一
                string   Z      = ((string[])JieShouID)[0];
                string[] intsid = Z.Split(',');
                //二
                string   M          = ((string[])JieShouJianShu)[0];
                string[] intsRuJian = M.Split(',');

                B_SellList MyB_ConverList = new B_SellList();

                MyB_ConverList.Remember       = OK.Remember;
                MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID;
                MyB_ConverList.PanlDate       = OK.PanlDate;
                MyB_ConverList.RegisterName   = OK.RegisterName;
                MyB_ConverList.RegisterTime   = OK.RegisterTime;


                MyModels.B_SellList.Add(MyB_ConverList);

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

                    B_SellDeTaLsit ConverDeTailList = new B_SellDeTaLsit();

                    for (int H = 0; H < intsid.Length;)
                    {
                        for (int E = 0; E < intsRuJian.Length; E++)
                        {
                            ConverDeTailList.SellID        = MyB_ConverList.SellID;
                            ConverDeTailList.ConverDeTaiID = Convert.ToInt32(intsid[H]);     //配货ID
                            ConverDeTailList.ConverID      = Convert.ToInt32(intsRuJian[E]); //配货明细ID
                            MyModels.B_SellDeTaLsit.Add(ConverDeTailList);
                            MyModels.SaveChanges();                                          //保存
                            H++;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(Json(strMag, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        public ActionResult ShenHeSelllist(B_SellList OK, bool state)
        {
            ReturnJsonVo returnJson = new ReturnJsonVo();
            string       strMag     = "fali";

            try
            {
                B_SellList MyB_ConverList = new B_SellList();
                MyB_ConverList.SellID         = OK.SellID;
                MyB_ConverList.Remember       = OK.Remember;
                MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID;
                MyB_ConverList.PanlDate       = OK.PanlDate;
                MyB_ConverList.RegisterName   = OK.RegisterName;
                MyB_ConverList.RegisterTime   = OK.RegisterTime;
                MyB_ConverList.ExamineName    = OK.ExamineName;
                MyB_ConverList.ExecuteTime    = OK.ExecuteTime;

                MyB_ConverList.QiDongName = OK.QiDongName;
                MyB_ConverList.QiDongTime = OK.QiDongTime;

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

                if (MyModels.SaveChanges() > 0)
                {
                    strMag = "succsee";
                    //审核
                    B_SellList wafrtbool = (from tbbool in MyModels.B_SellList
                                            where tbbool.SellID == MyB_ConverList.SellID
                                            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  = "修改失败";
                    }
                    //启动
                    B_SellList wafrtboolf = (from tbbool in MyModels.B_SellList
                                             where tbbool.SellID == MyB_ConverList.SellID
                                             select tbbool).Single(); //查询原状态
                    wafrtboolf.QiDongmineNot         = state;         //改变是否为冲红单状态
                    MyModels.Entry(wafrtboolf).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));
        }