// GET: TruckExpense public ActionResult Index(TruckExpenseSearchModel truckExpenseSearchModel) { using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { truckExpenseBAL.PrepareTruckExpenseSearchModel(truckExpenseSearchModel); } return(View(truckExpenseSearchModel)); }
public ActionResult Create(BaseModel baseModel) { TruckExpenseModel truckExpenseModel = new TruckExpenseModel(); truckExpenseModel.CopyBaseModel(baseModel); using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { truckExpenseBAL.PrepareTruckExpenseModel(truckExpenseModel); } return(View("Create", truckExpenseModel)); }
public ActionResult Delete(string id) { TruckExpenseModel truckExpenseModel = new TruckExpenseModel(); truckExpenseModel.Id = id; using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { truckExpenseBAL.GetTruckExpenseModel(truckExpenseModel); } return(View(truckExpenseModel)); }
public JsonResult GetTruckExpenses(DataTableSearchParameters <TruckExpenseSearchModel> dataTableSearchParameters) { GenericListModel <TruckExpenseModel> baseListModel = new GenericListModel <TruckExpenseModel>(); using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { baseListModel = truckExpenseBAL.GetSearchTruckExpensessList(dataTableSearchParameters); } return(Json(new { baseModel = baseListModel }, JsonRequestBehavior.AllowGet)); }
public ActionResult Delete(TruckExpenseModel truckExpenseModel) { using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { truckExpenseBAL.Delete(truckExpenseModel); if (truckExpenseModel.HasErrorByType()) { truckExpenseBAL.GetTruckExpenseModel(truckExpenseModel); } } return(View(truckExpenseModel)); }
// GET: TruckExpense/Edit/5 public ActionResult Edit(string id, BaseModel baseModel) { TruckExpenseModel truckExpenseModel = new TruckExpenseModel(); truckExpenseModel.CopyBaseModel(baseModel); truckExpenseModel.Id = id; using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { truckExpenseBAL.GetTruckExpenseModel(truckExpenseModel); truckExpenseBAL.PrepareTruckExpenseModel(truckExpenseModel); } return(View(truckExpenseModel)); }
public ActionResult Create(TruckExpenseModel truckExpenseModel) { ModelState.Clear <TruckExpenseModel>(x => x.TruckModel); using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo)) { if (ModelState.IsValid) { truckExpenseBAL.Create(truckExpenseModel); } if (truckExpenseModel.HasErrorByType(LMYFrameWorkMVC.Common.LookUps.ErrorType.Critical) || truckExpenseModel.HasSuccess(LMYFrameWorkMVC.Common.LookUps.SuccessType.Full)) { return(base.RedirectToActionWithData(new Dictionary <string, object> { { "baseModel", truckExpenseModel } })); } truckExpenseBAL.PrepareTruckExpenseModel(truckExpenseModel); } return(View("Create", truckExpenseModel)); }