Exemple #1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            this.DialogResult = DialogResult.OK;
            int idx = e.RowIndex;

            iml = im[idx];
        }
 //窗体清除
 private void ClearCurrent()
 {
     this.currentDU                 = null;
     this.CurrentIM                 = null;
     this.checkBox1.Checked         = false;
     toolStripButton10.Enabled      = tsbtnSave.Enabled = true;
     this.textBox1.Enabled          = true;
     this.toolStripButton8.Enabled  = this.toolStripButton2.Enabled = false;
     this.toolStripButton11.Enabled = true;
     foreach (Control control in this.groupBox2.Controls)
     {
         if (control.GetType() == typeof(TextBox))
         {
             ((TextBox)control).Text = string.Empty;
         }
     }
     this.txtRemark.Text = "质量问题,需复查或者提交不合格审查";
     this.toolStripComboBox1.SelectedIndex = 0;
 }
        private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            drugsUnqualificationCondition duc = new drugsUnqualificationCondition();

            duc.dtFrom = DateTime.MinValue;
            duc.dtTo   = DateTime.MaxValue;
            duc.unqualificationType = -1;
            var c = this.PharmacyDatabaseService.GetDrugsUnqualificationByCondition(out msg, duc);

            bList.Clear();
            switch (toolStripComboBox1.SelectedIndex)
            {
            case 0:
                c = c.Where(r => r.ApprovalStatusValue == -1 || r.ApprovalStatusValue == 4).ToArray();
                bList.Clear();
                foreach (var a in c)
                {
                    bList.Add(a);
                }
                break;

            case 1:
                c = c.Where(r => r.ApprovalStatusValue == -1).ToArray();
                foreach (var a in c)
                {
                    bList.Add(a);
                }
                break;

            case 2:
                c = c.Where(r => r.ApprovalStatusValue == 4).ToArray();
                foreach (var a in c)
                {
                    bList.Add(a);
                }
                break;
            }
            currentDU = null;
            CurrentIM = null;
        }
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            string py = textBox1.Text.Trim();

            if (py == string.Empty)
            {
                return;
            }
            if (e.KeyData == Keys.Return)
            {
                using (Form1 f1 = new Form1())
                {
                    f1.py = py;
                    f1.ShowDialog();
                    if (f1.DialogResult == DialogResult.OK)
                    {
                        var im = f1.iml;
                        this.CurrentIM         = f1.iml;
                        this.checkBox1.Checked = false;

                        this.textBox5.Text  = im.ProductGeneralName;
                        this.textBox3.Text  = im.CanSaleNum.ToString();
                        this.textBox4.Text  = im.FactoryName;
                        this.textBox6.Text  = im.DictionarySpecificationCode;
                        this.textBox7.Text  = im.BatchNumber;
                        this.textBox8.Text  = im.Origin;
                        this.textBox9.Text  = im.DictionaryDosageCode;
                        this.textBox10.Text = im.PurchasePrice.ToString();

                        if (im.IsOutDate.Contains("已过期"))
                        {
                            this.txtRemark.Text = "本品种:" + im.ProductGeneralName + ",已过期,需不合格审批后执行报损流程!";
                        }
                        else
                        {
                            this.txtRemark.Text = "本品种:" + im.ProductGeneralName + ",未过期,但存在质量问题,需不合格审批后执行报损流程!";
                        }

                        currentDU = new drugsUnqualication();
                        currentDU.ApprovalStatus        = ApprovalStatus.NonApproval;
                        currentDU.ApprovalStatusValue   = -1;
                        currentDU.batchNo               = im.BatchNumber;
                        currentDU.createTime            = DateTime.Now;
                        currentDU.createUID             = AppClientContext.CurrentUser.Id;
                        currentDU.Deleted               = false;
                        currentDU.Description           = string.Empty;
                        currentDU.DosageType            = im.DictionaryDosageCode;
                        currentDU.DrugInventoryRecordID = im.InventoryID;
                        currentDU.drugName              = im.ProductGeneralName;
                        currentDU.ExpireDate            = im.OutValidDate;
                        currentDU.flowID                      = Guid.NewGuid();
                        currentDU.Id                          = Guid.NewGuid();
                        currentDU.produceDate                 = im.PruductDate;
                        currentDU.source                      = "新建不合格";
                        currentDU.Specific                    = im.DictionarySpecificationCode;
                        currentDU.unqualificationType         = 0;
                        currentDU.updateTime                  = DateTime.Now;
                        currentDU.factoryName                 = im.FactoryName;
                        currentDU.DrugInfo                    = im.DrugInfoId;
                        currentDU.PurchasePrice               = im.PurchasePrice;
                        currentDU.Origin                      = im.Origin;
                        currentDU.Supplyer                    = im.SupplyUnitName;
                        currentDU.PurchaseOrderDocumentNumber = im.PurchaseOrderDocumentNumber;
                        currentDU.PurchaseOrderId             = im.PurchaseOrderId;
                        this.textBox2.Focus();
                    }
                }
            }
        }