示例#1
0
        void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            PurchaseReceivingOrderDetailEntity prode = this.dataGridView1.Rows[e.RowIndex].DataBoundItem as PurchaseReceivingOrderDetailEntity;

            this.Bcms.DrugId = prode.DrugInfoId;   //右键查品种信息
        }
示例#2
0
        public FormReceivingOrder(PurchaseCommonEntity order, List <PurchaseOrderReturnDetailEntity> orderDetails)
            : this()
        {
            _order.Description                = "";
            _order.PurchaseOrderId            = order.PurchaseOrderId;
            _order.OperateUserId              = AppClientContext.CurrentUser.Id;
            _order.RelatedOrderDocumentNumber = order.DocumentNumber;
            _order.RelatedOrderId             = order.Id;
            _order.RelatedOrderTypeValue      = (int)OrderType.PurchaseOrderReturn;
            _order.SupplyUnitId               = order.SupplyUnitId;
            _order.SupplyUnitName             = order.SupplyUnitName;
            foreach (PurchaseOrderReturnDetailEntity d in orderDetails)
            {
                if (d.IsReissue)
                {
                    PurchaseReceivingOrderDetailEntity c = new PurchaseReceivingOrderDetailEntity();
                    c.Amount                        = d.ReissueAmount;
                    c.ActualAmount                  = 0;
                    c.Decription                    = "";
                    c.CheckResult                   = 0;
                    c.ReceiveAmount                 = 0;
                    c.RejectAmount                  = 0;
                    c.ProductGeneralName            = d.ProductGeneralName;
                    c.DictionarySpecificationCode   = d.DictionarySpecificationCode;
                    c.DictionaryMeasurementUnitCode = d.DictionaryMeasurementUnitCode;
                    c.DictionaryDosageCode          = d.DictionaryDosageCode;
                    c.LicensePermissionNumber       = d.LicensePermissionNumber;
                    c.DrugInfoId                    = d.DrugInfoId;
                    c.FactoryName                   = d.FactoryName;
                    c.PurchasePrice                 = d.PurchasePrice;
                    c.Origin                        = d.Origin;
                    _orderDetails.Add(c);
                }
            }
            Initial(true);
            tsbtnChecking.Visible = false;

            label5.Text = order.SupplyUnitName;
            if (tsbtnReceiving.Visible == true)
            {
                tsbtnReceiving.Visible = this.Authorize(ModuleKeys.PurchaseReceiving);
            }
            if (btnModifyPurchaseAmount.Visible == true)
            {
                btnModifyPurchaseAmount.Visible = this.Authorize(ModuleKeys.PurchaseReceiving);
            }
            if (tsbtnChecking.Visible == true)
            {
                tsbtnChecking.Visible = this.Authorize(ModuleKeys.PurchaseChecking);
            }
        }
示例#3
0
        //创建收货单 开始收货
        public FormReceivingOrder(PurchaseOrdeEntity order, List <PurchaseOrderDetailEntity> orderDetails)
            : this()
        {
            _order.Description                = "";
            _order.PurchaseOrderId            = order.Id;
            _order.OperateUserId              = AppClientContext.CurrentUser.Id;
            _order.RelatedOrderDocumentNumber = order.DocumentNumber;
            _order.RelatedOrderId             = order.Id;
            _order.RelatedOrderTypeValue      = (int)OrderType.PurchaseOrder;
            _order.SupplyUnitId               = order.SupplyUnitId;
            _order.SupplyUnitName             = order.SupplyUnitName;
            _order.OrderStatus                = order.OrderStatusValue;

            if (order.OrderStatusValue == (int)OrderStatus.purchaseMReceiving)
            {
                PurchaseCommonEntity[] orderEntity = this.PharmacyDatabaseService.GetPurchaseReceivingOrdersByPurchaseOrderId(out msg, order.Id);
                if (orderEntity.Count() > 0)
                {
                    this.Column2.Visible       = true;
                    ShippingTime.Text          = orderEntity[0].ShippingTime.ToString("yyyy年MM月dd日 HH时mm分");
                    textBoxShippingAdress.Text = orderEntity[0].ShippingAdress;
                    textBoxShippingUnit.Text   = orderEntity[0].ShippingUnit;
                    textBoxTransportUnit.Text  = orderEntity[0].TransportUnit;
                    textBoxDescription.Text    = orderEntity[0].Description;

                    #region 如果是多次收货状态,则读入已收货单
                    if (order.OrderStatusValue == (int)OrderStatus.purchaseMReceiving)
                    {
                        this.clmDrugNumber.HeaderText = "前次已到货数量";
                        this.clmDrugNumber.ReadOnly   = true;
                        this.ReceiveAmount.HeaderText = "前次已收货数量";
                        this.ReceiveAmount.ReadOnly   = true;
                        var c = this.PharmacyDatabaseService.GetPurchaseReceivingOrderDetails(out msg, orderEntity[0].Id);
                        this._orderDetails = (from i in c group i by i.DrugInfoId into g
                                              select new PurchaseReceivingOrderDetailEntity
                        {
                            ActualAmount = g.Sum(r => r.ActualAmount),
                            Amount = g.FirstOrDefault().Amount,
                            ProductGeneralName = g.FirstOrDefault().ProductGeneralName,
                            ReceiveAmount = g.Sum(r => r.ReceiveAmount),
                            RejectAmount = g.Sum(r => r.RejectAmount),
                            BusinessScopeCode = g.FirstOrDefault().BusinessScopeCode,
                            CheckResult = g.FirstOrDefault().CheckResult,
                            CheckResultString = g.FirstOrDefault().CheckResultString,
                            Decription = g.FirstOrDefault().Decription,
                            DictionaryDosageCode = g.FirstOrDefault().DictionaryDosageCode,
                            DictionaryMeasurementUnitCode = g.FirstOrDefault().DictionaryMeasurementUnitCode,
                            DictionarySpecificationCode = g.FirstOrDefault().DictionarySpecificationCode,
                            DrugInfoId = g.FirstOrDefault().DrugInfoId,
                            FactoryName = g.FirstOrDefault().FactoryName,
                            Id = g.FirstOrDefault().Id,
                            IsCompanyPurchase = g.FirstOrDefault().IsCompanyPurchase,
                            IsTransportMethod = g.FirstOrDefault().IsTransportMethod,
                            IsTransportTemperature = g.FirstOrDefault().IsTransportTemperature,
                            LicensePermissionNumber = g.FirstOrDefault().LicensePermissionNumber,
                            Origin = g.FirstOrDefault().Origin,
                            PurchasePrice = g.FirstOrDefault().PurchasePrice,
                            PurchaseReceivingOrderId = g.FirstOrDefault().PurchaseReceivingOrderId,
                            RejectReason = g.FirstOrDefault().RejectReason,
                            RejectTrace = g.FirstOrDefault().RejectTrace,
                            sequence = g.FirstOrDefault().sequence,
                            TemperatureStatus = g.FirstOrDefault().TemperatureStatus,
                            TransportMethod = g.FirstOrDefault().TransportMethod,
                            TransportTemperature = g.FirstOrDefault().TransportTemperature,
                            MReceiveNumber = g.FirstOrDefault().MReceiveNumber,
                        }).ToList();
                    }

                    #endregion
                }
            }
            else
            {
                foreach (PurchaseOrderDetailEntity d in orderDetails)
                {
                    PurchaseReceivingOrderDetailEntity c = new PurchaseReceivingOrderDetailEntity();
                    c.Amount                        = d.Amount;
                    c.ActualAmount                  = d.Amount;
                    c.Decription                    = "";
                    c.CheckResult                   = 0;
                    c.ReceiveAmount                 = d.Amount;
                    c.RejectAmount                  = 0;
                    c.ProductGeneralName            = d.ProductGeneralName;
                    c.DictionarySpecificationCode   = d.DictionarySpecificationCode;
                    c.DictionaryMeasurementUnitCode = d.DictionaryMeasurementUnitCode;
                    c.DictionaryDosageCode          = d.DictionaryDosageCode;
                    c.LicensePermissionNumber       = d.LicensePermissionNumber;
                    c.DrugInfoId                    = d.DrugInfoId;
                    c.FactoryName                   = d.FactoryName;
                    c.PurchasePrice                 = d.PurchasePrice;
                    c.IsCompanyPurchase             = true;
                    c.IsTransportMethod             = true;
                    c.IsTransportTemperature        = true;
                    c.Origin                        = d.Origin;
                    c.sequence                      = d.sequence;
                    c.BusinessScopeCode             = d.SupplyBusinessScope;
                    _orderDetails.Add(c);
                }
            }
            Initial(true);
            tsbtnChecking.Visible = false;
            label5.Text           = order.SupplyUnitName;
            if (tsbtnReceiving.Visible == true)
            {
                tsbtnReceiving.Visible = this.Authorize(ModuleKeys.PurchaseReceiving);
            }
            if (btnModifyPurchaseAmount.Visible == true)
            {
                btnModifyPurchaseAmount.Visible = this.Authorize(ModuleKeys.PurchaseReceiving);
            }
            if (tsbtnChecking.Visible == true)
            {
                tsbtnChecking.Visible = this.Authorize(ModuleKeys.PurchaseChecking);
            }
        }