Example #1
0
        protected void lnkEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton  imgEditar = (LinkButton)sender;
                GridViewRow fila      = (GridViewRow)imgEditar.NamingContainer;

                BFESCALA objBFES = new BFESCALA();
                EESCALA  objES   = objBFES.GetESCALA(Utiles.ConvertToInt64(((Label)fila.FindControl("lblCodigo")).Text));

                if ((objBFES.PoseeDatosRelacionados(objES.CODESCALA)))
                {
                    this.litErrorDatosRelacionados.Visible = true;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('3');", true);
                }
                else
                {
                    objBFES.Delete(objES);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('4');", true);
                }
            }
            catch (Exception ex)
            {
                Log log = new Log();
                log.EscribirLog(ex);
                litCatchError.Visible = true;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('0');", true);
            }
        }
Example #2
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         BFESCALA objBFES = new BFESCALA();
         EESCALA  objES   = new EESCALA();
         objES.CODESCALA     = Utiles.ConvertToInt16(this.txtCodEscala.Text);
         objES.NOMESCALA     = Utiles.ConvertToString(this.txtNombre.Text);
         objES.VALORMENOR    = Utiles.ConvertToDouble(this.txtValorMenor.Text);
         objES.VALORMAYOR    = Utiles.ConvertToDouble(this.txtValorMayor.Text);
         objES.INSTRUCCIONES = Utiles.ConvertToString(this.txtInstruncciones.Text);
         objES.RUT_EMPRESA   = objSession.RutEmpresa;
         objES.CATEGORIAS    = (List <ECATEGORIA>)ViewState["Categorias"];
         if (this.rbPorRangos.Checked)
         {
             objES.FLAG_RANGOS = true;
         }
         objES.RANGOS = (List <ERANGO>)ViewState["Rangos"];
         objBFES.Save(objES);
         Cargar();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "SessionUsuario", "alert('Los datos han sido ingresados exitosamente.');", true);
     }
     catch (Exception ex)
     {
         Log log = new Log();
         log.EscribirLog(ex);
         litCatchError.Visible = true;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('0');", true);
     }
 }
 protected void InicializarFormulario()
 {
     try
     {
         BFESCALA objES = new BFESCALA();
         objWEB.LlenaDDL(ref ddlEscalas, objES.GetESCALAAll(objSession.RutEmpresa).Cast <DomainObject>().ToList(), "CODESCALA", "NOMESCALA");
     }
     catch (Exception ex)
     {
         Log log = new Log();
         log.EscribirLog(ex);
         litCatchError.Visible = true;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('0');", true);
     }
 }
Example #4
0
 protected void Cargar()
 {
     try
     {
         BFESCALA objBFES = new BFESCALA();
         objWEB.LlenaGrilla(ref grdResultados, objBFES.GetESCALAAll(objSession.RutEmpresa).Cast <DomainObject>().ToList(), 20);
     }
     catch (Exception ex)
     {
         Log log = new Log();
         log.EscribirLog(ex);
         litCatchError.Visible = true;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('0');", true);
     }
 }
        protected void Cargar()
        {
            try
            {
                BFINSTRUMENTOEMPLEADO objBFIE = new BFINSTRUMENTOEMPLEADO();
                EINSTRUMENTOEMPLEADO  objIE   = objBFIE.GetINSTRUMENTOEMPLEADO(Utiles.ConvertToInt64(ViewState["CodInstrumentoEmpleado"]));
                ViewState["Instrumento"] = objIE;


                BFEMPLEADO objBFEM = new BFEMPLEADO();
                EEMPLEADO  objEM   = objBFEM.GetEMPLEADO(objIE.RUTEMPLEADO);
                this.txtRut.Text           = objEM.RUTCOMPLETO;
                this.txtNombreUsuario.Text = objEM.NOMBRECOMPLETO;
                BFGERENCIA objBFGE = new BFGERENCIA();
                this.txtGerencia.Text  = objEM.NOMBRE_GERENCIA;
                this.txtCargo.Text     = objEM.NOMBRE_CARGO;
                this.txtResultado.Text = Utiles.ConvertToString(objIE.RESULTADO);

                lblNombreFormulario.Text = objIE.NOMINSTRUMENTOEMPLEADO;
                if (objIE.RESULTADO > 0)
                {
                    lblNombreFormulario.Text = lblNombreFormulario.Text + " - " + Utiles.ConvertToString(objIE.RESULTADO);
                }
                lblDescripcion.Text = objIE.DESCRIPCION;
                lblObservacion.Text = objIE.OBSERVACION;
                objWEB.LlenaGrilla(ref this.grdSecciones, objIE.SECCIONES.Cast <DomainObject>().ToList(), 100);
                BFINSTRUMENTO objBFIN = new BFINSTRUMENTO();
                EINSTRUMENTO  objIN   = objBFIN.GetINSTRUMENTO(Utiles.ConvertToInt64(objIE.CODINSTRUMENTO));
                BFESCALA      objBFES = new BFESCALA();
                EESCALA       objES   = objBFES.GetESCALA(Utiles.ConvertToInt64(objIN.CODESCALA));

                switch (Utiles.ConvertToString(objIE.CODESTADOEVAL))
                {
                case "1":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = true;
                    break;

                case "2":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = false;
                    break;

                case "3":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = false;
                    break;

                case "4":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = false;
                    break;

                case "5":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = false;
                    break;

                case "6":
                    btnVolver.Visible  = true;
                    btnGuardar.Visible = false;
                    break;
                }
            }
            catch (Exception ex)
            {
                Log log = new Log();
                log.EscribirLog(ex);
                litCatchError.Visible = true;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('0');", true);
            }
        }