void InitCombos() { // --- Init : measurement unit 1 CMeasurement_unitFactory faMeasurement_unit = new CMeasurement_unitFactory(); repUm1.DataSource = faMeasurement_unit.GetAll(); repUm1.DisplayMember = "Name_unit"; repUm1.ValueMember = "Idunit"; // --- Init : measurement unit 2 repUm2.DataSource = faMeasurement_unit.GetAll(); repUm2.DisplayMember = "Name_unit"; repUm2.ValueMember = "Idunit"; }
public void InitData() { #region init combos try { CMeasurement_unitFactory faMeasurement_unit = new CMeasurement_unitFactory(); cbUnit_result.Properties.DataSource = faMeasurement_unit.GetAll(); cbUnit_result.Properties.DisplayMember = "Name_unit"; cbUnit_result.Properties.ValueMember = "Idunit"; } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } #endregion }
private void FormMaterialReference_Load(object sender, EventArgs e) { // --- Initialize material of reference CMrFactory faMr = new CMrFactory(); cbCodMR.Properties.DataSource = faMr.GetAll(); cbCodMR.Properties.ValueMember = "Idmr"; cbCodMR.Properties.DisplayMember = "Cod_mr"; // --- Initialize description sample cbDescription.Properties.DataSource = Comun.ListTypeMaterial; cbDescription.Properties.ValueMember = "IdTypeMaterial"; cbDescription.Properties.DisplayMember = "Description"; // --- Initialize type of analysis CDigestion_methodFactory faDigestion_method = new CDigestion_methodFactory(); repTypeDigestion.DataSource = faDigestion_method.GetAll(); repTypeDigestion.ValueMember = "Cod_digestion_method"; repTypeDigestion.DisplayMember = "Name_digestion_method"; // --- Initialize the type of material reference cbTypeMr.Properties.DataSource = Comun.ListMr; cbTypeMr.Properties.DisplayMember = "Den_TypeMr"; cbTypeMr.Properties.ValueMember = "IdTypeMr"; // --- Initialize in container grid element CElementFactory faElement = new CElementFactory(); repElement.DataSource = faElement.GetAll(); repElement.DisplayMember = "Cod_element"; repElement.ValueMember = "Idelement"; // --- Initialize in container grid unit measurement CMeasurement_unitFactory faMeasurement_unit = new CMeasurement_unitFactory(); repTypeUnit.DataSource = faMeasurement_unit.GetAll(); repTypeUnit.DisplayMember = "Name_unit"; repTypeUnit.ValueMember = "Idunit"; // --- Inititalize list statusMr lstStatusMr = new BindingList<CStatusMr>(); lstStatusMr.Add(new CStatusMr { IDStatusMr = true, Description = "Vigente" }); lstStatusMr.Add(new CStatusMr { IDStatusMr = false, Description = "No vigente" }); cbStatus.Properties.DataSource = lstStatusMr; cbStatus.Properties.DisplayMember = "Description"; cbStatus.Properties.ValueMember = "IDStatusMr"; // --- Initialize in container grid company CCompanyFactory faCompany = new CCompanyFactory(); List<CCompany> lstCompany = faCompany.GetAll().Where(c=> c.Type_company == 'P').ToList(); cbManufacturer.Properties.DataSource = lstCompany; cbManufacturer.Properties.DisplayMember = "Business_name"; cbManufacturer.Properties.ValueMember = "Idcompany"; cbCertifier.Properties.DataSource = lstCompany; cbCertifier.Properties.DisplayMember = "Business_name"; cbCertifier.Properties.ValueMember = "Idcompany"; // --- Initialize the grid GetDetailMaterialReference(); }
private void FormMaterialReference_Load(object sender, EventArgs e) { // --- Initialize material of reference CMrFactory faMr = new CMrFactory(); cbCodMR.Properties.DataSource = faMr.GetAll(); cbCodMR.Properties.ValueMember = "Idmr"; cbCodMR.Properties.DisplayMember = "Cod_mr"; // --- Initialize description sample cbDescription.Properties.DataSource = Comun.ListTypeMaterial; cbDescription.Properties.ValueMember = "IdTypeMaterial"; cbDescription.Properties.DisplayMember = "Description"; // --- Initialize type of analysis CDigestion_methodFactory faDigestion_method = new CDigestion_methodFactory(); repTypeDigestion.DataSource = faDigestion_method.GetAll(); repTypeDigestion.ValueMember = "Cod_digestion_method"; repTypeDigestion.DisplayMember = "Name_digestion_method"; // --- Initialize the type of material reference cbTypeMr.Properties.DataSource = Comun.ListMr; cbTypeMr.Properties.DisplayMember = "Den_TypeMr"; cbTypeMr.Properties.ValueMember = "IdTypeMr"; // --- Initialize in container grid element CElementFactory faElement = new CElementFactory(); repElement.DataSource = faElement.GetAll(); repElement.DisplayMember = "Cod_element"; repElement.ValueMember = "Idelement"; // --- Initialize in container grid unit measurement CMeasurement_unitFactory faMeasurement_unit = new CMeasurement_unitFactory(); repTypeUnit.DataSource = faMeasurement_unit.GetAll(); repTypeUnit.DisplayMember = "Name_unit"; repTypeUnit.ValueMember = "Idunit"; // --- Inititalize list statusMr lstStatusMr = new BindingList <CStatusMr>(); lstStatusMr.Add(new CStatusMr { IDStatusMr = true, Description = "Vigente" }); lstStatusMr.Add(new CStatusMr { IDStatusMr = false, Description = "No vigente" }); cbStatus.Properties.DataSource = lstStatusMr; cbStatus.Properties.DisplayMember = "Description"; cbStatus.Properties.ValueMember = "IDStatusMr"; // --- Initialize in container grid company CCompanyFactory faCompany = new CCompanyFactory(); List <CCompany> lstCompany = faCompany.GetAll().Where(c => c.Type_company == 'P').ToList(); cbManufacturer.Properties.DataSource = lstCompany; cbManufacturer.Properties.DisplayMember = "Business_name"; cbManufacturer.Properties.ValueMember = "Idcompany"; cbCertifier.Properties.DataSource = lstCompany; cbCertifier.Properties.DisplayMember = "Business_name"; cbCertifier.Properties.ValueMember = "Idcompany"; // --- Initialize the grid GetDetailMaterialReference(); }