public void OpenDrugInfo() { var dr = this.dataGridView1.CurrentRow; if (dr == null) { return; } var druginfo = dr.DataBoundItem as Business.Models.PurchaseOrderImpt; Guid DrugId = druginfo.DrugInfoId; using (BaseFunctionForm bf = new Pharmacy.AppClient.UI.BaseFunctionForm()) { var di = bf.PharmacyDatabaseService.GetDrugInfo(out msg, DrugId); if (di == null) { return; } if (di.BusinessScopeCode.Contains("医疗器械")) { Forms.BaseDataManage.FormInstrument frm = new BaseDataManage.FormInstrument(); frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; frm.entity = di; Common.SetControls.SetControlReadonly(frm, true); frm.ShowDialog(); return; } if (di.BusinessScopeCode.Contains("保健食品")) { Forms.BaseDataManage.FormFood frm = new BaseDataManage.FormFood(); frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; frm.entity = di; Common.SetControls.SetControlReadonly(frm, true); frm.ShowDialog(); return; } UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di); System.Windows.Forms.Form f = new System.Windows.Forms.Form(); f.WindowState = System.Windows.Forms.FormWindowState.Normal; f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; f.Text = di.ProductGeneralName; f.AutoSize = true; f.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); p.AutoSize = true; p.Controls.Add(ucControl); f.Controls.Add(p); Forms.Common.SetControls.SetControlReadonly(f, true); f.ShowDialog(); f.Dispose(); } }
public void GetDrugInfo() { using (BaseFunctionForm bf = new Pharmacy.AppClient.UI.BaseFunctionForm()) { if (this.DrugId == Guid.Empty && this.DrugInventoryId != Guid.Empty) { var div = bf.PharmacyDatabaseService.GetDrugInventoryRecord(out msg, this.DrugInventoryId); this.DrugId = div.DrugInfoId; } var di = bf.PharmacyDatabaseService.GetDrugInfo(out msg, this.DrugId); if (di == null) { return; } if (di.BusinessScopeCode.Contains("医疗器械")) { Forms.BaseDataManage.FormInstrument frm = new BaseDataManage.FormInstrument(); frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; frm.entity = di; Common.SetControls.SetControlReadonly(frm, true); frm.ShowDialog(); return; } if (di.BusinessScopeCode.Contains("保健食品")) { Forms.BaseDataManage.FormFood frm = new BaseDataManage.FormFood(); frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; frm.entity = di; Common.SetControls.SetControlReadonly(frm, true); frm.ShowDialog(); return; } UI.UserControls.ucGoodsInfo ucControl = new UserControls.ucGoodsInfo(di); System.Windows.Forms.Form f = new System.Windows.Forms.Form(); f.WindowState = System.Windows.Forms.FormWindowState.Normal; f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; f.Text = di.ProductGeneralName; f.AutoSize = true; f.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); p.AutoSize = true; p.Controls.Add(ucControl); f.Controls.Add(p); Forms.Common.SetControls.SetControlReadonly(f, true); f.ShowDialog(); f.Dispose(); } }
/// <summary> /// 打开详细的审批对象信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvApprovalList_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0) { return; } //加入详细画面 if (dgvApprovalList.Columns[e.ColumnIndex].Name == "查看详细") { if (dgvApprovalList.Rows[e.RowIndex].Cells[4].Value != null) { string msg = string.Empty; Models.ApprovalFlow flow = _approveFlowList[e.RowIndex]; ApprovalFlowType flowType = PharmacyDatabaseService.GetApprovalFlowType(out msg, flow.ApprovalFlowTypeId); switch (flowType.ApprovalTypeValue) { case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitEditApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.SupplyUnitLockApproval: ucSupplyUnit uc = new ucSupplyUnit(flow.FlowId); uc.Name = "DetailView"; this.plDetailView.Controls.Add(uc); break; case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoEditApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.DrugInfoLockApproval: DrugInfo di = this.PharmacyDatabaseService.GetDrugInfoByFlowID(out msg, flow.FlowId); if (di.BusinessScopeCode.Contains("医疗器械")) { BaseDataManage.FormInstrument frmInstrument = new BaseDataManage.FormInstrument { entity = di, }; Common.SetControls.SetControlReadonly(frmInstrument, true); frmInstrument.FSE = FormStatusEnum.Read; frmInstrument.ShowDialog(); return; } else { ucGoodsInfo ucdi = new ucGoodsInfo(di); Common.SetControls.SetControlReadonly(ucdi, true); ucdi.Name = "DetailView"; this.plDetailView.Controls.Add(ucdi); } break; case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitEditApproval: case (int)BugsBox.Pharmacy.Models.ApprovalType.PurchaseUnitLockApproval: ucPurchaseUnit ucpu = new ucPurchaseUnit(flow.FlowId); ucpu.Name = "DetailView"; this.plDetailView.Controls.Add(ucpu); break; case (int)BugsBox.Pharmacy.Models.ApprovalType.drugsUnqualityApproval: Business.Models.drugsUnqualificationQuery dq = PharmacyDatabaseService.getDrugsUnqualificationQueryByFlowID(flow.FlowId, out msg); ucDrugsUnqualification ucdu = new ucDrugsUnqualification(dq); ucdu.initApprovalDetail(flow.FlowId); ucdu.Name = "DetailView"; this.plDetailView.Controls.Add(ucdu); break; case (int)ApprovalType.drugsBreakageApproval: DrugsBreakage db = PharmacyDatabaseService.GetDrugsBreakageByFlowID(flow.FlowId, out msg); UcDrugBreakage ucdb = new UcDrugBreakage(db, flow); ucdb.Name = "DetailView"; this.plDetailView.Controls.Add(ucdb); break; case (int)ApprovalType.VehicleApproval: Vehicle v = this.PharmacyDatabaseService.GetVehicleByFlowID(flow.FlowId, out msg); if (v == null) { return; } DataDictionary.FormVehicleEdit frm = new DataDictionary.FormVehicleEdit(v, true); frm.ShowDialog(); return; case (int)ApprovalType.DirectSalesApproval: DirectSalesOrder dso = this.PharmacyDatabaseService.GetDirectSalesOrderByFlowId(flow.FlowId, out msg); UCDirectSales UCDS = new UCDirectSales(dso); UCDS.Name = "DetailView"; this.plDetailView.Controls.Add(UCDS); break; } } //显示详细 this.plDetailView.BringToFront(); this.plDetailView.Visible = true; } else //打开详细流程记录, 审批流程表(上表)里的一条被选中后,把详细审批过程写入审批流程详细表(下表) { dgvApprovalList_RowEnter(sender, e); } } catch (Exception ex) { Log.Error(ex); MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information); } }