private void btnApprovalDetails_Click(object sender, EventArgs e) { FormApprovalFlowCenter form = new FormApprovalFlowCenter(drug, drug.FlowID, false); form.ShowDialog(); }
//右键菜单事件 private void GetDrugInfo(int Method) { if (this.dataGridView1.SelectedRows.Count <= 0) { return; } var c = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel; DrugInfo di = this.PharmacyDatabaseService.GetDrugInfo(out msg, c.id); if (di == null) { return; } if (Method == 0) { UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di); Form f = new Form(); f.WindowState = FormWindowState.Normal; f.StartPosition = FormStartPosition.CenterScreen; f.Text = di.ProductGeneralName; f.AutoSize = true; f.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; Panel p = new Panel(); p.AutoSize = true; p.Controls.Add(ucControl); f.Controls.Add(p); SetControls.SetControlReadonly(f, true); f.ShowDialog(); } if (Method == 1) { FormApprovalFlowCenter form = new FormApprovalFlowCenter(di, di.FlowID, false); form.ShowDialog(); } if (Method == 2) { MyExcelUtls.DataGridview2Sheet(this.dataGridView1, "品种信息查询结果"); } if (Method == 3) { var u = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel; byte[] b = this.PharmacyDatabaseService.GetUpdateFiles("ApprovalFiles\\9047DBCF-CD15-4904-8786-006A76DD4799").FirstOrDefault().bytes; using (System.IO.FileStream fs = new System.IO.FileStream("File", System.IO.FileMode.OpenOrCreate)) { fs.Write(b, 0, b.Length); fs.Close(); CreateWinWord cww = new CreateWinWord(); cww.d = u; if (cww.CreateWord(fs.Name, u.ProductGeneralName, 2)) { MessageBox.Show(u.ProductGeneralName + ":审批信息表导出成功!"); this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "导出首营信息审批表成功!品种名称:" + di.ProductGeneralName); } else { this.PharmacyDatabaseService.WriteLog(BugsBox.Pharmacy.AppClient.Common.AppClientContext.currentUser.Id, "导出首营信息审批表失败!品种名称:" + di.ProductGeneralName); } fs.Dispose(); } } if (Method == 4) { var u = this.dataGridView1.SelectedRows[0].DataBoundItem as Business.Models.DrugInfoModel; Form_DrugQualityTrace frm = new Form_DrugQualityTrace(u.id, u.ProductGeneralName); frm.ShowDialog(); frm.Dispose(); } }