// GET: Edit A Single ClientFee public ActionResult Edit(int id) { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientFee clientFee = new ClientFee(); clientFee = clientFeeRepository.GetItem(id); //Check Exists if (clientFee == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Change DisplayText for Transaction Fees FeeType feeType = new FeeType(); feeType = clientFee.FeeType; if (feeType.FeeTypeDescription == "Client Fee") { feeType.FeeTypeDescription = "Transaction Fee"; } ClientFeeVM clientFeeVM = new ClientFeeVM(); clientFeeVM.ClientFee = clientFee; GDSRepository gdsRepository = new GDSRepository(); clientFeeVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", clientFee.GDSCode); ContextRepository contextRepository = new ContextRepository(); clientFeeVM.Contexts = new SelectList(contextRepository.GetAllContexts().ToList(), "ContextId", "ContextName", clientFee.ContextId); //Check for missing GDS if (clientFee.GDS == null) { GDS gds = new GDS(); clientFee.GDS = gds; } ClientFeeOutput clientFeeOutput = new ClientFeeOutput(); if (clientFee.ClientFeeOutputs.Count > 0) { clientFeeOutput = clientFeeOutputRepository.GetItem(clientFee.ClientFeeOutputs[0].ClientFeeOutputId); } clientFeeVM.ClientFeeOutput = clientFeeOutput; return(View(clientFeeVM)); }
public ClientFeeVM( ClientFee clientFee, ClientFeeOutput clientFeeOutput, IEnumerable <SelectListItem> contexts, IEnumerable <SelectListItem> feeTypes ) { ClientFee = clientFee; ClientFeeOutput = clientFeeOutput; Contexts = contexts; FeeTypes = feeTypes; }
// GET: View A Single ClientFee public ActionResult View(int id) { ClientFee clientFee = new ClientFee(); clientFee = clientFeeRepository.GetItem(id); //Check Exists if (clientFee == null) { ViewData["ActionMethod"] = "ViewGet"; return(View("RecordDoesNotExistError")); } //Check for missing GDS if (clientFee.GDS == null) { GDS gds = new GDS(); clientFee.GDS = gds; } //Change DisplayText for Transaction Fees FeeType feeType = new FeeType(); feeType = clientFee.FeeType; if (feeType.FeeTypeDescription == "Client Fee") { feeType.FeeTypeDescription = "Transaction Fee"; } ClientFeeVM clientFeeVM = new ClientFeeVM(); clientFeeVM.ClientFee = clientFee; ClientFeeOutput clientFeeOutput = new ClientFeeOutput(); if (clientFee.ClientFeeOutputs.Count > 0) { clientFeeOutput = clientFeeOutputRepository.GetItem(clientFee.ClientFeeOutputs[0].ClientFeeOutputId); } clientFeeVM.ClientFeeOutput = clientFeeOutput; return(View(clientFeeVM)); }
public ActionResult Delete(int id) { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientFee clientFee = new ClientFee(); clientFee = clientFeeRepository.GetItem(id); //Check Exists if (clientFee == null) { ViewData["ActionMethod"] = "ViewGet"; return(View("RecordDoesNotExistError")); } //Check for missing GDS if (clientFee.GDS == null) { GDS gds = new GDS(); clientFee.GDS = gds; } ClientFeeVM clientFeeVM = new ClientFeeVM(); clientFeeVM.ClientFee = clientFee; ClientFeeOutput clientFeeOutput = new ClientFeeOutput(); if (clientFee.ClientFeeOutputs.Count > 0) { clientFeeOutput = clientFeeOutputRepository.GetItem(clientFee.ClientFeeOutputs[0].ClientFeeOutputId); } clientFeeVM.ClientFeeOutput = clientFeeOutput; return(View(clientFeeVM)); }