Esempio n. 1
0
        void tipoInteres()
        {
            TipoInteres ti = new TipoInteres();

            ti.Activo = 1;
            ddlTipoInteres.DataSource     = dal.getBuscarTipoIntereses(ti);
            ddlTipoInteres.DataTextField  = "nomTipoInteres";
            ddlTipoInteres.DataValueField = "idTipoInteres";
            ddlTipoInteres.DataBind();
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoInteres tipoInteres = await db.TiposDeInteres.FindAsync(id);

            if (tipoInteres == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoInteres));
        }
Esempio n. 3
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            string accion  = "Eliminando";
            bool   guardo  = false;
            string mensaje = "Eliminado";

            try
            {
                TipoInteres emp = await db.TiposDeInteres.FindAsync(id);

                db.TiposDeInteres.Remove(emp);
                guardo = await db.SaveChangesAsync() > 0;
            }
            catch (Exception ex)
            {
                mensaje = string.IsNullOrEmpty(ex.InnerException.Message) ? ex.Message : ex.InnerException.Message;
            }
            return(Json(new { success = guardo, mensaje, accion }));
        }
Esempio n. 4
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,DescripcionTipo,MontoInteres")] TipoInteres tipoInteres)
        {
            string accion  = "Actualizando";
            bool   guardo  = false;
            string mensaje = "Actualizado";

            try
            {
                if (ModelState.IsValid)
                {
                    db.Entry(tipoInteres).State = EntityState.Modified;
                    guardo = await db.SaveChangesAsync() > 0;
                }
                mensaje = "No se ha actualizado el registro";
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            return(Json(new { success = guardo, mensaje, accion }));
        }
Esempio n. 5
0
        public async Task <ActionResult> Create([Bind(Include = "Id,DescripcionTipo,MontoInteres")] TipoInteres tipoInteres)
        {
            string accion  = "Guardando";
            bool   guardo  = false;
            string mensaje = "Guardado";

            try
            {
                if (ModelState.IsValid)
                {
                    db.TiposDeInteres.Add(tipoInteres);
                    guardo = await db.SaveChangesAsync() > 0;
                }
                mensaje = "No se ha guardado el registro";
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            return(Json(new { success = guardo, mensaje, accion }));
        }