public ActionResult Consultar(int IdEmpresa = 0, decimal IdDepreciacion = 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 Af_Depreciacion_Info model = bus_depreciacion.get_info(IdEmpresa, IdDepreciacion); 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, "ActivoFijo", "DepreciacionAF", "Index"); if (model.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.lst_detalle = bus_depreciacion_det.get_list(IdEmpresa, IdDepreciacion); model.lst_detalle_ct = bus_comprobante_detalle.get_list(IdEmpresa, Convert.ToInt32(model.IdTipoCbte), Convert.ToInt32(model.IdCbteCble)); model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); lst_depreciacion_det.set_list(model.lst_detalle, model.IdTransaccionSession); lst_comprobante_detalle.set_list(model.lst_detalle_ct, model.IdTransaccionSession); cargar_combos(IdEmpresa); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } return(View(model)); }
public ActionResult Modificar(int IdEmpresa = 0, decimal IdDepreciacion = 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 Af_Depreciacion_Info model = bus_depreciacion.get_info(IdEmpresa, IdDepreciacion); if (model == null) { return(RedirectToAction("Index")); } model.lst_detalle = bus_depreciacion_det.get_list(IdEmpresa, IdDepreciacion); model.lst_detalle_ct = bus_comprobante_detalle.get_list(IdEmpresa, Convert.ToInt32(model.IdTipoCbte), Convert.ToInt32(model.IdCbteCble)); model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); lst_depreciacion_det.set_list(model.lst_detalle, model.IdTransaccionSession); lst_comprobante_detalle.set_list(model.lst_detalle_ct, model.IdTransaccionSession); cargar_combos(IdEmpresa); return(View(model)); }