public ActionResult Create(FleetAssetMake fleetAssetMake)
        {
            if (ModelState.IsValid)
            {
                db.FleetAssetMakes.Add(fleetAssetMake);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fleetAssetMake));
        }
Exemple #2
0
        public ActionResult Create(ComplienceType complienceType)
        {
            if (ModelState.IsValid)
            {
                db.ComplienceTypes.Add(complienceType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(complienceType));
        }
Exemple #3
0
        public ActionResult Create(FuelType fuelType)
        {
            if (ModelState.IsValid)
            {
                db.FuelTypes.Add(fuelType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fuelType));
        }
Exemple #4
0
        public ActionResult Create(AssetType assetType)
        {
            if (ModelState.IsValid)
            {
                db.AssetTypes.Add(assetType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(assetType));
        }
        public JsonResult Create(AdditionalField additionalField)
        {
            if (ModelState.IsValid)
            {
                db.AdditionalFields.Add(additionalField);
                db.SaveChanges();
                ViewBag.FleetNo = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", additionalField.FleetNo);
                //return Json("Index");
            }

            return(Json(additionalField));
        }
Exemple #6
0
        public ActionResult Create(FleetAssetModel fleetAssetModel)
        {
            if (ModelState.IsValid)
            {
                db.FleetAssetModels.Add(fleetAssetModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FleetAssetMakeID = new SelectList(db.FleetAssetMakes, "ID", "Manufacturer", fleetAssetModel.FleetAssetMakeID);
            return(View(fleetAssetModel));
        }
Exemple #7
0
        public ActionResult Create(AssetSubType assetSubType)
        {
            if (ModelState.IsValid)
            {
                db.AssetSubTypes.Add(assetSubType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AssetTypeID = new SelectList(db.AssetTypes, "ID", "Type", assetSubType.AssetTypeID);
            return(View(assetSubType));
        }
        public JsonResult Create(Capacity capacity)
        {
            if (ModelState.IsValid)
            {
                db.Capacities.Add(capacity);
                db.SaveChanges();
                //return RedirectToAction("Index");
            }

            ViewBag.FleetNo = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", capacity.FleetNo);
            return(Json(capacity));
        }
        public JsonResult Create(Attachment attachment)
        {
            if (ModelState.IsValid)
            {
                db.Attachments.Add(attachment);
                db.SaveChanges();
                //return RedirectToAction("Index");
            }

            ViewBag.FleetNo = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", attachment.FleetNo);
            return(Json(attachment));
        }
        public JsonResult Create(Complience complience)
        {
            if (ModelState.IsValid)
            {
                db.Compliences.Add(complience);
                db.SaveChanges();
                //return RedirectToAction("Index");
            }

            ViewBag.TypeID           = new SelectList(db.ComplienceSubTypes, "ID", "Name", complience.SubTypeID);
            ViewBag.ComplienceTypeID = new SelectList(db.ComplienceTypes, "ID", "Class", complience.ComplienceTypeID);
            ViewBag.FleetNo          = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", complience.FleetNo);
            return(Json(complience));
        }
Exemple #11
0
        public JsonResult Create(FleetAsset fleetAsset)
        {
            if (ModelState.IsValid)
            {
                db.FleetAssets.Add(fleetAsset);
                db.SaveChanges();
                //return RedirectToAction("Index");
            }

            ViewBag.SubTypeID         = new SelectList(db.AssetSubTypes, "ID", "SubType", fleetAsset.SubTypeID);
            ViewBag.TypeID            = new SelectList(db.AssetTypes, "ID", "Type", fleetAsset.TypeID);
            ViewBag.FleetAssetMakeID  = new SelectList(db.FleetAssetMakes, "ID", "Manufacturer", fleetAsset.FleetAssetMakeID);
            ViewBag.FleetAssetModelID = new SelectList(db.FleetAssetModels, "ID", "Name", fleetAsset.FleetAssetModelID);
            ViewBag.FuelTypeID        = new SelectList(db.FuelTypes, "ID", "Fuel", fleetAsset.FuelTypeID);
            return(Json(fleetAsset));
        }
Exemple #12
0
        public ActionResult DeleteConfirmed(string id)
        {
            var apUser = ap.Users.Find(id);
            var dbUser = db.AspNetUsers.Find(id);

            ap.Users.Remove(apUser);
            db.AspNetUsers.Remove(dbUser);
            ap.SaveChanges();
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }