private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } if (bList.Count <= 0) { return; } int rdx = e.RowIndex; t1.Text = bList[rdx].drugName; t2.Text = bList[rdx].BatchNumber; t3.Text = bList[rdx].DrugInfo.FactoryName; t4.Text = bList[rdx].DocumentNumber; t5.Text = bList[rdx].RefuseQuantity.ToString(); t6.Text = bList[rdx].PurchaseUnitName; t7.Text = bList[rdx].PurchasePrice.ToString(); t8.Text = bList[rdx].quantity.ToString(); t9.Text = bList[rdx].Creator.ToString(); t10.Text = bList[rdx].OutValidDate.ToString(); richTextBox1.Text = bList[rdx].rsn; richTextBox2.Text = bList[rdx].conclusion; c1.Text = bList[rdx].Creator; c2.Text = bList[rdx].createTime.ToLongDateString(); c3.Text = bList[rdx].createTime == bList[rdx].conclusionSignDate?"":bList[rdx].updateTime.ToLongDateString(); c4.Text = bList[rdx].conclusionSigner; currentRefuse = bList[rdx]; }
private void toolStripButton2_Click(object sender, EventArgs e) { if (MessageBox.Show("确定要提交拒收报告审核吗?", "提示", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } if (currentRefuse == null) { MessageBox.Show("请双击列表中的记录,然后填写相关信息后,再点击提交!"); return; } Models.DocumentRefuse dr = currentRefuse; if (t2.Text.Trim() == string.Empty) { MessageBox.Show(" 请填写拒收药品的批次号,否则无法提交!"); return; } dr.BatchNumber = t2.Text.Trim(); dr.updateTime = DateTime.Now; dr.conclusion = this.richTextBox2.Text.Trim(); dr.conclusionSigner = PharmacyDatabaseService.GetEmployeeByUserId(out msg, AppClientContext.CurrentUser.Id).Name; dr.conclusionSignDate = DateTime.Now; dr.proc = 1; System.IFormatProvider format = new System.Globalization.CultureInfo("zh-CN", true); try { dr.OutValidDate = DateTime.ParseExact(t10.Text, "yyyyMMdd", format); } catch (Exception ex) { MessageBox.Show("您填写的过期日格式不正确,或者没有填写,请填写正确!"); } if (PharmacyDatabaseService.RefuseNextProc(dr, AppClientContext.CurrentUser.Id, out msg)) { MessageBox.Show("拒收单审核成功!"); getData(this.toolStripComboBox1.SelectedText, 0, string.Empty); foreach (Control c in this.Controls) { if (c.Name.Contains("t") || c.Name.Contains("c")) { c.Text = string.Empty; } } } else { MessageBox.Show("提交失败\n" + msg); } }