private void GetResource(int i) { bool2String b = this.dataGridView1.SelectedRows[0].DataBoundItem as bool2String; SupplyUnit su = _listSupplyUnit.Where(r => r.Id == b.id).FirstOrDefault(); switch (i) { case 0: FormMedicineBusinessLicense FormMedicineBusinessLicense = new FormMedicineBusinessLicense(su.MedicineBusinessLicenseId, true); SetControls.SetControlReadonly(FormMedicineBusinessLicense, true); FormMedicineBusinessLicense.ShowDialog(); break; case 1: FormGMPLicense FormGMPLiscense = new FormGMPLicense(su.GMPLicenseId, string.Empty, string.Empty, true); SetControls.SetControlReadonly(FormGMPLiscense, true); FormGMPLiscense.ShowDialog(); break; case 2: FormMedicineProductionLicense FormMedicineProductionLicense = new FormMedicineProductionLicense(su.MedicineProductionLicenseId, true); SetControls.SetControlReadonly(FormMedicineProductionLicense, true); FormMedicineProductionLicense.ShowDialog(); break; case 3: FormBusinessLicense FormBusinessLicense = new FormBusinessLicense(su.BusinessLicenseId, string.Empty, string.Empty); SetControls.SetControlReadonly(FormBusinessLicense, true); FormBusinessLicense.ShowDialog(); break; case 4: FormInstrumentsProductionLicense FormInstrumentsProductionLicense = new FormInstrumentsProductionLicense(su.InstrumentsProductionLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormInstrumentsProductionLicense, true); FormInstrumentsProductionLicense.ShowDialog(); break; case 5: FormInstrumentsBusinessLicense FormInstrumentsBusinessLicense = new FormInstrumentsBusinessLicense(su.InstrumentsBusinessLicenseId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormInstrumentsBusinessLicense, true); FormInstrumentsBusinessLicense.ShowDialog(); break; case 6: FormOrganizationCodeLicense FormOrganizationCodeLicense = new FormOrganizationCodeLicense(su.OrganizationCodeLicenseId, string.Empty, string.Empty); SetControls.SetControlReadonly(FormOrganizationCodeLicense, true); FormOrganizationCodeLicense.ShowDialog(); break; case 7: FormHealthLicense FormHealthLicense = new FormHealthLicense(su.HealthLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormHealthLicense, true); FormHealthLicense.ShowDialog(); break; case 8: LnstitutionLegalPersonLicense LegalPersonLicense = new LnstitutionLegalPersonLicense(); LegalPersonLicense.Id = su.LnstitutionLegalPersonLicenseId; FormLegalPersonLicense FormLegalPersonLicense = new FormLegalPersonLicense(LegalPersonLicense, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormLegalPersonLicense, true); FormLegalPersonLicense.ShowDialog(); break; case 9: FormTaxRegisterLicense FormTaxRegisterLicense = new FormTaxRegisterLicense(su.TaxRegisterLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormTaxRegisterLicense, true); FormTaxRegisterLicense.ShowDialog(); break; case 10: FormFoodCirculateLicense FormFoodCirculateLicense = new FormFoodCirculateLicense(su.FoodCirculateLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormFoodCirculateLicense, true); FormFoodCirculateLicense.ShowDialog(); break; case 11: FormGSPLicense FormGSPLicense = new FormGSPLicense(su.GSPLicenseId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormGSPLicense, true); FormGSPLicense.ShowDialog(); break; case 12: MmedicalInstitutionPermit InstitutionPermit = new MmedicalInstitutionPermit(); InstitutionPermit.Id = su.MmedicalInstitutionPermitId; FormMmedicalInstitutionPermit FormMmedicalInstitutionPermit = new FormMmedicalInstitutionPermit(InstitutionPermit, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormMmedicalInstitutionPermit, true); FormMmedicalInstitutionPermit.ShowDialog(); break; } }
private void GetResource(int i) { PurchaseUnitShow ps = this.dgvMain.CurrentRow.DataBoundItem as PurchaseUnitShow; PurchaseUnit pu = this._listPurchaseUnit.Where(r => r.Id == ps.Id).FirstOrDefault(); if (pu == null) { return; } switch (i) { case 0: FormMedicineBusinessLicense FormMedicineBusinessLicense = new FormMedicineBusinessLicense(pu.MedicineBusinessLicenseId, true); FormMedicineBusinessLicense.ShowDialog(); break; case 1: FormGMPLicense frm = new FormGMPLicense(pu.GMPLicenseId, string.Empty, string.Empty, true); frm.ShowDialog(); break; case 2: FormMedicineProductionLicense FormMedicineProductionLicense = new FormMedicineProductionLicense(pu.MedicineProductionLicenseId, true); SetControls.SetControlReadonly(FormMedicineProductionLicense, true); FormMedicineProductionLicense.ShowDialog(); break; case 3: FormBusinessLicense FormBusinessLicense = new FormBusinessLicense(pu.BusinessLicenseId, string.Empty, string.Empty); SetControls.SetControlReadonly(FormBusinessLicense, true); FormBusinessLicense.ShowDialog(); break; case 4: FormInstrumentsProductionLicense FormInstrumentsProductionLicense = new FormInstrumentsProductionLicense(pu.InstrumentsProductionLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormInstrumentsProductionLicense, true); FormInstrumentsProductionLicense.ShowDialog(); break; case 5: FormInstrumentsBusinessLicense FormInstrumentsBusinessLicense = new FormInstrumentsBusinessLicense(pu.InstrumentsBusinessLicenseId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormInstrumentsBusinessLicense, true); FormInstrumentsBusinessLicense.ShowDialog(); break; case 6: FormOrganizationCodeLicense FormOrganizationCodeLicense = new FormOrganizationCodeLicense(pu.OrganizationCodeLicenseId, string.Empty, string.Empty); SetControls.SetControlReadonly(FormOrganizationCodeLicense, true); FormOrganizationCodeLicense.ShowDialog(); break; case 7: FormHealthLicense FormHealthLicense = new FormHealthLicense(pu.HealthLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormHealthLicense, true); FormHealthLicense.ShowDialog(); break; case 8: LnstitutionLegalPersonLicense LegalPersonLicense = new LnstitutionLegalPersonLicense(); LegalPersonLicense.Id = pu.LnstitutionLegalPersonLicenseId; FormLegalPersonLicense FormLegalPersonLicense = new FormLegalPersonLicense(LegalPersonLicense, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormLegalPersonLicense, true); FormLegalPersonLicense.ShowDialog(); break; case 9: FormTaxRegisterLicense FormTaxRegisterLicense = new FormTaxRegisterLicense(pu.TaxRegisterLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormTaxRegisterLicense, true); FormTaxRegisterLicense.ShowDialog(); break; case 10: FormFoodCirculateLicense FormFoodCirculateLicense = new FormFoodCirculateLicense(pu.FoodCirculateLicenseId, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormFoodCirculateLicense, true); FormFoodCirculateLicense.ShowDialog(); break; case 11: FormGSPLicense FormGSPLicense = new FormGSPLicense(pu.GSPLicenseId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormGSPLicense, true); FormGSPLicense.ShowDialog(); break; case 12: MmedicalInstitutionPermit InstitutionPermit = new MmedicalInstitutionPermit(); InstitutionPermit.Id = pu.MmedicalInstitutionPermitId; FormMmedicalInstitutionPermit FormMmedicalInstitutionPermit = new FormMmedicalInstitutionPermit(InstitutionPermit, string.Empty, string.Empty, string.Empty, string.Empty); SetControls.SetControlReadonly(FormMmedicalInstitutionPermit, true); FormMmedicalInstitutionPermit.ShowDialog(); break; } }
private void buttonLicense_Click(object sender, EventArgs e) { if (!ValidateControls(out msg)) { MessageBox.Show("请先填写必要的企业信息,如单位名称,法人,收货地址等!"); return; } Button btnLicense = sender as Button; string legalPerson = txtLegalPerson.Text.Trim(); string name = txtName.Text.Trim(); string address = txtBoxCompanyAddress.Text.Trim(); string qualityCharger = txtBoxQualityCharger.Text.Trim(); string wareHouseAddress = txtReceiveAddress.Text.Trim(); Guid LicenseId = btnLicense.Tag == null ? Guid.Empty : (Guid)btnLicense.Tag; switch (btnLicense.Text) { case "分类控制中心": LicenseId = PurchaseUnit == null ? Guid.Empty : PurchaseUnit.GSPLicenseId; FormGSPLicense frm = new FormGSPLicense(LicenseId, legalPerson, qualityCharger, name, address, wareHouseAddress); SetControls.SetControlReadonly(frm, !this._isEditable); if (frm.ShowDialog() == DialogResult.OK) { btnLicense.Tag = frm._gspLiscenceId; btnLicense.BackColor = Color.LightBlue; } break; case "三证信息": FormBusinessLicense FormBusinessLicense = new FormBusinessLicense(LicenseId, name, address); SetControls.SetControlReadonly(FormBusinessLicense, !this._isEditable); if (FormBusinessLicense.ShowDialog() == DialogResult.OK) { btnLicense.Tag = FormBusinessLicense.BusinessLicense.Id; } break; case "器械生产许可证": FormInstrumentsProductionLicense FormInstrumentsProductionLicense = new FormInstrumentsProductionLicense(LicenseId, legalPerson, address, name); SetControls.SetControlReadonly(FormInstrumentsProductionLicense, !this._isEditable); if (FormInstrumentsProductionLicense.ShowDialog() == DialogResult.OK) { btnLicense.Tag = FormInstrumentsProductionLicense.InstrumentsProductionLicense.Id; } break; case "器械经营许可证": FormInstrumentsBusinessLicense FormInstrumentsBusinessLicense = new FormInstrumentsBusinessLicense(LicenseId, legalPerson, qualityCharger, name, address, wareHouseAddress); SetControls.SetControlReadonly(FormInstrumentsBusinessLicense, !this._isEditable); if (FormInstrumentsBusinessLicense.ShowDialog() == DialogResult.OK) { btnLicense.Tag = FormInstrumentsBusinessLicense.InstrumentsBusinessLicense.Id; } break; case "医疗机构执业许可证": MmedicalInstitutionPermit InstitutionPermit = new MmedicalInstitutionPermit(); InstitutionPermit.Id = LicenseId; FormMmedicalInstitutionPermit FormMmedicalInstitutionPermit = new FormMmedicalInstitutionPermit(InstitutionPermit, name, address, legalPerson, wareHouseAddress); SetControls.SetControlReadonly(FormMmedicalInstitutionPermit, !this._isEditable); if (FormMmedicalInstitutionPermit.ShowDialog() == DialogResult.OK) { btnLicense.Tag = FormMmedicalInstitutionPermit.MmedicalInstitutionPermit.Id; } break; } if (!(btnLicense.Tag == null)) { if (!btnLicense.Tag.Equals(Guid.Empty))// ||!btnLicense.Tag.Equals(Guid.Empty) { btnLicense.BackColor = Color.LightBlue; } else { btnLicense.BackColor = Color.LightGray; } } }