public ActionResult Modificar(int IdEmpresa = 0, int IdSucursal = 0, decimal IdOrdenCompra = 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 com_ordencompra_local_Info model = bus_ordencompra.get_info(IdEmpresa, IdSucursal, IdOrdenCompra); if (model == null) { return(RedirectToAction("Index")); } model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); model.lst_det = bus_det.get_list(IdEmpresa, IdSucursal, IdOrdenCompra); List_det.set_list(model.lst_det, model.IdTransaccionSession); cargar_combos(IdEmpresa); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } return(View(model)); }
public ActionResult Consultar(int IdEmpresa = 0, int IdSucursal = 0, decimal IdOrdenCompra = 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 com_ordencompra_local_Info model = bus_ordencompra.get_info(IdEmpresa, IdSucursal, IdOrdenCompra); 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, "Compras", "OrdenServicio", "Index"); if (model.Estado == "I") { info.Modificar = false; info.Anular = false; } else { //if (model.Estado=="A" && model.IdEstadoAprobacion_cat== "xAPRO") //{ //} if (model.Estado == "A" && model.IdEstadoAprobacion_cat == "APRO") { info.Modificar = 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.IdTransaccionSessionActual); model.lst_det = bus_det.get_list(IdEmpresa, IdSucursal, IdOrdenCompra); List_det.set_list(model.lst_det, model.IdTransaccionSession); cargar_combos(IdEmpresa); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } return(View(model)); }