コード例 #1
0
ファイル: FormPrice.cs プロジェクト: gotowork/LimsProject
        void InitDataControls()
        {
            deDateCreation.DateTime = Comun.GetDate();
            tbNumDaysValid.Value    = new CSettings().GetNumDaysPriceDefault();

            // --- init company
            cbCompany.Properties.DataSource    = new CCompanyFactory().GetAll();
            cbCompany.Properties.DisplayMember = "Business_name";
            cbCompany.Properties.ValueMember   = "Idcompany";

            // --- init type sample combo
            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";

            Reception oReception = new Reception();

            // --- init type person
            repPerson_type.DataSource    = oReception.GetLstPersonType();
            repPerson_type.DisplayMember = "Name";
            repPerson_type.ValueMember   = "Id";

            // --- init methods
            gcPrice.DataSource = new BindingList <PriceMethod>(new ModPrice().GetPriceMethod(null));

            // --- init plantillas
            CMemo_templateFactory faMemo_template = new CMemo_templateFactory();

            gcParagraphHistoryIni.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 1).ToList();

            gcParagraphHistoryEnd.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 2).ToList();

            // --- init adjuntos
            List <Anexos> list = new ModPrice().GetLstAnexos(null);

            gcAnexos.DataSource = new BindingList <Anexos>(list);
        }
コード例 #2
0
ファイル: FormReception.cs プロジェクト: khoattn/LimsProject
        void InitDataControls()
        {
            deReception.DateTime = DateTime.Now;
            deHourReception.EditValue = DateTime.Now;

            // --- init client combo
            CCompanyFactory faCompany = new CCompanyFactory();
            cbCompany.Properties.DataSource = faCompany.GetAll();
            cbCompany.Properties.ValueMember = "Idcompany";
            cbCompany.Properties.DisplayMember = "Business_name";

            // --- init element combo
            CElementFactory faElement = new CElementFactory();
            lstElement = faElement.GetAll();
            lstElement.Insert(0, new CElement { Idelement = -1, Cod_element = "Seleccionar" });
            var elementQuery = from table in lstElement
                               select new CItemGenericCombo
                               {
                                   codigo = table.Idelement.ToString(),
                                   descripcion = table.Cod_element
                               };

            // --- init type sample combo
            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";

            // --- init description combo
            CDescription_sampleFactory faDescrition_Sample = new CDescription_sampleFactory();
            repDescription.DataSource = faDescrition_Sample.GetAll();
            repDescription.ValueMember = "Cod_des_sample";
            repDescription.DisplayMember = "Description";

            // --- init anio
            CSerieFactory faSerie = new CSerieFactory();
            Reception oReception = new Reception();

            // --- init status report
            repStatusReport.DataSource = Comun.ListStatusReport;
            repStatusReport.ValueMember = "IdStatus";
            repStatusReport.DisplayMember = "Den_Status";

            // --- init status attach
            repAttach_status.DataSource = oReception.GetAttachStatus();
            repAttach_status.DisplayMember = "Name_status";
            repAttach_status.ValueMember = "Id";

            repPerson_type.DataSource = oReception.GetLstPersonType();
            repPerson_type.DisplayMember = "Name";
            repPerson_type.ValueMember = "Id";
        }