public static string GetHasTransactionClass(this Permitees item) { if (item == null) { return("bg-gray disable-link"); } if (item.Transactions.Any()) { return("bg-aqua"); } return("bg-gray disable-link"); }
public static string PermiteeeClass(this Permitees Permitees, PermiteeMode mode) { if (Permitees == null) { return("bg-aqua"); } if (!Permitees.Transactions.Any() && mode == PermiteeMode.Register) { return("bg-aqua"); } if (Permitees.Transactions.Any() && mode == PermiteeMode.Renew) { return("bg-aqua"); } return(""); }
public ActionResult VehicleMasterListPartial([ModelBinder(typeof(DevExpressEditorsBinder))] int?permitteeId) { var model = new Permitees(); XtraReport xtraReport = new XtraReport(); if (permitteeId != null) { model = unitOfWork.PermiteesRepo.Find(m => m.Id == permitteeId, includeProperties: "Vehicles"); xtraReport = new VehicleMasterListReport() { DataSource = new List <Permitees>() { model } }; } return(PartialView(xtraReport)); }
public ActionResult PermiteeGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Permitees item) { //var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model unitOfWork.PermiteesRepo.Update(item); unitOfWork.Save(); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } var model = unitOfWork.PermiteesRepo.Get(); return(PartialView("_PermiteeGridViewPartial", model)); }