예제 #1
0
        /// <summary>
        /// 初始化要条件的药品信息
        /// </summary>
        /// <param name="rowIndex">行索引号</param>
        private void ChangePriceInfo(int rowIndex)
        {
            DataGridViewRow row = dataGridView1.Rows[rowIndex];

            DrugShop.Entities.Store store = row.DataBoundItem as DrugShop.Entities.Store;

            if (store == null)
            {
                return;
            }

            if (updateStoreList.Contains(store))
            {
                return;
            }

            SalePriceInput input = new SalePriceInput();

            input.OldPrice = store.SalePrice;

            if (input.ShowDialog(this.ParentForm) != DialogResult.OK)
            {
                return;
            }

            DrugShop.Entities.Store  dataStore  = new Entities.Store();
            DrugShop.Entities.CPrice dataObject = new DrugShop.Entities.CPrice();

            ColumnCollection cols = store.GetColumns();

            foreach (Property prop in cols)
            {
                if (dataObject.ContainsProperty(prop.Name))
                {
                    dataObject[prop.Name] = store[prop];
                }

                if (dataStore.ContainsProperty(prop.Name))
                {
                    dataStore[prop.Name] = store[prop];
                }
            }

            //dataObject.Billcode = this.tbBillCode.Tag.ToString();
            dataObject.NSalePrice = input.Number;
            dataObject.Cause      = this.tbCause.Text;
            //dataObject.Operator = 0;

            //添加到调价集合中
            drugChangePriceList.Add(dataObject);

            dataStore.SalePrice = input.Number;
            dataStore.JobPrice  = input.Number;

            //添加到要更新的库存记录中
            updateStoreList.Add(dataStore);
        }
예제 #2
0
        protected void InitCustomBackInfo(int rowIndex)
        {
            DataGridViewRow row = dataGridView1.Rows[rowIndex];

            DrugShop.Entities.Store DrugShop = row.DataBoundItem as DrugShop.Entities.Store;

            if (DrugShop == null)
            {
                return;
            }

            NumberInput input = new NumberInput();

            input.StoreNumber = DrugShop.Number;

            if (input.ShowDialog(this.ParentForm) != DialogResult.OK)
            {
                return;
            }

            DrugShop.Entities.Store store = new Entities.Store();

            DrugShop.Entities.Lost drugLost = new DrugShop.Entities.Lost();

            ColumnCollection cols = DrugShop.GetColumns();

            foreach (Property prop in cols)
            {
                if (drugLost.ContainsProperty(prop.Name))
                {
                    drugLost[prop.Name] = DrugShop[prop.Name];
                }

                if (store.ContainsProperty(prop.Name))
                {
                    store[prop.Name] = DrugShop[prop.Name];
                }
            }

            //保存供应商退药记录
            drugLost.ID     = ServiceContainer.GetService <IDrugLostService>().GetMaxID();
            drugLost.Number = input.Number;
            this.lostList.Add(drugLost);

            //更新库存数量
            store.Number -= drugLost.Number;
            this.updateStoreList.Add(store);

            this.dmrlostBindingSource.DataSource = null;
            this.dmrlostBindingSource.DataSource = lostList;

            CaclSumCash();
        }
예제 #3
0
        protected void InitProviderBackInfo(int rowIndex)
        {
            DataGridViewRow row = dataGridView1.Rows[rowIndex];

            DrugShop.Entities.Store DrugShop = row.DataBoundItem as DrugShop.Entities.Store;

            if (DrugShop == null)
            {
                return;
            }

            NumberInput input = new NumberInput();

            input.StoreNumber = DrugShop.Number;

            if (input.ShowDialog(this.ParentForm) != DialogResult.OK)
            {
                return;
            }

            DrugShop.Entities.Store store = new Entities.Store();

            DrugShop.Entities.PBack drugBack = new DrugShop.Entities.PBack();

            ColumnCollection cols = DrugShop.GetColumns();

            foreach (Property prop in cols)
            {
                if (drugBack.ContainsProperty(prop.Name))
                {
                    drugBack[prop.Name] = DrugShop[prop.Name];
                }

                if (store.ContainsProperty(prop.Name))
                {
                    store[prop.Name] = DrugShop[prop.Name];
                }
            }

            //保存供应商退药记录
            drugBack.Id     = ServiceContainer.GetService <IDrugBackService>().GetPBackMaxID();
            drugBack.Number = input.Number;
            this.backList.Add(drugBack);

            //更新库存数量
            store.Number -= drugBack.Number;
            this.updateStoreList.Add(store);
        }