Ejemplo n.º 1
0
        protected override bool Grabar_Registro()
        {
            CSerieFactory faSerie         = new CSerieFactory();
            List <CSerie> lstCorr_modules = faSerie.GetAll();

            foreach (CSerie item in lstCorr_modules)
            {
                item.Status_serie = false;
                faSerie.Update(item);
            }

            CSerie oSerie = new CSerie();

            oSerie.Cod_serie    = tbCodSerie.Text;
            oSerie.Nom_serie    = cbNomSerie.Text;
            oSerie.Dateinit     = deDateIni.DateTime;
            oSerie.Dateend      = deDateEnd.DateTime;
            oSerie.Status_serie = true;

            bool result = false;

            if (!(result = faSerie.Update(oSerie)))
            {
                result = faSerie.Insert(oSerie);
            }

            return(result);
        }
Ejemplo n.º 2
0
        protected override void Recuperar_Registro()
        {
            CSerie oSerie = new CSerieFactory().GetByPrimaryKey(new CSerieKeys(Cod_Serie));

            if (oSerie != null)
            {
                tbCodSerie.Text    = oSerie.Cod_serie;
                cbNomSerie.Text    = oSerie.Nom_serie;
                deDateIni.DateTime = Convert.ToDateTime(oSerie.Dateinit);
                deDateEnd.DateTime = Convert.ToDateTime(oSerie.Dateend);
            }
        }
Ejemplo n.º 3
0
        protected override bool Grabar_Registro()
        {
            CSerieFactory faSerie = new CSerieFactory();
            List<CSerie> lstCorr_modules = faSerie.GetAll();

            foreach (CSerie item in lstCorr_modules)
            {
                item.Status_serie = false;
                faSerie.Update(item);
            }

            CSerie oSerie = new CSerie();
            oSerie.Cod_serie = tbCodSerie.Text;
            oSerie.Nom_serie = cbNomSerie.Text;
            oSerie.Dateinit = deDateIni.DateTime;
            oSerie.Dateend = deDateEnd.DateTime;
            oSerie.Status_serie = true;

            bool result = false;
            if (!(result = faSerie.Update(oSerie)))
                result = faSerie.Insert(oSerie);

            return result;
        }
Ejemplo n.º 4
0
 protected override void Recuperar_Registro()
 {
     CSerie oSerie = new CSerieFactory().GetByPrimaryKey(new CSerieKeys(Cod_Serie));
     if (oSerie != null)
     {
         tbCodSerie.Text = oSerie.Cod_serie;
         cbNomSerie.Text = oSerie.Nom_serie;
         deDateIni.DateTime = Convert.ToDateTime(oSerie.Dateinit);
         deDateEnd.DateTime = Convert.ToDateTime(oSerie.Dateend);
     }
 }
Ejemplo n.º 5
0
        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";
        }