예제 #1
0
        public void InsertListData(Entity.SaleList sl)
        {
            DataAccess.SaleList daSL = new SaleList();
            string sqlSL             = string.Empty;

            if (daSL.Exists(sl.ListID))
            {
                daSL.Update(sl);
            }
            else
            {
                daSL.Add(sl);
            }
        }
예제 #2
0
        private void CommodityOutList(string jobid, string submitUser, string remark)
        {
            DataTable dtSale = new SaleList().GetList(string.Format("JobID='{0}' and IsDelete=0", jobid)).Tables[0];

            foreach (DataRow drSale in dtSale.Rows)
            {
                Entity.SaleList        mSale      = new SaleList().DataRowToModel(drSale);
                Entity.Stock_Commodity mCommodity = new Stock_Commodity().GetEntity(mSale.ProductType);
                mCommodity.StockActual -= mSale.Num;
                new Stock_Commodity().Update(mCommodity);
                Entity.Stock_OutList mOutList = new Entity.Stock_OutList();
                mOutList.Guid          = Guid.NewGuid().ToString();
                mOutList.CommodityGuid = mSale.ProductType;
                mOutList.JobID         = mSale.JobID;
                mOutList.Before        = mCommodity.StockActual + mSale.Num;
                mOutList.After         = mCommodity.StockActual;
                mOutList.Num           = mSale.Num;
                mOutList.SubmitUser    = submitUser;
                mOutList.SubmitTime    = DateTime.Now;
                mOutList.Remark        = remark;
                new Stock_OutList().Add(mOutList);
            }
        }