public ActionResult Nuevo() { #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "CuentasPorCobrar", "CatalogoTipoCXC", "Index"); if (!info.Nuevo) { return(RedirectToAction("Index")); } #endregion cxc_CatalogoTipo_Info model = new cxc_CatalogoTipo_Info(); return(View(model)); }
public ActionResult Nuevo(cxc_CatalogoTipo_Info model) { if (bus_catalogotipo.validar_existe_IdCatalogotipo(model.IdCatalogo_tipo)) { ViewBag.mensaje = "El código ya se encuentra registrado"; ViewBag.IdCatalogo_tipo = model.IdCatalogo_tipo; return(View(model)); } if (!bus_catalogotipo.guardarDB(model)) { return(View(model)); } return(RedirectToAction("Consultar", new { IdCatalogo_tipo = model.IdCatalogo_tipo, Exito = true })); }
public ActionResult Modificar(string IdCatalogo_tipo = "") { #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "CuentasPorCobrar", "CatalogoTipoCXC", "Index"); if (!info.Modificar) { return(RedirectToAction("Index")); } #endregion cxc_CatalogoTipo_Info model = bus_catalogotipo.get_info(IdCatalogo_tipo); if (model == null) { return(RedirectToAction("Index")); } return(View(model)); }
public bool guardarDB(cxc_CatalogoTipo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_CatalogoTipo Entity = new cxc_CatalogoTipo { Descripcion = info.Descripcion, IdCatalogo_tipo = info.IdCatalogo_tipo }; Context.cxc_CatalogoTipo.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool modificarDB(cxc_CatalogoTipo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_CatalogoTipo Entity = Context.cxc_CatalogoTipo.FirstOrDefault(q => q.IdCatalogo_tipo == info.IdCatalogo_tipo); if (Entity == null) { return(false); } Entity.Descripcion = info.Descripcion; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public ActionResult Nuevo() { cxc_CatalogoTipo_Info model = new cxc_CatalogoTipo_Info(); return(View(model)); }