public ActionResult _DeleteBasketAccountStock(int id) { var ru = GetRentalBasket().RentedUnits.Single(c => c.UnitId == id); var prompt = new PromptVM(id, new DialogPrompt(string.Format("Remove model {0} from selection?", ru.Stock.ManufacturerModel))); return(PartialView("_PromptDialog", prompt)); }
public virtual ActionResult _DeletePurchaseUnit(int id) { var ru = _purchaseUnitAndContracts.GetPurchaseUnit(id); var prompt = new PromptVM(id, new DialogPrompt(string.Format("Remove model {0} from selection?", ru.Stock.ManufacturerModel))); return(PartialView("_PromptDialog", prompt)); }
public ActionResult _DeleteItemCharge(int id) { var itemCharge = GetBasket().OneOffItems.Single(c => c.OneOffItemId == id); var promptVm = new PromptVM(id, new DialogPrompt("Do you wish to remove Item Charge '" + itemCharge.Description, PromptMessageAlertLevel.Warning)); return(PartialView("_PromptDialog", promptVm)); }
public ActionResult _DeleteModel(PromptVM promptVm) { if (ModelState.IsValid) { var mdl = _svc.GetModel(promptVm.RecordIndex); if (_svc.GetStocks().Any(m => m.ModelId == mdl.ModelId)) { mdl.IsObsolete = true; if (ExecuteRepositoryAction(() => { _svc.UpdateModel(mdl); _svc.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } if (ExecuteRepositoryAction(() => { _svc.DeleteModel(mdl); _svc.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } return(PartialView("_PromptDialog", promptVm)); }
public ActionResult _DeleteTempAccountStock(PromptVM mPromptVm) { var ru = TempAccountAsAddRentAccountVM().RentedUnits.Single(c => c.UnitId == mPromptVm.RecordIndex); TempAccountAsAddRentAccountVM().RentedUnits.Remove(ru); return(ReturnJsonFormSuccess()); }
public ActionResult _DeleteAlternateAddress(PromptVM mPromptVM) { var acc = TempAccount; acc.AlternateAddress = new Address(); acc.AlternateAddressInstructions = null; return(ReturnJsonFormSuccess()); }
public ActionResult DeleteBasketForAccount(PromptVM mPromptVM) { var basket = _accountService.GetBasket(mPromptVM.RecordIndex); _accountService.DeleteBasket(basket, true); _accountService.CommitChanges(); return(ReturnJsonFormSuccess()); }
public ActionResult _DeleteModelSpecificContract(int id) { var contract = _svc.GetModelSpecificContract(id); var promptVM = new PromptVM(id, new DialogPrompt(string.Format("Remove Contract : {0}?", contract.ContractType.Description), PromptMessageAlertLevel.Warning)); return(PartialView("_PromptDialog", promptVM)); }
public virtual ActionResult _DeletePurchaseUnitContract(int id) { var contract = _purchaseUnitAndContracts.GetPurchaseUnitContract(id); var promptVm = new PromptVM { RecordIndex = id }; promptVm.AddPrompt(new DialogPrompt("Do you wish to remove contract '" + contract.ContractType.Description + "' from this unit", PromptMessageAlertLevel.Warning)); return(PartialView("_PromptDialog", promptVm)); }
public ActionResult _DeleteBasketAccountStock(PromptVM mPromptVm) { var rentalBasket = GetRentalBasket(); var ru = rentalBasket.RentedUnits.Single(c => c.UnitId == mPromptVm.RecordIndex); ru.Stock.ProductLifeCycleId = (int)ProductLifeCycleStatus.InStock; rentalBasket.RentedUnits.Remove(ru); UpdateBasket(rentalBasket); return(ReturnJsonFormSuccess()); }
public ActionResult _DeleteModelSpecificContract(PromptVM promptVm) { if (ModelState.IsValid) { if (ExecuteRepositoryAction(() => { _svc.DeleteModelSpecificContract((int)promptVm.RecordIndex); _svc.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } return(PartialView("_PromptDialog", promptVm)); }
public ActionResult DeleteBasketForAccount(int customerAccountId) { var promptVm = new PromptVM { RecordIndex = _accountService.GetBaskets().Single(c => c.CustomerAccountId == customerAccountId).BasketId }; promptVm.AddPrompt( new DialogPrompt("Do you wish to remove the current basket?", PromptMessageAlertLevel.Warning)); return(PartialView("_PromptDialog", promptVm)); }
public ActionResult DeleteCancelInvoice(PromptVM promptVm) { var stkInv = _stockInvSvc.GetInvoice(promptVm.RecordIndex); if (ExecuteRepositoryAction(() => { if (stkInv.Items.Count > 0) { _stockInvSvc.CancelInvoice(stkInv); } else { _stockInvSvc.DeleteInvoice(stkInv); } _stockInvSvc.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } return(PartialView("_PromptDialog", promptVm)); }
public ActionResult DeleteCancelInvoice(int id) { var promptVm = new PromptVM { RecordIndex = id }; var stockInvoice = _stockInvSvc.GetInvoice(id); if (stockInvoice.DateProcessed != null) { promptVm.AddPrompt(new DialogPrompt("This Invoice is Processed or Cancelled and no further action is allowed!", PromptMessageAlertLevel.Info)); promptVm.Buttons = PromptVM.DialogButtons.Cancel; } else if (stockInvoice.Items.Count > 0) { promptVm.AddPrompt(new DialogPrompt("Invoice has active stock entries and can only be cancelled!", PromptMessageAlertLevel.Danger)); promptVm.AddPrompt(new DialogPrompt("Do you wish to Cancel?", PromptMessageAlertLevel.Warning)); } else { promptVm.AddPrompt(new DialogPrompt("Do you wish to delete Invoice with reference: " + stockInvoice.InvoiceRef + " ?", PromptMessageAlertLevel.Warning)); } return(PartialView("_PromptDialog", promptVm)); }
public ActionResult _DeleteModel(int id) { var mdl = _svc.GetModel(id); var vm = new DeleteModelVM { ModelId = id, MakeObsolete = false }; var promptVm = new PromptVM { RecordIndex = id }; if (_svc.GetStocks().Any(m => m.ModelId == id)) { promptVm.AddPrompt(new DialogPrompt(string.Format( "Model {0} has a stock history and cannot be deleted.", mdl.ModelCode), PromptMessageAlertLevel.Danger)); promptVm.AddPrompt(new DialogPrompt("Do you wish to mark as obsolete?", PromptMessageAlertLevel.Warning)); } else { promptVm.AddPrompt(new DialogPrompt("Do you wish to delete model " + mdl.ModelCode + " ?", PromptMessageAlertLevel.Warning)); } return(PartialView("_PromptDialog", promptVm)); }
public ActionResult _DeleteItemCharge(PromptVM promptVm) { GetBasket().OneOffItems.RemoveAll(c => c.OneOffItemId == promptVm.RecordIndex); return(ReturnJsonFormSuccess()); }
public ActionResult _DeletePurchaseUnitContract(PromptVM mPromptVm) { _purchaseUnitAndContracts.DeletePurchaseUnitContract(mPromptVm.RecordIndex); return(ReturnJsonFormSuccess()); }
public ActionResult _DeleteAlternateAddress() { var prompt = new PromptVM(0, new DialogPrompt("Delete Alternate Address & Instructions")); return(PartialView("_PromptDialog", prompt)); }