Example #1
0
 private void FormReceivingOrder_Load(object sender, EventArgs e)
 {
     if (this._orderDetails.Count(r => r.BusinessScopeCode == Common.GoodsTypeClass.医疗器械.ToString()) == this._orderDetails.Count())
     {
         this.GoogsTypeClass  = Common.GoodsTypeClass.医疗器械;
         this.Column1.Visible = false;
         this.LicensePermissionNumber.HeaderText = "注册证或备案凭证编号";
     }
 }
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (this.dataGridView1.Rows.Count <= 0)
            {
                this.GoodsType = this.checkBox1.Checked ? Common.GoodsTypeClass.医疗器械 : Common.GoodsTypeClass.药品;

                if (this.GoodsType == GoodsTypeClass.医疗器械)
                {
                    this.LicensePermissionNumber.HeaderText = "注册证或备案凭证编号";
                }
                if (this.GoodsType == GoodsTypeClass.药品)
                {
                    this.LicensePermissionNumber.HeaderText = "批准文号";
                }
                return;
            }

            if (this.GoodsType == Common.GoodsTypeClass.药品)
            {
                if (this.checkBox1.Checked)
                {
                    var re = MessageBox.Show("列表已经选择了非医疗器械商品,如果您选择采购医疗器械,则采购列表将被清空,需要确定吗?", "提示", MessageBoxButtons.OKCancel);
                    if (re == System.Windows.Forms.DialogResult.OK)
                    {
                        this.GoodsType = Common.GoodsTypeClass.医疗器械;
                        this.bList.Clear();
                        this.dataGridView1.DataSource           = null;
                        this.LicensePermissionNumber.HeaderText = "注册证或备案凭证编号";
                    }
                    else
                    {
                        this.checkBox1.Checked = !this.checkBox1.Checked;
                    }
                }
            }
            if (this.GoodsType == Common.GoodsTypeClass.医疗器械)
            {
                if (!this.checkBox1.Checked)
                {
                    var re = MessageBox.Show("列表已经选择了医疗器械商品,如果您选择采购其他商品,则采购列表将被清空,需要确定吗?", "提示", MessageBoxButtons.OKCancel);
                    if (re == System.Windows.Forms.DialogResult.OK)
                    {
                        this.GoodsType = Common.GoodsTypeClass.药品;
                        this.bList.Clear();
                        this.dataGridView1.DataSource           = null;
                        this.LicensePermissionNumber.HeaderText = "批准文号";
                    }
                    else
                    {
                        this.checkBox1.Checked = !this.checkBox1.Checked;
                    }
                }
            }
        }
Example #3
0
        public void Initial(bool isCreate)
        {
            string msg = String.Empty;

            if (isCreate)
            {
                lblOrderNo.Text    = "新建";
                lblCreateDate.Text = DateTime.Now.ToString("yyyy年MM月dd日 HH时mm分");

                string employeeName = AppClientContext.CurrentUser.Employee.Name;
                txt复核员名.Text = employeeName;
            }
            else
            {
                lblCreateDate.Text  = _order.OperateTime.ToString("yyyy年MM月dd日 HH时mm分");
                txt复核员名.Text        = _order.EmployeeName;
                lblOrderNo.Text     = _order.DocumentNumber;
                lblOrderStatus.Text = EnumHelper <OrderStatus> .GetDisplayValue((OrderStatus)_order.OrderStatus);

                tsbtnInInventory.Visible    = false;
                this.dataGridView1.ReadOnly = true;
            }

            if (this._orderDetails.Count(r => r.BussinessScopeCode.Contains("医疗器械")) == this._orderDetails.Count)
            {
                this.GoogsTypeClass = GoodsTypeClass.医疗器械;
                this.LicensePermissionNumber.HeaderText = "注册证或备案凭证编号";
                this.Decription.Visible = false;
            }

            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView1.DataSource          = _orderDetails;//绑定列表

            foreach (DataGridViewRow r in dataGridView1.Rows)
            {
                string bs = PharmacyDatabaseService.GetDrugInfo(out msg, _orderDetails[r.Index].DrugInfoId).BusinessScopeCode;
                if (bs.Contains("中药材") || bs.Contains("中药饮片"))
                {
                    if (bs.Contains("中药材"))
                    {
                        this.dataGridView1.Columns[this.FactoryName.Name].Visible = false;
                    }
                    // this.tsbtnPrint.Visible = false;
                    break;
                }
                else
                {
                    this.dataGridView1.Columns[this.Decription.Name].Visible = false;
                    break;
                }
            }
        }
Example #4
0
        /// <summary>
        ///  传入药品类型的构造函数
        /// </summary>
        /// <param name="outInventoryStatus"></param>
        public FormSalesOrderRecordIndex(object goodsType)
        {
            try
            {
                InitializeComponent();
                if (goodsType.ToString() == "ylqx")
                {
                    this.GoodsType = GoodsTypeClass.医疗器械;
                }

                this.dgvMain.RowPostPaint += delegate(object o, DataGridViewRowPostPaintEventArgs ex) { DataGridViewOperator.SetRowNumber((DataGridView)o, ex); };
                DefineGridColumn();

                this.lblDrugTyp.Visible    = false;
                this.cmbGoodsType.Visible  = false;
                this.label3.Visible        = false;
                this.comboBoxSpeci.Visible = false;
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
Example #5
0
        /// <summary>
        /// 初始化画面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormSalesOrderEdit_Load(object sender, EventArgs e)
        {
            switch (_orderStatus)
            {
            case OrderStatus.Waitting:       //等待审批状态
                receivingButton.Visible = false;
                panel3.Visible          = true;
                break;

            case OrderStatus.PurchaseReceinvingAmountDiff:    //收货数量不符
                receivingButton.Visible = false;
                btnAdd.Visible          = false;
                btnCancel.Visible       = false;
                btnSubmit.Visible       = false;
                panel3.Visible          = false;
                this.label1.Text       += "(采购数量不足)";
                //审批
                tsbtnAccept.Visible = false;
                break;

            case OrderStatus.PurchaseApplyReceinvingAmountDiff:    //采购数量修改申请
                receivingButton.Visible = false;
                btnAdd.Visible          = false;
                btnCancel.Visible       = false;
                btnSubmit.Visible       = false;
                panel3.Visible          = false;
                this.label1.Text       += "(数量不足修改申请)";
                break;

            case OrderStatus.Rejected:
                btnCancel.Visible   = false;
                tsbtnAccept.Visible = false;
                btnAdd.Visible      = false;
                btnSubmit.Visible   = false;
                this.label1.Text   += "(采购定单拒绝)";
                break;

            case OrderStatus.Approved:
                tlbtn结算.Visible     = false;
                btnCancel.Visible   = false;
                tsbtnAccept.Visible = false;
                btnAdd.Visible      = false;
                btnSubmit.Visible   = false;
                this.label1.Text   += "(审核通过)";
                break;

            case OrderStatus.purchaseMReceiving:
                tlbtn结算.Visible     = false;
                btnCancel.Visible   = false;
                tsbtnAccept.Visible = false;
                btnAdd.Visible      = false;
                btnSubmit.Visible   = false;
                this.label1.Text   += "(采购记录多次收货)";
                break;

            case OrderStatus.Canceled:
                receivingButton.Visible = false;
                btnAdd.Visible          = false;
                btnSubmit.Visible       = false;
                btnCancel.Visible       = false;
                tlbtn结算.Visible         = false;
                btnCancel.Visible       = false;
                tsbtnAccept.Visible     = false;
                panel3.Visible          = true;
                this.label1.Text       += "(定单取消)";
                break;

            case OrderStatus.PurchaseCheck:
                tlbtn结算.Visible     = false;
                btnCancel.Visible   = false;
                tsbtnAccept.Visible = false;
                btnAdd.Visible      = false;
                btnSubmit.Visible   = false;
                break;

            case OrderStatus.PurchaseInInventory:    //入库
                receivingButton.Visible = false;
                tlbtn结算.Visible         = false;
                btnCancel.Visible       = false;
                tsbtnAccept.Visible     = false;
                btnAdd.Visible          = false;
                btnSubmit.Visible       = false;
                this.label1.Text       += "(定单入库)";
                break;

            case OrderStatus.PurchaseApprovedReceinvingAmountDiff:
                tlbtn结算.Visible     = false;
                btnCancel.Visible   = false;
                tsbtnAccept.Visible = false;
                btnAdd.Visible      = false;
                btnSubmit.Visible   = false;
                this.label1.Text   += "(数量不足审核通过)";
                break;

            default:
                receivingButton.Visible = false;
                tlbtn结算.Visible         = false;
                btnCancel.Visible       = false;
                tsbtnAccept.Visible     = false;
                btnAdd.Visible          = false;
                btnSubmit.Visible       = false;
                this.label1.Text       += "(定单已结算)";
                break;
            }
            string msg = string.Empty;

            _purchaseOrder           = _order;
            label5.Text              = _purchaseOrder.SupplyUnitName;
            nudTotalMoney.Value      = _purchaseOrder.TotalMoney;
            txtEmployeeName.Text     = _purchaseOrder.EmployeeName;
            lblOrderNo.Text          = _purchaseOrder.DocumentNumber;
            dtpAllReceiptedDate.Text = _purchaseOrder.AllReceiptedDate == null ? "" : _purchaseOrder.AllReceiptedDate.ToString();
            lblCreateDate.Text       = _purchaseOrder.CreateTime.ToShortDateString();
            lblOrderStatus.Text      = EnumHelper <OrderStatus> .GetDisplayValue((OrderStatus)_purchaseOrder.OrderStatusValue);

            label10.Text             = _purchaseOrder.EmployeeName;
            label11.Text             = _purchaseOrder.ReceiveUnit;
            label16.Text             = _purchaseOrder.Address;
            txtDescription.Text      = _purchaseOrder.Description;
            _listPurchaseOrderDetail = PharmacyDatabaseService.GetPurchaseOrderDetails(out msg, _purchaseOrder.Id).ToList();
            this.dataGridView1.AutoGenerateColumns = false;

            if (this._listPurchaseOrderDetail.Count(r => r.SupplyBusinessScope.Contains("医疗器械")) == this._listPurchaseOrderDetail.Count)
            {
                this.GoogsTypeClass = GoodsTypeClass.医疗器械;
                this.LicensePermissionNumber.HeaderText = "注册证或备案凭证编号";
            }

            this.dataGridView1.DataSource = _listPurchaseOrderDetail.ToList();
            if (_orderStatus == OrderStatus.PurchaseReceinvingAmountDiff)
            {
            }
            else
            {
                this.dataGridView1.ReadOnly = true;
            }
            if (_onlySearch)
            {
                btnAddDetail.Visible        = false;
                btnDeleteDetail.Visible     = false;
                receivingButton.Visible     = false;
                tlbtn结算.Visible             = false;
                btnCancel.Visible           = false;
                tsbtnAccept.Visible         = false;
                btnAdd.Visible              = false;
                btnSubmit.Visible           = false;
                this.dataGridView1.ReadOnly = true;
                dtpAllReceiptedDate.Enabled = false;
                txtDescription.Enabled      = false;
            }
            if (btnAdd.Visible == true)
            {
                this.btnAdd.Visible    = this.Authorize(ModuleKeys.EditPurchaseOrder);
                this.btnSubmit.Visible = this.Authorize(ModuleKeys.EditPurchaseOrder);
                this.btnCancel.Visible = this.Authorize(ModuleKeys.EditPurchaseOrder);
            }
            if (tsbtnAccept.Visible == true)
            {
                tsbtnAccept.Visible = this.Authorize(ModuleKeys.ApprovalPurchaseOrder);
            }
            if (btnModifyPurchaseAmount.Visible == true)
            {
                btnModifyPurchaseAmount.Visible = this.Authorize(ModuleKeys.ApprovalPurchaseOrder);
            }
            if (receivingButton.Visible == true)
            {
                receivingButton.Visible = this.Authorize(ModuleKeys.PurchaseReceiving);
            }
        }