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 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; } }