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);
            }
        }
        public override void Fill(DomainObject obj, IDataReader dr)
        {
            ETIPOSECCION objTIPOSECCION = obj as ETIPOSECCION;

            //Poner las rutinas del Tools que se necesiten

            objTIPOSECCION.CODTIPOSECCION = Utiles.ConvertToInt16(dr["COD_TIPO_SECCION"]);

            objTIPOSECCION.NOMBRETIPOSECCION = Utiles.ConvertToString(dr["NOMBRE_TIPO_SECCION"]);
        }
        protected override IDbDataParameter[] GetDeleteParameters(DomainObject obj, DB db)
        {
            IDbDataParameter[] prms           = db.GetArrayParameter(1);
            ETIPOSECCION       objTIPOSECCION = obj as ETIPOSECCION;

            prms[0]               = db.GetParameter();
            prms[0].Value         = objTIPOSECCION.CODTIPOSECCION;
            prms[0].ParameterName = "@COD_TIPO_SECCION";

            return(prms);
        }
Example #4
0
 public bool Update(ETIPOSECCION objTIPOSECCION)
 {
     try
     {
         _objDAL.Update(objTIPOSECCION);
         return(true);
     }
     catch (Exception ex)
     {
         Log log = new Log();
         log.EscribirLog(ex);
         return(false);
     }
 }
        protected override IDbDataParameter[] GetUpdateParameters(DomainObject obj, DB db)
        {
            IDbDataParameter[] prms           = db.GetArrayParameter(2);
            ETIPOSECCION       objTIPOSECCION = obj as ETIPOSECCION;

            //Poner las rutinas del Tools que se necesiten

            prms[0]               = db.GetParameter();
            prms[0].Value         = objTIPOSECCION.CODTIPOSECCION;
            prms[0].ParameterName = "@COD_TIPO_SECCION";

            prms[1]               = db.GetParameter();
            prms[1].Value         = objTIPOSECCION.NOMBRETIPOSECCION;
            prms[1].ParameterName = "@NOMBRE_TIPO_SECCION";

            return(prms);
        }
Example #6
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);
     }
 }
Example #7
0
        public bool Save(ETIPOSECCION objTIPOSECCION)
        {
            try
            {
                if (GetTIPOSECCION(objTIPOSECCION.CODTIPOSECCION).CODTIPOSECCION == objTIPOSECCION.CODTIPOSECCION)
                {
                    objTIPOSECCION.IsPersisted = true;
                }
                else
                {
                    objTIPOSECCION.CODTIPOSECCION = Serial();
                    objTIPOSECCION.IsPersisted    = false;
                }

                objTIPOSECCION.Save();
                return(true);
            }
            catch (Exception ex)
            {
                Log log = new Log();
                log.EscribirLog(ex);
                return(false);
            }
        }
        protected override void SetPrimaryKey(DomainObject obj, long id)
        {
            ETIPOSECCION objRoot = obj as ETIPOSECCION;

            objRoot.CODTIPOSECCION = Utiles.ConvertToInt16(id);
        }