public ActionResult DistributorDetail(int Id = -1, string selectedTab = "") { if (Id == -1) { NotifyUser(message: "Seleccione primero el distribuidor a consultar haciendo click en su Id", messageDebug: controllerTraceId + "EmployeeDetail.111: no Id was received"); return(RedirectToAction("Index")); } bool vf = false; string result = string.Empty; Distributor auxDistributor = null; try { auxDistributor = controller.RetrieveDistributor(Id); result = ""; vf = true; } catch (Exception ex) { NotifyUser(messageError: errorDefault, messageDebug: controllerTraceId + "EmployeeDetail.311: Error while retrieving item '" + Id + "' from DB. Exception:", ex: ex); } if (vf) { if (auxDistributor == null) { vf = false; NotifyUser(messageError: "No se encontro el distribuidor", messageDebug: controllerTraceId + "EmployeeDetail.511: Error while retrieving item '" + Id + "', item id not found in DB"); } } //ViewBag.SelectedTab = selectedTab; return(View(auxDistributor)); }
public ActionResult Create(int Id = -1) { //sys validations if (Id == -1) { NotifyUser(errorDefault, controllerTraceId + "Create.111 No se recibió el parámetro id del Distribuidor"); return(RedirectToAction("Index")); } ContractDistributor item = ContractDistributor.NewEmpty(); PSD.Controller.DistributorController distributorController = new Controller.DistributorController(Configurations); item.Distributor = distributorController.RetrieveDistributor(Id); item.DistributorId = Id; item.RegisteredZoneName = item.Distributor.Address.AddressColony.AddressPostalCode.AddressMunicipality.Zone.Name; item.RegisteredRegionName = item.Distributor.Address.AddressColony.AddressPostalCode.AddressMunicipality.Zone.RegionName; return(View(item)); }