/// <summary>
 /// 转入生产计划
 /// </summary>
 /// <param name="SaleID"></param>
 /// <returns></returns>
 public int ToPlan(int SaleID, int FillMan)
 {
     try
     {
         // DataTable dt = GetList("(ID=" + SaleID + ")").Tables[0];
         Hownet.Model.SalesOrderInfoList modSOI = GetModel(SaleID);
         Hownet.BLL.SysTem           bllST      = new SysTem();
         Hownet.Model.SysTem         modST      = bllST.GetModel(bllST.GetMaxId() - 1);
         Hownet.BLL.ProductionPlan   bllPP      = new ProductionPlan();
         Hownet.Model.ProductionPlan modPP      = new Hownet.Model.ProductionPlan();
         modPP.SalesOrderInfoID = modSOI.ID;         // Convert.ToInt32(dt.Rows[0]["ID"]);
         modPP.MaterielID       = modSOI.MaterielID; // Convert.ToInt32(dt.Rows[0]["MaterielID"]);
         modPP.BrandID          = modSOI.BrandID;    // Convert.ToInt32(dt.Rows[0]["BrandID"]);
         modPP.Num = modSOI.Num;                     // Convert.ToInt32(dt.Rows[0]["Num"]);// bllPP.NewNum(DateTime.Today, modST.NumType);
         // dalPP.NewNum(DateTime.Today, modST.NumType);
         modPP.DateTime        = modSOI.DateTime;    // Convert.ToDateTime(dt.Rows[0]["DateTime"]);// DateTime.Today;
         modPP.LastDate        = modSOI.LastDate;    // Convert.ToDateTime(dt.Rows[0]["LastDate"]);
         modPP.Remark          = modSOI.Remark;      // dt.Rows[0]["Remark"].ToString();
         modPP.PWorkingID      = modPP.BomID = 0;
         modPP.CompanyID       = modSOI.CompanyID;   // Convert.ToInt32(dt.Rows[0]["CompanyID"]);
         modPP.IsTicket        = modPP.IsBom = false;
         modPP.VerifyDate      = Convert.ToDateTime("1900-1-1");
         modPP.VerifyMan       = 0;
         modPP.DeparmentID     = 0;
         modPP.UpData          = 1;
         modPP.FillDate        = DateTime.Today;
         modPP.FilMan          = FillMan;
         modPP.TicketDate      = Convert.ToDateTime("1900-1-1");
         modPP.BedNO           = string.Empty;
         modPP.PackingMethodID = modSOI.PackingMethodID;                       // Convert.ToInt32(dt.Rows[0]["PackingMethodID"]);
         modPP.SewingRemark    = modSOI.Remark + "\r\n" + modSOI.SewingRemark; // dt.Rows[0]["Remark"].ToString() + "\r\n" + dt.Rows[0]["SewingRemark"].ToString();
         modPP.TypeID          = modPP.ParentID = 0;
         modPP.ParentID        = 0;
         modPP.IsVerify        = 1;
         modPP.AssociatedID    = string.Empty;
         modPP.AssociatedMatID = 0;
         //dt.Rows[0]["IsToPlan"] = 1;
         modSOI.IsToPlan = true;
         Update(modSOI);
         // UpdateByDt(dt);
         return(bllPP.Add(modPP));
     }
     catch (Exception ex)
     {
         return(0);
     }
     // return dal.ToPlan(SaleID, FillMan);
 }
Beispiel #2
0
        public DataSet GetTemPayByPW(DateTime BeginDate, DateTime EndDate, int EmployeeID)
        {
            try
            {
                Hownet.BLL.OtherType          bllOT = new OtherType();
                List <Hownet.Model.OtherType> list  = bllOT.DataTableToList(bllOT.GetTypeList("伙食扣费").Tables[0]);
                DataTable dtPaySet = bllOT.GetNumValue().Tables[0];

                decimal ZhaoCan, WuCan, WanCan, Month;
                ZhaoCan = WuCan = WanCan = Month = 0;
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].Name == "早餐")
                    {
                        ZhaoCan = Convert.ToDecimal(list[i].Value);
                    }
                    else if (list[i].Name == "午餐")
                    {
                        WuCan = Convert.ToDecimal(list[i].Value);
                    }
                    else if (list[i].Name == "晚餐")
                    {
                        WanCan = Convert.ToDecimal(list[i].Value);
                    }
                }

                DataSet                 ds    = dal.GetTemPayByPW(BeginDate, EndDate, EmployeeID);
                Hownet.BLL.MiniEmp      bllME = new MiniEmp();
                DataTable               dtEMP = bllME.GetWorkList().Tables[0];
                Hownet.Model.Pay        modP  = new Hownet.Model.Pay();
                Hownet.BLL.PayCosts     bllPC = new PayCosts();
                Hownet.BLL.SysTem       bllST = new SysTem();
                Hownet.BLL.OrderingList bllOL = new OrderingList();
                Hownet.Model.SysTem     modST = bllST.GetModel(bllST.GetMaxId() - 1);
                DataTable               dtPC  = bllPC.GetListByDay(BeginDate, EndDate, EmployeeID).Tables[0];
                ds.Tables[0].Columns.Add("OneDate", typeof(string));
                ds.Tables[0].Columns.Add("TwoDate", typeof(string));
                ds.Tables[0].Columns.Add("NowMoney", typeof(decimal));
                ds.Tables[0].Columns.Add("FullAttendance", typeof(decimal));
                ds.Tables[0].Columns.Add("Fine", typeof(decimal));
                ds.Tables[0].Columns.Add("Deposit", typeof(decimal));
                ds.Tables[0].Columns.Add("Add1", typeof(decimal));
                ds.Tables[0].Columns.Add("Add2", typeof(decimal));
                ds.Tables[0].Columns.Add("Add3", typeof(decimal));
                ds.Tables[0].Columns.Add("Add4", typeof(decimal));
                ds.Tables[0].Columns.Add("Add5", typeof(decimal));
                ds.Tables[0].Columns.Add("Jian1", typeof(decimal));
                ds.Tables[0].Columns.Add("Jian2", typeof(decimal));
                ds.Tables[0].Columns.Add("Jian3", typeof(decimal));
                ds.Tables[0].Columns.Add("Jian4", typeof(decimal));
                ds.Tables[0].Columns.Add("Jian5", typeof(decimal));
                ds.Tables[0].Columns.Add("ActualMonth", typeof(decimal));
                ds.Tables[0].Columns.Add("NotFact", typeof(bool));
                ds.Tables["Info"].Columns.Add("Money", typeof(decimal));
                decimal price  = 0;
                decimal amount = 0;
                for (int i = 0; i < ds.Tables["Info"].Rows.Count; i++)
                {
                    price  = 0;
                    amount = 0;
                    if (ds.Tables["Info"].Rows[i]["Amount"].ToString() != "")
                    {
                        amount = decimal.Parse(ds.Tables["Info"].Rows[i]["Amount"].ToString());
                    }
                    if (ds.Tables["Info"].Rows[i]["Price"].ToString() != "")
                    {
                        price = decimal.Parse(ds.Tables["Info"].Rows[i]["Price"].ToString());
                    }
                    ds.Tables["Info"].Rows[i]["Money"] = (price * amount).ToString("N4");
                }
                ds.Tables["NoDefault"].Columns.Add("Money", typeof(decimal));

                if ((modST.DoubleNotDefaultWTNum > 0))
                {
                    for (int i = 0; i < ds.Tables["NoDefault"].Rows.Count; i++)
                    {
                        price  = 0;
                        amount = 0;
                        if (ds.Tables["NoDefault"].Rows[i]["Amount"].ToString() != "")
                        {
                            amount = decimal.Parse(ds.Tables["NoDefault"].Rows[i]["Amount"].ToString());
                        }
                        if (ds.Tables["NoDefault"].Rows[i]["Price"].ToString() != "")
                        {
                            price = decimal.Parse(ds.Tables["NoDefault"].Rows[i]["Price"].ToString());
                        }
                        ds.Tables["NoDefault"].Rows[i]["Money"] = (price * amount).ToString("N4");
                    }
                }
                else
                {
                    ds.Tables["NoDefault"].Rows.Clear();
                }
                int     AllowedCount = 0;
                decimal ErrorMoney   = 0;
                if (modST.AutoCaicBoardWages)
                {
                    // bllOL.CaicMoney(EndDate.AddDays(1));
                    AllowedCount = Convert.ToInt32(bllOT.GetList("(Name='允许违规次数')").Tables[0].Rows[0]["Value"]);
                    ErrorMoney   = Convert.ToDecimal(bllOT.GetList("(Name='订餐后未吃')").Tables[0].Rows[0]["Value"]);
                }
                DataRow[] drs;
                DataRow[] ddrs;
                DataRow[] drMEs;
                try
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ds.Tables[0].Rows[i]["OneDate"] = BeginDate.ToString("yyyy年MM月dd日");
                        ds.Tables[0].Rows[i]["TwoDate"] = EndDate.ToString("yyyy年MM月dd日");
                        if (ds.Tables[0].Rows[i]["Month"].ToString() != "")
                        {
                            modP.Month = decimal.Parse(ds.Tables[0].Rows[i]["Month"].ToString());
                        }
                        else
                        {
                            modP.Month = 0;
                        }
                        drs   = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=62) ");
                        drMEs = dtEMP.Select("(ID=" + ds.Tables[0].Rows[i]["EmployeeID"] + ")");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Payment"] = drs[0]["Money"];
                            modP.Payment = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Payment = 0;
                        }
                        if (modST.AutoCaicBoardWages)
                        {
                            modP.BoardWages = bllOL.GetMoney(Convert.ToInt32(ds.Tables[0].Rows[i]["EmployeeID"]), BeginDate, EndDate.AddDays(1), AllowedCount, ErrorMoney, ZhaoCan, WuCan, WanCan);
                            ds.Tables[0].Rows[i]["BoardWages"] = modP.BoardWages;
                        }
                        else
                        {
                            if (drMEs.Length > 0)
                            {
                                modP.BoardWages = Convert.ToDecimal(drMEs[0]["BoardWages"]);// bllME.GetModel(Convert.ToInt32(ds.Tables[0].Rows[i]["EmployeeID"])).BoardWages;
                                ds.Tables[0].Rows[i]["BoardWages"] = modP.BoardWages;
                            }
                            if (modP.BoardWages == 0)
                            {
                                drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=61)");
                                if (drs.Length > 0)
                                {
                                    ds.Tables[0].Rows[i]["BoardWages"] = drs[0]["Money"];
                                    modP.BoardWages = decimal.Parse(drs[0]["Money"].ToString());
                                }
                                else
                                {
                                    modP.BoardWages = 0;
                                }
                            }
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=60)");//计算补贴
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Repair"] = drs[0]["Money"];
                            modP.Repair = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Repair = 0;
                        }
                        if (modST.DoubleNotDefaultWTNum > 0)
                        {
                            ddrs = ds.Tables["NoDefault"].Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"] + ")");//计算非默认工种的补贴
                            if (ddrs.Length > 0)
                            {
                                for (int m = 0; m < ddrs.Length; m++)
                                {
                                    modP.Repair += Convert.ToDecimal(ddrs[m]["Money"]) * modST.DoubleNotDefaultWTNum;
                                }
                                ds.Tables[0].Rows[i]["Repair"] = modP.Repair;
                            }
                        }
                        if (dtPaySet.Rows.Count > 0)//有工资提成设置
                        {
                            if (drMEs.Length > 0)
                            {
                                if (Convert.ToBoolean(drMEs[0]["IsCaicTiCheng"]))
                                {
                                    Month = Convert.ToDecimal(ds.Tables[0].Rows[i]["Month"]);
                                    if (Month > Convert.ToInt32(dtPaySet.Rows[0][0]))//超过最高提成,直接添加
                                    {
                                        modP.Repair += Month * Convert.ToDecimal(dtPaySet.Rows[0][1]);
                                        ds.Tables[0].Rows[i]["Repair"] = modP.Repair;
                                    }
                                    else if (Month > Convert.ToInt32(dtPaySet.Rows[dtPaySet.Rows.Count - 1][0]))//小于最高提成额度但又大于最低提成额度,然后从大向小比较,
                                    {
                                        for (int j = 0; j < dtPaySet.Rows.Count; j++)
                                        {
                                            if (Month > Convert.ToDecimal(dtPaySet.Rows[j][0]))
                                            {
                                                modP.Repair += Month * Convert.ToDecimal(dtPaySet.Rows[j][1]);
                                                ds.Tables[0].Rows[i]["Repair"] = modP.Repair;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=91)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["FullAttendance"] = drs[0]["Money"];
                            modP.FullAttendance = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.FullAttendance = 0;
                        }

                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=92)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Fine"] = drs[0]["Money"];
                            modP.Fine = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Fine = 0;
                        }


                        //drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=92)");
                        //if (drs.Length > 0)
                        //{
                        //    ds.Tables[0].Rows[i]["Fine"] = drs[0]["Money"];
                        //    modP.Deposit = decimal.Parse(drs[0]["Money"].ToString());
                        //}
                        //else
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=109)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Deposit"] = drs[0]["Money"];
                            modP.Deposit = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Deposit = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=7)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Add1"] = drs[0]["Money"];
                            modP.Add1 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Add1 = 0;
                        }

                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=8)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Add2"] = drs[0]["Money"];
                            modP.Add2 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Add2 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=9)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Add3"] = drs[0]["Money"];
                            modP.Add3 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Add3 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=10)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Add4"] = drs[0]["Money"];
                            modP.Add4 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Add4 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=11)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Add5"] = drs[0]["Money"];
                            modP.Add5 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Add5 = 0;
                        }

                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=12)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Jian1"] = drs[0]["Money"];
                            modP.Jian1 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Jian1 = 0;
                        }

                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=13)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Jian2"] = drs[0]["Money"];
                            modP.Jian2 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Jian2 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=14)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Jian3"] = drs[0]["Money"];
                            modP.Jian3 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Jian3 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=15)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Jian4"] = drs[0]["Money"];
                            modP.Jian4 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Jian4 = 0;
                        }
                        drs = dtPC.Select("(EmployeeID=" + ds.Tables[0].Rows[i]["EmployeeID"].ToString() + ") and (TypeID=16)");
                        if (drs.Length > 0)
                        {
                            ds.Tables[0].Rows[i]["Jian5"] = drs[0]["Money"];
                            modP.Jian5 = decimal.Parse(drs[0]["Money"].ToString());
                        }
                        else
                        {
                            modP.Jian5 = 0;
                        }
                        ds.Tables[0].Rows[i]["ActualMonth"] = ds.Tables[0].Rows[i]["Month"];
                        ds.Tables[0].Rows[i]["NotFact"]     = false;
                        // ds.Tables[0].Rows[i]["NowMoney"] = modP.Month + modP.Repair - modP.BoardWages - modP.Payment + modP.FullAttendance - modP.Fine - modP.Deposit;
                    }
                }
                catch (Exception ex)
                {
                }

                return(ds);
            }
            catch (Exception ex)
            {
                return(new DataSet());
            }
        }
Beispiel #3
0
        /// <summary>
        /// 审核/弃审入库单
        /// </summary>
        /// <param name="ID">入库单ID</param>
        /// <param name="t">真为审核入库,假为弃审出库</param>
        public void Verify(int ID, bool t, int Depot)
        {
            Hownet.BLL.SysTem                     bllST   = new SysTem();
            Hownet.Model.SysTem                   modST   = bllST.GetModel(bllST.GetMaxId() - 1);
            Hownet.BLL.StockBackInfo              bllSBI  = new StockBackInfo();
            Hownet.BLL.MaterielList               bllML   = new MaterielList();
            Hownet.Model.MaterielList             modML   = new Hownet.Model.MaterielList();
            Hownet.BLL.Repertory                  bllRep  = new Repertory();
            Hownet.BLL.StockBackInfoList          bllSBIL = new StockBackInfoList();
            Hownet.BLL.RepertoryList              bllRL   = new RepertoryList();
            List <Hownet.Model.StockBackInfoList> liSBIL;

            Hownet.Model.RepertoryList        modRL;
            Hownet.Model.Repertory            modRep;
            Hownet.Model.StockBackInfo        modSBI;
            Hownet.Model.StockBack            modSB = GetModel(ID);
            List <Hownet.Model.StockBackInfo> li    = bllSBI.DataTableToList(bllSBI.GetList("(MainID=" + ID + ")").Tables[0]);

            for (int i = 0; i < li.Count; i++)
            {
                if (li[i].StockInfoID > 0)
                {
                    modSBI            = bllSBI.GetModel(li[i].StockInfoID);
                    modSBI.NotAmount -= li[i].Amount;
                    //if (dt.Rows[i]["NeedIsEnd"] != null && dt.Rows[i]["NeedIsEnd"] != DBNull.Value && dt.Rows[i]["NeedIsEnd"].ToString() != string.Empty)
                    //    modSBI.IsEnd = Convert.ToInt32(dt.Rows[i]["NeedIsEnd"]);

                    bllSBI.Update(modSBI);
                }
                if (li[i].MListID == 0)
                {
                    modML.BrandID    = li[i].BrandID;
                    modML.ColorID    = li[i].ColorID;
                    modML.ColorOneID = li[i].ColorOneID;
                    modML.ColorTwoID = li[i].ColorTwoID;
                    modML.SizeID     = li[i].SizeID;
                    modML.MaterielID = li[i].MaterielID;
                    modML.MeasureID  = li[i].CompanyMeasureID;

                    li[i].MListID = bllML.GetID(modML);
                    bllSBI.Update(li[i]);
                }
                liSBIL = bllSBIL.DataTableToList(bllSBIL.GetList("(InfoID=" + li[i].ID + ")").Tables[0]);
                if (liSBIL.Count > 0)
                {
                    for (int j = 0; j < liSBIL.Count; j++)
                    {
                        if (t)
                        {
                            liSBIL[j].BatchNumber = li[i].MListID;
                            bllSBIL.Update(liSBIL[j]);
                            modRL               = new Hownet.Model.RepertoryList();
                            modRL.A             = 1;
                            modRL.Amount        = modRL.NotAmount = liSBIL[j].Amount;
                            modRL.BatchNumber   = liSBIL[j].BatchNumber;
                            modRL.DateTime      = DateTime.Now;
                            modRL.DepotInfoID   = liSBIL[j].DepotInfoID;
                            modRL.DepotInfoName = string.Empty;
                            modRL.ID            = 0;
                            modRL.IsEnd         = false;
                            modRL.MainID        = ID;
                            modRL.Remark        = liSBIL[j].Remark;
                            modRL.SpecID        = liSBIL[j].SpecID;
                            modRL.SpecName      = string.Empty;
                            modRL.StockListID   = liSBIL[j].ID;
                            modRL.QRID          = liSBIL[j].ID.ToString();
                            bllRL.Add(modRL);
                        }
                        else
                        {
                            bllRL.DeleteByStockInfoID(liSBIL[j].ID);
                        }
                    }
                }
                if ((!modST.MaterielByTask) && (modSB.State != (int)Hownet.BLL.Enums.TableType._采购部收货))
                {
                    modRep              = new Hownet.Model.Repertory();
                    modRep.BrandID      = li[i].BrandID;
                    modRep.ColorID      = li[i].ColorID;
                    modRep.ColorOneID   = li[i].ColorOneID;
                    modRep.ColorTwoID   = li[i].ColorTwoID;
                    modRep.SizeID       = li[i].SizeID;
                    modRep.MaterielID   = li[i].MaterielID;
                    modRep.MeasureID    = li[i].CompanyMeasureID;
                    modRep.MListID      = li[i].MListID;
                    modRep.Amount       = li[i].Amount;
                    modRep.DepartmentID = Depot;
                    modRep.Price        = li[i].Price;
                    modRep.Money        = li[i].Money;
                    bllRep.InOrOut(modRep, t);
                }
                if (modSB.State == (int)Hownet.BLL.Enums.TableType._采购部收货)
                {
                    modRep              = new Hownet.Model.Repertory();
                    modRep.BrandID      = li[i].BrandID;
                    modRep.ColorID      = li[i].ColorID;
                    modRep.ColorOneID   = li[i].ColorOneID;
                    modRep.ColorTwoID   = li[i].ColorTwoID;
                    modRep.SizeID       = li[i].SizeID;
                    modRep.MaterielID   = li[i].MaterielID;
                    modRep.MeasureID    = li[i].CompanyMeasureID;
                    modRep.MListID      = li[i].MListID;
                    modRep.Amount       = li[i].Amount;
                    modRep.DepartmentID = Depot;
                    modRep.Price        = li[i].Price;
                    modRep.Money        = li[i].Money;
                    bllRep.InOrOut(modRep, t);
                }
            }
            // Hownet.Model.StockBack modSB = GetModel(ID);
            if (modSB.State == (int)Hownet.BLL.Enums.TableType.P2D)
            {
                if (modSB.CompanyID > 0)
                {
                    Hownet.BLL.Company   bllCom = new Company();
                    Hownet.Model.Company modCom = bllCom.GetModel(modSB.CompanyID);
                    if (t)//收货
                    {
                        modCom.Weight -= modSB.Weight;
                    }
                    else
                    {
                        modCom.Weight += modSB.Weight;
                    }
                    bllCom.Update(modCom);
                }
            }
        }