Пример #1
0
        public Crear_Proyecto_Form()
        {
            try
            {
                InitializeComponent();
                this.ControlBox = false;
                criterioCbx.SelectedIndex = 0;
                newProject = new PROYECTO();
                confianzaTextBox.Text = "95";
                limiteInfTxt.Text = "0,1";
                areaFustalesTxt.Text = "1";
                factorFormaTxt.Text = "0,65";
                areaMuestrearTxt.Text = "0";
                numeroParcelasMuestraTxt.Text = "0";
                numeroParcelasTxt.Text = "0";
                AreaTotalTxt.Text = "0";
                tamParcelaTxt.Text = "0";
                formulate = new FormulateBL(Program.ContextData);
                formulaBS.DataSource = formulate.GetFormulates();
                newProject.NROFORMULA = formulaBS.Count != 0 ? ((FORMULA)formulaBS.Current).NROFORMULA : Guid.Empty;
                project = new ProjectBL(Program.ContextData);
                estratoDGW.Columns[2].DefaultCellStyle.Format = "0.000##";
                typeExample = new TypeSampleDesignBl(Program.ContextData);
                objetiveInventory = new ObjectiveInventoryBL(Program.ContextData);
                stratum = new StratumBL(Program.ContextData);
                species = new SpeciesBL(Program.ContextData);
                costBL = new CostBL(Program.ContextData);
                objetivoInventarioBS.DataSource = objetiveInventory.GetObjectiveInventories();
                newProject.NOMBRETIPOINV = objetivoInventarioBS.Count != 0 ? ((OBJETIVOINVENTARIO)objetivoInventarioBS.Current).NOMBRETIPOINV : null;
                tipoDisenoBS.DataSource = typeExample.GetTypeSampleDesignList();
                newProject.NOMTIPODISEMUEST = tipoDisenoBS.Count != 0 ? ((TIPODISENOMUESTRAL)tipoDisenoBS.Current).NOMTIPODISEMUEST : null;
                estratoBS.DataSource = stratum.GetStratums();
                estratoDGW.DataSource = estratoBS;
                especieBS.DataSource = species.GetSpecies();
                especiesDGW.DataSource = especieBS;
                proyectoBS.DataSource = project.GetProjectsFree(null);
                proyectoDGW.DataSource = proyectoBS;
                costoBS.DataSource = costBL.GetCosts();
                costoDGW.DataSource = costoBS;
                listProjectsByStage = new List<PROYECTOSPORETAPA>();
                tipoDisenoCbx.SelectedValue = "SI";
                TipoProyectoCbx.SelectedIndex = 0;
                nuevoProyectoBS.DataSource = newProject;

                foreach (Control ctl in crearProyectoTab.TabPages["costosTabP"].Controls) ctl.Enabled = true;
            }
            catch (Exception ex)
            {
                Error_Form errorForm = new Error_Form(ex.Message);
                errorForm.MdiParent = ParentForm;
                errorForm.Show();
            }
        }
Пример #2
0
 public Abrir_Formulario_Form()
 {
     try {
         InitializeComponent();
         form = new FormBL(Program.ContextData);
         stratum = new StratumBL(Program.ContextData);
         project = new ProjectBL(Program.ContextData);
         List<FORMULARIO> formulariosProyecto = ((PROYECTO)Program.Cache.Get("project")).FORMULARIO.ToList();
         formularioBS.DataSource = formulariosProyecto;
         formularioDGW.DataSource = formularioBS;
         estratosBS.DataSource = stratum.GetStratums();
         criterioCbx.SelectedIndex = 0;
     }
     catch (Exception ex)
     {
         Error_Form er = new Error_Form(ex.Message);
         er.MdiParent = this.MdiParent;
         er.Show();
     }
 }
Пример #3
0
        public Actualizar_Proyectos_Form()
        {
            try
            {
                InitializeComponent();
                this.ControlBox = false;
                project = new ProjectBL(Program.ContextData);
                typeExample = new TypeSampleDesignBl(Program.ContextData);
                objetiveInventory = new ObjectiveInventoryBL(Program.ContextData);
                stratum = new StratumBL(Program.ContextData);
                species = new SpeciesBL(Program.ContextData);
                form = new FormBL(Program.ContextData);
                formulateBL = new FormulateBL(Program.ContextData);
                costBL = new CostBL(Program.ContextData);

                PROYECTO p = (PROYECTO)Program.Cache.Get("project");

                proyectoBS.DataSource = p;

                proyectosBS.DataSource = project.GetProjects(p);
                proyectoDGW.DataSource = proyectosBS;

                objetivoInventarioBS.DataSource = objetiveInventory.GetObjectiveInventories();
                tipoObjetivoCbx.DataSource = objetivoInventarioBS;
                List<KeyValuePair<string, string>> data = new List<KeyValuePair<string, string>>();
                data.Add(new KeyValuePair<string, string>("IN", "Independiente"));
                data.Add(new KeyValuePair<string, string>("CR", "Contenedor"));
                TipoProyectoCbx.DataSource = data;
                TipoProyectoCbx.DisplayMember = "Value";
                TipoProyectoCbx.ValueMember = "Key";
                TipoProyectoCbx.SelectedValue = p.TIPOPROYECTO;

                criterioCbx.SelectedIndex = 0;
                tipoDisenoBS.DataSource = typeExample.GetTypeSampleDesignList();
                tipoDisenoCbx.DataSource = tipoDisenoBS;

                especieBS.DataSource = species.GetSpecies();
                especiesDGW.DataSource = especieBS;

                formulariosBS.DataSource = p.FORMULARIO;
                formulariosDGW.DataSource = formulariosBS;

                costoBS.DataSource = costBL.GetCosts();
                costoDGW.DataSource = costoBS;

                //formulaBS.DataSource = formulateBL.GetFormulates();
                //formularComboBox.DataSource = formulaBS;
                formularComboBox.DataSource = formulateBL.GetFormulates();
                formularComboBox.SelectedValue = p.NROFORMULA;

                //formularComboBox.SelectedItem = p.FORMULA;
                expresionTxt.Text = p.FORMULA.EXPRESION;

                estratoBS.DataSource = stratum.GetStratums();
                estratoDGW.DataSource = estratoBS;

                numeroEtapasTxt.Text = p.ETAPA.ToString();

                confianzaTxt.Text = p.CONFIANZA.ToString();
                tamParcelaTxt.Text = p.TAMANO.ToString();
                numeroParcelasTxt.Text = p.NUMEROPARCELAS.ToString();
                numeroParcelasMuestraTxt.Text = p.NUMEROPARCELASAMUESTREAR.ToString();
                limiteInfTxt.Text = p.LIMITINFDAP.ToString();
                intMuestreoTxt.Text = p.INTMUE.ToString();
                AreaTotalTxt.Text = p.SUPTOT.ToString();
                areaMuestrearTxt.Text = p.SUPMUE.ToString();
                areaFustalesTxt.Text = p.AREAFUSTALESPORPARCELA.ToString();
                factorFormaTxt.Text = p.FACTORDEFORMA.ToString();

                this.modificate = false;
            }
            catch (Exception ex)
            {
                Error_Form errorForm = new Error_Form(ex.Message);
                errorForm.MdiParent = ParentForm;
                errorForm.Show();
            }
        }