Beispiel #1
0
 public virtual void ReturnData(IList list)
 {
     if (list != null && list.Count > 0)
     {
         DialogUtil.SetCachedObj(this, list.Cast <Goods>().Select(x => x.ID).ToList());
     }
 }
Beispiel #2
0
        protected virtual void ReturnList(IList <long> result)
        {
            var detailList = new List <long>();

            foreach (var saleGoods_ID in result)
            {
                detailList.Add(saleGoods_ID);
            }
            DialogUtil.SetCachedObj(this, detailList);
        }
Beispiel #3
0
        void GridMultiSelection(object sender, EventArgs e)
        {
            var billType = DmoTypeIDAttribute.GetID(typeof(ProductInStore_Temp));
            IList <ProductInStore_Temp> selectList = new List <ProductInStore_Temp>();

            _grid.GetFromUI();
            foreach (var row in _grid.GetSelectedItems())
            {
                var detail = new ProductInStore_Temp();
                detail.AccountingUnit_ID   = (long?)row["AccountingUnit_ID"];
                detail.AccountingUnit_Name = (string)row["AccountingUnit_Name"];
                detail.Department_ID       = (long?)row["Department_ID"];
                detail.Department_Name     = (string)row["Department_Name"];
                detail.Employee_ID         = (long?)row["Employee_ID"];
                detail.Employee_Name       = (string)row["Employee_Name"];
                detail.InStoreType_ID      = (long?)row["InStoreType_ID"];
                detail.InStoreType_Name    = (string)row["InStoreType_Name"];
                detail.Store_ID            = (long?)row["Store_ID"];
                detail.Store_Name          = (string)row["Store_Name"];
                detail.CheckEmployee_ID    = (long?)row["CheckEmployee_ID"];
                detail.CheckEmployee_Name  = (string)row["CheckEmployee_Name"];
                detail.CheckDate           = (DateTime?)row["CheckDate"];
                detail.InStoreDate         = (DateTime?)row["InStoreDate"];

                var temp = GetDetails((long)row["ID"]);
                foreach (var de in temp)
                {
                    var tempdetail = new ProductInStore_Temp_Detail();
                    tempdetail.Goods_ID       = de.Goods_ID;
                    tempdetail.Goods_Code     = de.Goods_Code;
                    tempdetail.Goods_Name     = de.Goods_Name;
                    tempdetail.Goods_Spec     = de.Goods_Spec;
                    tempdetail.BrandItem_ID   = de.BrandItem_ID;
                    tempdetail.BrandItem_Name = de.BrandItem_Name;
                    detail.Details.Add(tempdetail);
                }
                //detail.Goods_ID = (long)row["Goods_ID"];
                //detail.Goods_Name = (string)row["Goods_Name"];
                //detail.Goods_Code = (string)row["Goods_Code"];
                //detail.Goods_Spec = (string)row["Goods_Spec"];
                selectList.Add(detail);
            }
            DialogUtil.SetCachedObj(this, selectList);
        }
Beispiel #4
0
        private void UpdateOrInsert()
        {
            if (String.IsNullOrEmpty(_accountingUnit.Value))
            {
                throw new ApplicationException("请选择会计单位!");
            }
            if (String.IsNullOrEmpty(_store.Value))
            {
                throw new ApplicationException("请选择仓库!");
            }
            if (_mGrid.CurrentData == null)
            {
                throw new ApplicationException("请选择存货!");
            }

            foreach (DFDataRow row in _mGrid.GetSelectedItems())
            {
                var accountingUnitID = Convert.ToInt64(_accountingUnit.Value);
                var goodsID          = (long?)row["ID"];
                if (ISExitSameRecord(accountingUnitID, goodsID))
                {
                    throw new ApplicationException("同一个存货,同一个会计单位,不能有多个仓库!");
                }
            }

            foreach (DFDataRow row in _mGrid.GetSelectedItems())
            {
                var goodsStore = new Goods_Accounting_Store
                {
                    AccountingUnit_ID = Convert.ToInt64(_accountingUnit.Value),
                    Store_ID          = Convert.ToInt64(_store.Value),
                    Goods_ID          = (long)row["ID"]
                };
                using (var context = new TransactionContext())
                {
                    context.Session.Insert(goodsStore);
                    context.Commit();
                }
            }
            DialogUtil.SetCachedObj(this, 1);
        }