// GET: /View public ActionResult View(int id) { ClientDetailESCInformation clientDetailESCInformation = new ClientDetailESCInformation(); clientDetailESCInformation = clientDetailESCInformationRepository.GetClientDetailESCInformation(id); //Check Exists if (clientDetailESCInformation == null) { ViewData["ActionMethod"] = "ViewGet"; return(View("RecordDoesNotExistError")); } int clientDetailId = clientDetailESCInformation.ClientDetailId; ClientDetailClientSubUnit clientDetailClientSubUnit = new ClientDetailClientSubUnit(); clientDetailClientSubUnit = clientDetailClientSubUnitRepository.GetClientDetailClientSubUnit(clientDetailId); //Check Exists if (clientDetailClientSubUnit == null) { ViewData["ActionMethod"] = "ViewGet"; return(View("RecordDoesNotExistError")); } string clientSubUnitGuid = clientDetailClientSubUnit.ClientSubUnitGuid; ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(clientSubUnitGuid); ClientSubUnitESCInformationVM clientSubUnitESCInformationVM = new ClientSubUnitESCInformationVM(); clientSubUnitESCInformationVM.ClientSubUnit = clientSubUnit; ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(clientDetailId); clientSubUnitESCInformationVM.ClientDetail = clientDetail; clientSubUnitESCInformationVM.ClientDetailESCInformation = clientDetailESCInformation; return(View(clientSubUnitESCInformationVM)); }
public ActionResult Delete(int id, FormCollection collection) { ClientDetailESCInformation clientDetailESCInformation = new ClientDetailESCInformation(); clientDetailESCInformation = clientDetailESCInformationRepository.GetClientDetailESCInformation(id); //Check Exists if (clientDetailESCInformation == null) { ViewData["ActionMethod"] = "DeletePost"; return(View("RecordDoesNotExistError")); } int clientDetailId = clientDetailESCInformation.ClientDetailId; ClientDetailClientSubUnitTravelerType clientDetailClientSubUnitTravelerType = new ClientDetailClientSubUnitTravelerType(); clientDetailClientSubUnitTravelerType = clientDetailClientSubUnitTravelerTypeRepository.GetClientDetailClientSubUnitTravelerType(clientDetailId); //Check Exists if (clientDetailClientSubUnitTravelerType == null) { ViewData["ActionMethod"] = "DeletePost"; return(View("RecordDoesNotExistError")); } string csu = clientDetailClientSubUnitTravelerType.ClientSubUnitGuid; string tt = clientDetailClientSubUnitTravelerType.TravelerTypeGuid; ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); //Access Rights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToClientSubUnit(csu)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Delete Item try { clientDetailESCInformation.VersionNumber = Int32.Parse(collection["ClientDetailESCInformation.VersionNumber"]); clientDetailESCInformationRepository.Delete(clientDetailESCInformation); } catch (SqlException ex) { //Versioning Error - go to standard versionError page if (ex.Message == "SQLVersioningError") { ViewData["ReturnURL"] = "/ClientSubUnitTravelerTypeESCInformation.mvc/Delete/" + id.ToString(); return(View("VersionError")); } //Generic Error ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details"; return(View("Error")); } return(RedirectToAction("List", new { id = clientDetailId })); }
// GET: /Edit public ActionResult Edit(int id) { ClientDetailESCInformation clientDetailESCInformation = new ClientDetailESCInformation(); clientDetailESCInformation = clientDetailESCInformationRepository.GetClientDetailESCInformation(id); //Check Exists if (clientDetailESCInformation == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } int clientDetailId = clientDetailESCInformation.ClientDetailId; ClientDetailClientSubUnitTravelerType clientDetailClientSubUnitTravelerType = new ClientDetailClientSubUnitTravelerType(); clientDetailClientSubUnitTravelerType = clientDetailClientSubUnitTravelerTypeRepository.GetClientDetailClientSubUnitTravelerType(clientDetailId); //Check Exists if (clientDetailClientSubUnitTravelerType == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } string csu = clientDetailClientSubUnitTravelerType.ClientSubUnitGuid; string tt = clientDetailClientSubUnitTravelerType.TravelerTypeGuid; ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); //Access Rights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToClientSubUnit(csu)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientSubUnitTravelerTypeESCInformationVM clientSubUnitTravelerTypeESCInformationVM = new ClientSubUnitTravelerTypeESCInformationVM(); clientSubUnitTravelerTypeESCInformationVM.ClientSubUnit = clientSubUnit; ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); //Check Exists if (clientDetail == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } clientSubUnitTravelerTypeESCInformationVM.ClientDetail = clientDetail; TravelerType travelerType = new TravelerType(); travelerType = travelerTypeRepository.GetTravelerType(tt); clientSubUnitTravelerTypeESCInformationVM.TravelerType = travelerType; clientSubUnitTravelerTypeESCInformationVM.ClientDetailESCInformation = clientDetailESCInformation; return(View(clientSubUnitTravelerTypeESCInformationVM)); }
public ClientSubUnitESCInformationVM(ClientSubUnit clientSubUnit, ClientDetail clientDetail, ClientDetailESCInformation clientDetailESCInformation) { ClientSubUnit = clientSubUnit; ClientDetail = clientDetail; ClientDetailESCInformation = clientDetailESCInformation; }
public ClientAccountESCInformationVM(ClientAccount clientAccount, ClientDetail clientDetail, ClientDetailESCInformation clientDetailESCInformation) { ClientAccount = clientAccount; ClientDetail = clientDetail; ClientDetailESCInformation = clientDetailESCInformation; }
// GET: /Edit public ActionResult Edit(int id) { ClientDetailESCInformation clientDetailESCInformation = new ClientDetailESCInformation(); clientDetailESCInformation = clientDetailESCInformationRepository.GetClientDetailESCInformation(id); //Check Exists if (clientDetailESCInformation == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } int clientDetailId = clientDetailESCInformation.ClientDetailId; ClientDetailClientAccount clientDetailClientAccount = new ClientDetailClientAccount(); clientDetailClientAccount = clientDetailClientAccountRepository.GetClientDetailClientAccount(id); //Check Exists if (clientDetailClientAccount == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } string can = clientDetailClientAccount.ClientAccountNumber; string ssc = clientDetailClientAccount.SourceSystemCode; ClientAccount clientAccount = new ClientAccount(); clientAccount = clientAccountRepository.GetClientAccount(can, ssc); //Check Exists if (clientAccount == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Access Rights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToClientAccount(can, ssc)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientAccountESCInformationVM clientAccountESCInformationVM = new ClientAccountESCInformationVM(); clientAccountESCInformationVM.ClientAccount = clientAccount; clientAccountESCInformationVM.ClientDetailESCInformation = clientDetailESCInformation; ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(clientDetailId); clientAccountESCInformationVM.ClientDetail = clientDetail; return(View(clientAccountESCInformationVM)); }
public TravelerTypeESCInformationVM(ClientSubUnit clientSubUnit, TravelerType travelerType, ClientDetail clientDetail, ClientDetailESCInformation clientDetailESCInformation) { ClientSubUnit = clientSubUnit; TravelerType = travelerType; ClientDetail = clientDetail; ClientDetailESCInformation = clientDetailESCInformation; }