Example #1
0
        protected void btnContinuarGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                BFTIPOSECCION objBFTS = new BFTIPOSECCION();
                ETIPOSECCION  objTS   = objBFTS.GetTIPOSECCION(Utiles.ConvertToInt64(ViewState["Codigo"]));

                if ((objBFTS.PoseeDatosRelacionados(objTS.CODTIPOSECCION)))
                {
                    this.litErrorDatosRelacionados.Visible = true;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('3');", true);
                }
                else
                {
                    objBFTS.Delete(objTS);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "modal", "Menu('4');", true);
                }
                Cargar();
            }
            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 Cargar()
 {
     try
     {
         BFTIPOSECCION objBFTS = new BFTIPOSECCION();
         objWEB.LlenaGrilla(ref grdResultados, objBFTS.GetTIPOSECCIONAll().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 grdSecciones_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             DropDownList  ddl   = ((DropDownList)e.Row.FindControl("ddlTipoSeccion"));
             BFTIPOSECCION objTS = new BFTIPOSECCION();
             objWEB.LlenaDDL(ref ddl, objTS.GetTIPOSECCIONAll().Cast <DomainObject>().ToList(), "CODTIPOSECCION", "NOMBRETIPOSECCION");
         }
     }
     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 btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         BFTIPOSECCION objBFTS = new BFTIPOSECCION();
         ETIPOSECCION  objTS   = new ETIPOSECCION();
         objTS.CODTIPOSECCION    = Utiles.ConvertToInt16(this.txtCodTipoSeccion.Text);
         objTS.NOMBRETIPOSECCION = Utiles.ConvertToString(this.txtNombre.Text);
         objBFTS.Save(objTS);
         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);
     }
 }