Пример #1
0
        public ActionResult Edit(VehicleFuelList model)
        {
            SetActiveMenuItem();
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            try
            {
                //Set our updater name
                var FullName = Request.Cookies["userInfo"]["FullName"];

                //Now update the record
                FuelTypeBLL.UpdateFuelType(model, FullName);

                //Take our ID with us to the confirmation form
                ViewBag.Id = model.Id;

                //Determine the kind of SQL transaction we have performed
                ViewBag.Message = "updated";

                //We can now safely go to the confirmation view
                return(View("AddUpdateConfirm"));
            }
            catch (Exception ex)
            {
                TempData["ErrorMessage"] = ex.Message;
                return(Redirect("~/Admin/Home/Error"));
            }
        }
Пример #2
0
        public static VehicleFuelList GetFuelType(int FuelID)
        {
            var model = new VehicleFuelList();
            var dt    = FuelTypeDAL.GetFuelType(FuelID);
            var dr    = dt.Rows[0];

            model.Id      = (int)dr["FuelID"];
            model.Display = dr["FuelType"].ToString();
            return(model);
        }
Пример #3
0
 public static void AddFuelType(VehicleFuelList model, string UpdatedBy, out int returnValue)
 {
     FuelTypeDAL.AddFuelType(model.Display, UpdatedBy, out returnValue);
 }
Пример #4
0
 public static void UpdateFuelType(VehicleFuelList model, string UpdatedBy)
 {
     FuelTypeDAL.UpdateFuelType(model.Id, model.Display, UpdatedBy);
 }