Ejemplo n.º 1
0
        public static DateTime GetLastBackupTime()
        {
            Hownet.BLL.OtherType bllOT = new Hownet.BLL.OtherType();
            DataTable            dtTem = bllOT.GetList("(Name='备份文件夹位置')").Tables[0];
            string filePath            = "C:\\";

            if (dtTem.Rows.Count > 0)
            {
                filePath = dtTem.Rows[0]["Value"].ToString();
            }
            DirectoryInfo di = new DirectoryInfo(filePath);

            FileInfo[] arrFi = di.GetFiles("*.bak");
            // SortAsFileCreationTime(ref arrFi);
            if (arrFi.Length > 0)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("One");
                dt.Columns.Add("Two", typeof(DateTime));
                for (int i = 0; i < arrFi.Length; i++)
                {
                    dt.Rows.Add(arrFi[i].Name, Convert.ToDateTime(arrFi[i].CreationTime));
                }
                dt.DefaultView.Sort = "Two DESC";
                return(Convert.ToDateTime(dt.DefaultView[0]["Two"]));
            }
            else
            {
                return(Convert.ToDateTime("1900-1-1"));
            }
        }
Ejemplo n.º 2
0
        public static void SetCate()
        {
            Hownet.BLL.OtherType          bllOT = new Hownet.BLL.OtherType();
            List <Hownet.Model.OtherType> list  = bllOT.DataTableToList(bllOT.GetTypeList("伙食扣费").Tables[0]);

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].Name == "就餐成功")
                {
                    就餐成功 = list[i].Value;
                }
                else if (list[i].Name == "重复就餐")
                {
                    重复就餐 = list[i].Value;
                }
                else if (list[i].Name == "未订吃饭")
                {
                    未订吃饭 = list[i].Value;
                }
            }
        }
Ejemplo n.º 3
0
        private void CaicMinute(int ID)
        {
            try
            {
                modAR = bllAR.GetModel(ID);

                int a = 0;
                modAR.DayWorkMin = modAR.AbsenteeismMin = modAR.BeLateMin = modAR.OvertimeMin = modAR.LeaveEarlyMin = modAR.LateAtNight = 0;
                Hownet.BLL.OtherType bllOT = new Hownet.BLL.OtherType();
                bool IsCaic = Convert.ToInt32(bllOT.GetList("(Name='按实际刷卡计时')").Tables[0].Rows[0]["Value"]) == 1;
                if (IsCaic)
                {
                    if (modAR.TimeOne.HasValue && modAR.TimeTwo.HasValue)
                    {
                        TimeSpan ts = (TimeSpan)(modAR.TimeTwo - modAR.TimeOne);
                        a = ts.Hours * 60 + ts.Minutes;
                        if (a > 0)
                        {
                            modAR.DayWorkMin += a;
                        }
                    }
                    if (modAR.TimeThree.HasValue && modAR.TimeFour.HasValue)
                    {
                        TimeSpan ts = (TimeSpan)(modAR.TimeFour - modAR.TimeThree);
                        a = ts.Hours * 60 + ts.Minutes;
                        if (a > 0)
                        {
                            modAR.DayWorkMin += a;
                        }
                    }
                    if (modAR.TimeFive.HasValue && modAR.TimeSix.HasValue)
                    {
                        DateTime ddN = Convert.ToDateTime(modAR.DateDay.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='lThree')")[0]["Value"]); //晚上加班下班时间,用于判断晚班有深夜班时间
                        if (!(ddN < (DateTime)(modAR.TimeSix)))                                                                                                        //晚上下班提前或正常下班的。
                        {
                            TimeSpan ts = (TimeSpan)(modAR.TimeSix - modAR.TimeFive);
                            a = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.OvertimeMin = a;
                            }
                        }
                        else//超过夜班下班时间的。
                        {
                            TimeSpan ts = (TimeSpan)(ddN - modAR.TimeFive);
                            a = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.OvertimeMin = a;
                            }
                            ts = (TimeSpan)(modAR.TimeSix - ddN);
                            a  = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.LateAtNight = a;
                            }
                        }
                    }
                }
                else
                {
                    DateTime ddt    = modAR.DateDay;
                    DateTime one    = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='One')")[0]["Value"].ToString());
                    DateTime lone   = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='lOne')")[0]["Value"].ToString());
                    DateTime two    = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='Two')")[0]["Value"].ToString());
                    DateTime ltwo   = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='lTwo')")[0]["Value"].ToString());
                    DateTime three  = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='Three')")[0]["Value"].ToString());
                    DateTime lthree = Convert.ToDateTime(ddt.Date.ToShortDateString() + " " + BasicTable.dtAttRules.Select("(Name='lThree')")[0]["Value"].ToString());
                    if (modAR.TimeOne.HasValue && modAR.TimeTwo.HasValue)
                    {
                        if (modAR.TimeTwo < lone)
                        {
                            lone = Convert.ToDateTime(modAR.TimeTwo);
                        }
                        if (modAR.TimeOne > one)
                        {
                            one = Convert.ToDateTime(modAR.TimeOne);
                        }
                        TimeSpan ts = (TimeSpan)(lone - one);
                        a = ts.Hours * 60 + ts.Minutes;
                        if (a > 0)
                        {
                            modAR.DayWorkMin += a;
                        }
                    }
                    if (modAR.TimeThree.HasValue && modAR.TimeFour.HasValue)
                    {
                        if (modAR.TimeFour < ltwo)
                        {
                            ltwo = Convert.ToDateTime(modAR.TimeFour);
                        }
                        if (modAR.TimeThree > two)
                        {
                            two = Convert.ToDateTime(modAR.TimeThree);
                        }
                        TimeSpan ts = (TimeSpan)(ltwo - two);
                        a = ts.Hours * 60 + ts.Minutes;
                        if (a > 0)
                        {
                            modAR.DayWorkMin += a;
                        }
                    }
                    if (modAR.TimeFive.HasValue && modAR.TimeSix.HasValue)
                    {
                        if (!(lthree < (DateTime)(modAR.TimeSix))) //晚上下班提前或正常下班的。
                        {
                            if (modAR.TimeFive > three)
                            {
                                three = Convert.ToDateTime(modAR.TimeFive);
                            }
                            TimeSpan ts = (TimeSpan)(modAR.TimeSix - three);
                            a = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.OvertimeMin = a;
                            }
                        }
                        else//超过夜班下班时间的。
                        {
                            if (modAR.TimeFive > three)
                            {
                                three = Convert.ToDateTime(modAR.TimeFive);
                            }
                            TimeSpan ts = (TimeSpan)(lthree - three);
                            a = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.OvertimeMin = a;
                            }
                            ts = (TimeSpan)(modAR.TimeSix - lthree);
                            a  = ts.Hours * 60 + ts.Minutes;
                            if (a > 0)
                            {
                                modAR.LateAtNight = a;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            bllAR.Update(modAR);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 审核/弃审入库单
        /// </summary>
        /// <param name="ID">入库单ID</param>
        /// <param name="t">真为审核入库,假为弃审出库</param>
        public void Verify(int ID, bool t, int VerifyMan, int DepotID, int TypeID)
        {
            if (TypeID == (int)Enums.TableType.P2D)
            {
                try
                {
                    Hownet.BLL.Product2DepotInfo bllP2DI = new Product2DepotInfo();
                    Hownet.BLL.AmountInfo        bllAI   = new AmountInfo();
                    Hownet.BLL.Repertory         bllRep  = new Repertory();
                    Hownet.BLL.MaterielList      bllML   = new MaterielList();
                    Hownet.BLL.Materiel          bllMat  = new Materiel();
                    Hownet.Model.AmountInfo      modAI   = new Hownet.Model.AmountInfo();
                    Hownet.Model.Repertory       modRep  = new Model.Repertory();
                    Hownet.Model.MaterielList    modML   = new Hownet.Model.MaterielList();
                    Hownet.BLL.RepertoryList     bllRL   = new RepertoryList();
                    Hownet.Model.RepertoryList   modRL   = new Model.RepertoryList();
                    DataTable dtRL = new DataTable();
                    Hownet.Model.Product2Depot modP2D = GetModel(ID);
                    DataTable dtP2DI = bllP2DI.GetList("(MainID=" + ID + ")").Tables[0];
                    List <Hownet.Model.Product2DepotInfo> li = bllP2DI.DataTableToList(bllP2DI.GetList("(MainID=" + ID + ")").Tables[0]);
                    modAI.TableTypeID = 1;
                    Hownet.BLL.OtherType bllOT = new Hownet.BLL.OtherType();
                    DataTable            dtOT  = bllOT.GetTypeList("成品单位").Tables[0];
                    decimal one = 1;
                    decimal two = 1;
                    int     dM  = 0;

                    if (dtOT.Rows.Count > 0)
                    {
                        one = Convert.ToDecimal(dtOT.Select("(Name='车间换算')")[0]["Value"]);
                        two = Convert.ToDecimal(dtOT.Select("(Name='仓储换算')")[0]["Value"]);
                        dM  = Convert.ToInt32(dtOT.Select("(Name='仓储单位')")[0]["Value"]);
                    }


                    for (int i = 0; i < li.Count; i++)
                    {
                        modRep = new Model.Repertory();
                        modRep.DepartmentID = DepotID;
                        modRep.BrandName    = modRep.ColorName = modRep.ColorOneName = modRep.ColorTwoName = modRep.CompanyName = modRep.DeparmentName = modRep.DepotInfoName = modRep.MaterielName = modRep.MeasureName = modRep.Remark = modRep.SizeName = modRep.SpecName = modRep.SupplierName = modRep.SupplierSN = string.Empty;

                        modRep.BrandID    = modML.BrandID = li[i].BrandID;
                        modRep.ColorID    = modML.ColorID = li[i].ColorID;
                        modRep.ColorOneID = modML.ColorOneID = li[i].ColorOneID;
                        modRep.ColorTwoID = modML.ColorTwoID = li[i].ColorTwoID;
                        modRep.SizeID     = modML.SizeID = li[i].SizeID;
                        modRep.MaterielID = modML.MaterielID = li[i].MaterielID;
                        modRep.MeasureID  = modML.MeasureID = bllMat.GetModel(li[i].MaterielID).MeasureID;
                        modAI.MainID      = li[i].TaskID;
                        modRep.Amount     = modAI.NotAmount = li[i].Amount;
                        modRep.MListID    = modAI.MListID = li[i].MListID;
                        if (li[i].MListID == 0)
                        {
                            modAI.MListID = li[i].MListID = bllML.GetID(modML);
                            bllP2DI.Update(li[i]);
                            if (dM > 0)
                            {
                                modML.MeasureID = dM;
                            }
                            modRep.MListID = bllML.GetID(modML);
                        }
                        else
                        {
                            if (dM > 0)
                            {
                                modML.MeasureID = dM;
                            }
                            modRep.MListID = bllML.GetID(modML);
                        }
                        if (li[i].TaskID > 0)
                        {
                            if (t)
                            {
                                if (one > 1 || two > 1)
                                {
                                    modAI.Amount -= ((int)(li[i].Amount * two / one));
                                }
                                else
                                {
                                    modAI.Amount -= li[i].Amount;
                                }
                                if (modAI.Amount < 0)
                                {
                                    modAI.Amount = 0;
                                }
                            }
                            else
                            {
                                if (one > 1 || two > 1)
                                {
                                    modAI.Amount += ((int)(li[i].Amount * two / one));
                                }
                                else
                                {
                                    modAI.Amount += li[i].Amount;
                                }
                            }


                            bllAI.UpNotAmount(modAI, t);
                        }
                        if (dM > 0)
                        {
                            modRep.MeasureID = dM;
                        }
                        else
                        {
                            modRep.MeasureID = modML.MeasureID;
                        }
                        modRep.ID = bllRep.InOrOut(modRep, t);
                        if (li[i].DepotInfoID > 0)
                        {
                            dtRL = bllRL.GetList("(BatchNumber=" + li[i].MListID + ") And (DepotInfoID=" + li[i].DepotInfoID + ")").Tables[0];

                            if (dtRL.Rows.Count == 0)
                            {
                                if (t)
                                {
                                    modRL               = new Model.RepertoryList();
                                    modRL.A             = 1;
                                    modRL.NotAmount     = modRL.Amount = li[i].Amount;
                                    modRL.BatchNumber   = li[i].MListID;
                                    modRL.DateTime      = DateTime.Now;
                                    modRL.DepotInfoID   = li[i].DepotInfoID;
                                    modRL.DepotInfoName = string.Empty;
                                    modRL.ID            = 0;
                                    modRL.IsEnd         = false;
                                    modRL.MainID        = modRep.ID;
                                    modRL.PlanID        = 0;
                                    modRL.QRID          = li[i].MListID.ToString();
                                    modRL.Remark        = string.Empty;
                                    modRL.SpecID        = 0;
                                    modRL.SpecName      = string.Empty;
                                    modRL.StockListID   = 0;
                                    bllRL.Add(modRL);
                                }
                            }
                            else if (dtRL.Rows.Count == 1)
                            {
                                modRL = bllRL.GetModel(Convert.ToInt32(dtRL.Rows[0]["ID"]));
                                if (t)
                                {
                                    modRL.Amount += li[i].Amount;
                                }
                                else
                                {
                                    modRL.Amount -= li[i].Amount;
                                }
                                bllRL.Update(modRL);
                            }
                            else if (dtRL.Rows.Count > 1)
                            {
                                List <Hownet.Model.RepertoryList> liRL = bllRL.DataTableToList(dtRL);
                                for (int j = 1; j < liRL.Count; j++)
                                {
                                    liRL[0].Amount += liRL[j].Amount;
                                    bllRL.Delete(liRL[j].ID);
                                }
                                if (t)
                                {
                                    liRL[0].Amount += li[i].Amount;
                                }
                                else
                                {
                                    liRL[0].Amount -= li[i].Amount;
                                }
                                bllRL.Update(liRL[0]);
                            }
                        }
                    }
                    if (t)
                    {
                        modP2D.IsVerify   = 3;
                        modP2D.VerifyDate = DateTime.Today;
                        modP2D.VerifyMan  = VerifyMan;
                    }
                    else
                    {
                        modP2D.IsVerify   = 1;
                        modP2D.VerifyDate = DateTime.Parse("1900-1-1");
                        modP2D.VerifyMan  = 0;
                    }
                    Update(modP2D);
                }
                catch (Exception ex)
                {
                }
            }
            else if (TypeID == (int)Enums.TableType.P2Pack)
            {
                try
                {
                    Hownet.BLL.Product2DepotInfo bllP2DI = new Product2DepotInfo();
                    Hownet.BLL.AmountInfo        bllAI   = new AmountInfo();
                    Hownet.BLL.PackAmount        bllPA   = new PackAmount();
                    Hownet.BLL.MaterielList      bllML   = new MaterielList();
                    Hownet.BLL.Materiel          bllMat  = new Materiel();
                    Hownet.Model.AmountInfo      modAI   = new Hownet.Model.AmountInfo();
                    Hownet.Model.PackAmount      modPA   = new Hownet.Model.PackAmount();
                    Hownet.Model.MaterielList    modML   = new Hownet.Model.MaterielList();
                    Hownet.Model.Product2Depot   modP2D  = GetModel(ID);
                    Hownet.BLL.OtherType         bllOT   = new OtherType();
                    DataTable dtOT          = bllOT.GetTypeList("成品单位").Tables[0];
                    int       TaskMeasureID = 0;
                    DataRow[] drs           = dtOT.Select("(Name='车间单位')");
                    if (drs.Length == 1)
                    {
                        TaskMeasureID = Convert.ToInt32(drs[0]["Value"]);
                    }
                    List <Hownet.Model.Product2DepotInfo> li = bllP2DI.DataTableToList(bllP2DI.GetList("(MainID=" + ID + ")").Tables[0]);
                    modAI.TableTypeID  = 1;
                    modPA.DepartmentID = DepotID;
                    for (int i = 0; i < li.Count; i++)
                    {
                        if (li[i].MaterielID > 0)
                        {
                            modPA.BrandID    = modML.BrandID = li[i].BrandID;
                            modPA.ColorID    = modML.ColorID = li[i].ColorID;
                            modPA.ColorOneID = modML.ColorOneID = li[i].ColorOneID;
                            modPA.ColorTwoID = modML.ColorTwoID = li[i].ColorTwoID;
                            modPA.SizeID     = modML.SizeID = li[i].SizeID;
                            modPA.MaterielID = modML.MaterielID = li[i].MaterielID;
                            modML.MeasureID  = bllMat.GetModel(li[i].MaterielID).MeasureID;
                            if (TaskMeasureID > 0)
                            {
                                modPA.MeasureID = TaskMeasureID;
                            }
                            else
                            {
                                modPA.MeasureID = modML.MeasureID;
                            }
                            modAI.MainID = li[i].TaskID;
                            modPA.PlanID = li[i].TaskID;
                            modPA.Remark = string.Empty;
                            modPA.Amount = modAI.NotAmount = li[i].Amount;

                            if (li[i].ColorID > 0 && li[i].SizeID > 0)
                            {
                                if (li[i].MListID == 0)
                                {
                                    modAI.MListID = modPA.MListID = li[i].MListID = bllML.GetID(modML);
                                    bllP2DI.Update(li[i]);
                                }
                                else
                                {
                                    modAI.MListID = modPA.MListID = li[i].MListID;
                                }
                                bllAI.UpNotAmount(modAI, t);
                                bllPA.InOrOut(modPA, t);
                            }
                        }
                        else
                        {
                            bllP2DI.Delete(li[i].ID);
                        }
                    }
                    if (t)
                    {
                        modP2D.IsVerify   = 3;
                        modP2D.VerifyDate = DateTime.Today;
                        modP2D.VerifyMan  = VerifyMan;
                    }
                    else
                    {
                        modP2D.IsVerify   = 1;
                        modP2D.VerifyDate = DateTime.Parse("1900-1-1");
                        modP2D.VerifyMan  = 0;
                    }
                    Update(modP2D);
                }
                catch (Exception ex)
                {
                }
            }
        }
Ejemplo n.º 5
0
        public void Verify(int MainID, bool IsVerify)
        {
            Hownet.BLL.Pack2DepotMain          bllPDM = new Pack2DepotMain();
            Hownet.Model.Pack2DepotMain        modPDM = bllPDM.GetModel(MainID);
            List <Hownet.Model.Pack2DepotInfo> li     = DataTableToList(GetList("(MainID=" + MainID + ")").Tables[0]);

            Hownet.BLL.Repertory       bllRep = new Repertory();
            Hownet.BLL.PackAmount      bllPA  = new PackAmount();
            Hownet.BLL.RepertoryList   bllRL  = new RepertoryList();
            Hownet.BLL.MaterielList    bllML  = new MaterielList();
            Hownet.Model.MaterielList  modML  = new Model.MaterielList();
            Hownet.Model.RepertoryList modRL  = new Model.RepertoryList();
            DataTable dtRL = new DataTable();

            Hownet.Model.PackAmount modPA  = new Hownet.Model.PackAmount();
            Hownet.Model.Repertory  modRep = new Hownet.Model.Repertory();
            modRep.BrandName = modRep.ColorName = modRep.ColorOneName = modRep.ColorTwoName = modRep.CompanyName = modRep.DeparmentName = modRep.DepotInfoName = modRep.MaterielName = modRep.MeasureName = modRep.Remark = modRep.SizeName = modRep.SpecName = modRep.SupplierName = modRep.SupplierSN = string.Empty;

            Hownet.BLL.OtherType bllOT = new Hownet.BLL.OtherType();
            DataTable            dtOT  = bllOT.GetTypeList("成品单位").Tables[0];
            decimal one = 1;
            decimal two = 1;
            int     dM  = 0;

            if (dtOT.Rows.Count > 0)
            {
                one = Convert.ToDecimal(dtOT.Select("(Name='车间换算')")[0]["Value"]);
                two = Convert.ToDecimal(dtOT.Select("(Name='仓储换算')")[0]["Value"]);
                dM  = Convert.ToInt32(dtOT.Select("(Name='仓储单位')")[0]["Value"]);
            }
            try
            {
                for (int i = 0; i < li.Count; i++)
                {
                    modPA = bllPA.GetModel(li[i].PackAmountID);
                    if (IsVerify)
                    {
                        if (one > 1 || two > 1)
                        {
                            if (one > 0)
                            {
                                modPA.Amount -= ((int)(li[i].NowAmount * two / one));
                            }
                        }
                        else
                        {
                            modPA.Amount -= li[i].NowAmount;
                        }
                        if (modPA.Amount < 0)
                        {
                            modPA.Amount = 0;
                        }
                    }
                    else
                    {
                        if (one > 1 || two > 1)
                        {
                            if (one > 0)
                            {
                                modPA.Amount += ((int)(li[i].NowAmount * two / one));
                            }
                        }
                        else
                        {
                            modPA.Amount += li[i].NowAmount;
                        }
                    }
                    bllPA.Update(modPA);

                    modRep           = new Hownet.Model.Repertory();
                    modRep.BrandName = modRep.ColorName = modRep.ColorOneName = modRep.ColorTwoName = modRep.CompanyName = modRep.DeparmentName = modRep.DepotInfoName = modRep.MaterielName = modRep.MeasureName = modRep.Remark = modRep.SizeName = modRep.SpecName = modRep.SupplierName = modRep.SupplierSN = string.Empty;

                    modRep.DepartmentID = modPDM.DepotID;
                    modRep.BrandID      = modML.BrandID = li[i].BrandID;
                    modRep.ColorID      = modML.ColorID = li[i].ColorID;
                    modRep.ColorOneID   = modML.ColorOneID = li[i].ColorOneID;
                    modRep.ColorTwoID   = modML.ColorTwoID = li[i].ColorTwoID;
                    modRep.SizeID       = modML.SizeID = li[i].SizeID;
                    modRep.MaterielID   = modML.MaterielID = li[i].MaterielID;
                    if (dM > 0)
                    {
                        modRep.MeasureID = dM;
                    }
                    else
                    {
                        modRep.MeasureID = li[i].MeasureID;
                    }
                    modML.MeasureID = modRep.MeasureID;
                    modRep.Amount   = li[i].NowAmount;
                    modRep.MListID  = li[i].MListID;
                    if (li[i].DepotBrandID > 0)
                    {
                        modRep.BrandID = modML.BrandID = li[i].DepotBrandID;
                        modRep.MListID = bllML.GetID(modML);
                    }
                    modRep.ID = bllRep.InOrOut(modRep, IsVerify);
                    if (li[i].DepotInfoID > 0)
                    {
                        dtRL = bllRL.GetList("(BatchNumber=" + li[i].MListID + ") And (DepotInfoID=" + li[i].DepotInfoID + ")").Tables[0];

                        if (dtRL.Rows.Count == 0)
                        {
                            if (IsVerify)
                            {
                                modRL               = new Model.RepertoryList();
                                modRL.A             = 1;
                                modRL.NotAmount     = modRL.Amount = li[i].NowAmount;
                                modRL.BatchNumber   = li[i].MListID;
                                modRL.DateTime      = DateTime.Now;
                                modRL.DepotInfoID   = li[i].DepotInfoID;
                                modRL.DepotInfoName = string.Empty;
                                modRL.ID            = 0;
                                modRL.IsEnd         = false;
                                modRL.MainID        = modRep.ID;
                                modRL.PlanID        = 0;
                                modRL.QRID          = li[i].MListID.ToString();
                                modRL.Remark        = string.Empty;
                                modRL.SpecID        = 0;
                                modRL.SpecName      = string.Empty;
                                modRL.StockListID   = 0;
                                bllRL.Add(modRL);
                            }
                        }
                        else if (dtRL.Rows.Count == 1)
                        {
                            modRL = bllRL.GetModel(Convert.ToInt32(dtRL.Rows[0]["ID"]));
                            if (IsVerify)
                            {
                                modRL.Amount += li[i].NowAmount;
                            }
                            else
                            {
                                modRL.Amount -= li[i].NowAmount;
                            }
                            bllRL.Update(modRL);
                        }
                        else if (dtRL.Rows.Count > 1)
                        {
                            List <Hownet.Model.RepertoryList> liRL = bllRL.DataTableToList(dtRL);
                            for (int j = 1; j < liRL.Count; j++)
                            {
                                liRL[0].Amount += liRL[j].Amount;
                                bllRL.Delete(liRL[j].ID);
                            }
                            if (IsVerify)
                            {
                                liRL[0].Amount += li[i].NowAmount;
                            }
                            else
                            {
                                liRL[0].Amount -= li[i].NowAmount;
                            }
                            bllRL.Update(liRL[0]);
                        }
                    }
                }
                if (!IsVerify)
                {
                    modPDM.IsVerify   = 1;
                    modPDM.VerifyDate = Convert.ToDateTime("1900-1-1");
                    modPDM.VerifyMan  = 0;
                    bllPDM.Update(modPDM);
                }
            }
            catch (Exception ex)
            {
            }
        }