示例#1
0
        // GET: TruckExpense
        public ActionResult Index(TruckExpenseSearchModel truckExpenseSearchModel)
        {
            using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo))
            {
                truckExpenseBAL.PrepareTruckExpenseSearchModel(truckExpenseSearchModel);
            }

            return(View(truckExpenseSearchModel));
        }
示例#2
0
        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));
        }
示例#3
0
        public ActionResult Delete(string id)
        {
            TruckExpenseModel truckExpenseModel = new TruckExpenseModel();

            truckExpenseModel.Id = id;

            using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo))
            {
                truckExpenseBAL.GetTruckExpenseModel(truckExpenseModel);
            }

            return(View(truckExpenseModel));
        }
示例#4
0
        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));
        }
示例#5
0
        public ActionResult Delete(TruckExpenseModel truckExpenseModel)
        {
            using (TruckExpenseBAL truckExpenseBAL = new TruckExpenseBAL(ContextInfo))
            {
                truckExpenseBAL.Delete(truckExpenseModel);

                if (truckExpenseModel.HasErrorByType())
                {
                    truckExpenseBAL.GetTruckExpenseModel(truckExpenseModel);
                }
            }

            return(View(truckExpenseModel));
        }
示例#6
0
        // 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));
        }
示例#7
0
        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));
        }