Beispiel #1
0
        /// <summary>
        /// 增加一条数据,数据源为DataTable
        /// </summary>
        public int AddByDt(DataTable dt)
        {
            List <Hownet.Model.CompanyLog> li = DataTableToList(dt);

            if (li.Count > 0)
            {
                Hownet.BLL.Bas_KJKM          bllKJ = new Bas_KJKM();
                List <Hownet.Model.Bas_KJKM> liKJ  = bllKJ.DataTableToList(bllKJ.GetList("(CompanyID=" + li[0].CompanyID + ")").Tables[0]);
                if (liKJ.Count > 0)
                {
                    if (li[0].TypeID == (int)Enums.MoneyTableType.BackMoney)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.OutMoney)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.Back)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.Sell)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.SellBack)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.StockBackSupp)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                }
                return(dal.Add(li[0]));
            }
            else
            {
                return(0);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void DeleteLog(int CompanyID, int TypeID, int TableID)
        {
            List <Hownet.Model.CompanyLog> li = DataTableToList(GetList(" (CompanyID=" + CompanyID + ") And (TypeID=" + TypeID + ") And (TableID=" + TableID + ") ").Tables[0]);

            dal.DeleteLog(CompanyID, TypeID, TableID);
            try
            {
                Hownet.BLL.Bas_KJKM          bllKJ = new Bas_KJKM();
                List <Hownet.Model.Bas_KJKM> liKJ  = bllKJ.DataTableToList(bllKJ.GetList("(CompanyID=" + li[0].CompanyID + ")").Tables[0]);
                if (liKJ.Count > 0)
                {
                    if (li[0].TypeID == (int)Enums.MoneyTableType.BackMoney)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.OutMoney)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.Back)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.Sell)
                    {
                        liKJ[0].Money -= li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.SellBack)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(1122);
                    }
                    else if (li[0].TypeID == (int)Enums.MoneyTableType.StockBackSupp)
                    {
                        liKJ[0].Money += li[0].ChangMoney;
                        bllKJ.Update(liKJ[0]);
                        bllKJ.UpMoney(2202);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #3
0
        public void InKJKM()
        {
            List <Hownet.Model.Company> li = DataTableToList(GetAllList().Tables[0]);

            Hownet.BLL.Bas_KJKM   bllKJ = new Bas_KJKM();
            Hownet.BLL.CompanyLog bllCL = new CompanyLog();
            Hownet.Model.Bas_KJKM modKJ;

            for (int i = 0; i < li.Count; i++)
            {
                if (bllKJ.GetList("(CompanyID=" + li[i].ID + ")").Tables[0].Rows.Count == 0)
                {
                    modKJ           = new Hownet.Model.Bas_KJKM();
                    modKJ.A         = 0;
                    modKJ.CompanyID = li[i].ID;
                    modKJ.ID        = 0;
                    modKJ.Money     = bllCL.GetLastMoney(li[i].ID);
                    modKJ.Name      = li[i].Name;
                    modKJ.Num       = string.Empty;
                    if (li[i].TypeID == 1)//客户
                    {
                        modKJ.Num      = bllKJ.GetMaxNum(1122).ToString();
                        modKJ.ParentID = 1122;
                    }
                    else if (li[i].TypeID == 2 || li[i].TypeID == 3)
                    {
                        modKJ.Num      = bllKJ.GetMaxNum(2202).ToString();
                        modKJ.ParentID = 2202;
                    }
                    if (modKJ.Num != string.Empty)
                    {
                        modKJ.Orders = bllKJ.GetMaxOrders() + 1;
                        modKJ.Remark = string.Empty;
                        bllKJ.Add(modKJ);
                    }
                }
            }
        }