コード例 #1
0
        public void InitData()
        {
            #region init combos

            try
            {
                // --- init: type of sample
                CType_sampleFactory faType_Sample = new CType_sampleFactory();
                cbTypeSample.Properties.DataSource    = faType_Sample.GetAll();
                cbTypeSample.Properties.ValueMember   = "Cod_type_sample";
                cbTypeSample.Properties.DisplayMember = "Name_type_sample";

                repTypeSample.DataSource    = faType_Sample.GetAll();
                repTypeSample.ValueMember   = "Cod_type_sample";
                repTypeSample.DisplayMember = "Name_type_sample";

                // --- init: type of analysis
                cbTypeAnalysis.Properties.DataSource    = Comun.ListTypeAnalysis;
                cbTypeAnalysis.Properties.ValueMember   = "Type_analisys";
                cbTypeAnalysis.Properties.DisplayMember = "Den_Type_Analysis";

                repTypeAnalysis.DataSource    = Comun.ListTypeAnalysis;
                repTypeAnalysis.ValueMember   = "Type_analisys";
                repTypeAnalysis.DisplayMember = "Den_Type_Analysis";

                // --- init: digestation
                CDigestion_methodFactory faDigestation_Method = new CDigestion_methodFactory();
                cbDigestion.Properties.DataSource    = faDigestation_Method.GetAll();
                cbDigestion.Properties.ValueMember   = "Cod_digestion_method";
                cbDigestion.Properties.DisplayMember = "Name_digestion_method";

                // --- init: element
                CElementFactory faElement = new CElementFactory();
                cbElement.Properties.DataSource    = faElement.GetAll();
                cbElement.Properties.ValueMember   = "Idelement";
                cbElement.Properties.DisplayMember = "Cod_element";

                repElement.DataSource    = faElement.GetAll();
                repElement.ValueMember   = "Idelement";
                repElement.DisplayMember = "Cod_element";

                // --- init: measurement unit number 1
                cbRepetition.Properties.DataSource    = Comun.ListTypeRepetition;
                cbRepetition.Properties.DisplayMember = "Name_repetition";
                cbRepetition.Properties.ValueMember   = "Cod_repetition";

                Methods oMethods = new Methods();
                gluCod_method.Properties.DataSource    = oMethods.GetAllLastVersionMethods();
                gluCod_method.Properties.DisplayMember = "Cod_template_method";
                gluCod_method.Properties.ValueMember   = "Cod_template_method";

                CReactiveFactory faReactive  = new CReactiveFactory();
                List <CReactive> lstReactive = faReactive.GetAll();

                lstReactive.Add(new CReactive()
                {
                    Idreactive = 0, Reactive_name = "---", Chemical_formula = "---"
                });

                gluCod_method.Properties.View.BestFitColumns();
            }
            catch (Exception ex)
            {
                ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message);
            }
            #endregion
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }