public ActionResult Modificar(int IdEmpresa = 0, int IdRetencion = 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 cargar_combos(IdEmpresa); cargar_combos_detalle(); IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa); Session["info_param_op"] = bus_parametros.get_info(IdEmpresa); cp_retencion_Info model = new cp_retencion_Info(); model = bus_retencion.get_info(IdEmpresa, IdRetencion); model.IdSucursal = model.info_comprobante.IdSucursal; model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession); List_ct_cbtecble_det_List.set_list(model.info_comprobante.lst_ct_cbtecble_det, model.IdTransaccionSession); List_cp_retencion_det.set_list(model.detalle, model.IdTransaccionSession); var lista = bus_codigo_ret.get_list_cod_ret(false, IdEmpresa); lst_codigo_retencion.set_list(lista); return(View(model)); }
public ActionResult Consultar(int IdEmpresa = 0, int IdRetencion = 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 IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa); Session["info_param_op"] = bus_parametros.get_info(IdEmpresa); cp_retencion_Info model = new cp_retencion_Info(); model = bus_retencion.get_info(IdEmpresa, IdRetencion); //model.IdSucursal = model.info_comprobante.IdSucursal; model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession); #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "CuentasPorPagar", "Retencion", "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 cargar_combos(model); cargar_combos_detalle(); List_ct_cbtecble_det_List.set_list(model.info_comprobante.lst_ct_cbtecble_det, model.IdTransaccionSession); List_cp_retencion_det.set_list(model.detalle, model.IdTransaccionSession); var lista = bus_codigo_ret.get_list_cod_ret(false, IdEmpresa); lst_codigo_retencion.set_list(lista); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } #region Validacion Periodo ViewBag.MostrarBoton = true; if (!bus_periodo.ValidarFechaTransaccion(IdEmpresa, model.fecha, cl_enumeradores.eModulo.CXP, model.IdSucursal, ref mensaje)) { ViewBag.mensaje = mensaje; ViewBag.MostrarBoton = false; } #endregion return(View(model)); }