public ActionResult Modificar(int IdEmpresa = 0, decimal IdPlantilla = 0) { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion ct_cbtecble_Plantilla_Info model = bus_CbteCble_Plantilla.GetInfo(IdEmpresa, IdPlantilla); if (model == null) { return(RedirectToAction("Index")); } model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession); model.lst_cbtecble_plantilla_det = bus_CbteCblePlantillaDet.GetList(model.IdEmpresa, model.IdPlantilla); CbteCble_PlantillaDet_Lista.set_list(model.lst_cbtecble_plantilla_det, model.IdTransaccionSession); cargar_combos(model.IdEmpresa); return(View(model)); }
public ActionResult Consultar(int IdEmpresa = 0, decimal IdPlantilla = 0, bool Exito = false) { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion ct_cbtecble_Plantilla_Info model = bus_CbteCble_Plantilla.GetInfo(IdEmpresa, IdPlantilla); if (model == null) { return(RedirectToAction("Index")); } #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Contabilidad", "PlantillaComprobanteContable", "Index"); if (model.cb_Estado == "I") { info.Modificar = false; info.Anular = false; } model.Nuevo = (info.Nuevo == true ? 1 : 0); model.Modificar = (info.Modificar == true ? 1 : 0); model.Anular = (info.Anular == true ? 1 : 0); #endregion model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession); model.lst_cbtecble_plantilla_det = bus_CbteCblePlantillaDet.GetList(model.IdEmpresa, model.IdPlantilla); CbteCble_PlantillaDet_Lista.set_list(model.lst_cbtecble_plantilla_det, model.IdTransaccionSession); cargar_combos(model.IdEmpresa); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } return(View(model)); }