Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int TechId, int TechInfoWorkId)
        {
            TechInfoWork techInfoWork = db.TechInfoWorks.Find(TechInfoWorkId);

            db.TechInfoWorks.Remove(techInfoWork);
            db.SaveChanges();
            return(RedirectToAction("Index", "TechInfoWorks", new { id = TechId }));
        }
Exemplo n.º 2
0
        // GET: TechInfoWorks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TechInfoWork techInfoWork = db.TechInfoWorks.Find(id);

            if (techInfoWork == null)
            {
                return(HttpNotFound());
            }
            return(View(techInfoWork));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "TechInfoWorkId,TypeOfService,ManufacturerName,PlatformName,Notes,FarmId,ScopeWorkId,TechId")] TechInfoWork techInfoWork)
        {
            if (ModelState.IsValid)
            {
                db.TechInfoWorks.Add(techInfoWork);
                db.SaveChanges();
                return(RedirectToAction("Index", "TechInfoWorks", new { id = techInfoWork.TechId }));
            }

            ViewBag.FarmId           = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId);
            ViewBag.ScopeWorkId      = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId);
            ViewBag.TechId           = techInfoWork.TechId;
            ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName");
            return(View(techInfoWork));
        }
Exemplo n.º 4
0
        public ActionResult Edit([Bind(Include = "TechInfoWorkId,TypeOfService,ManufacturerName,PlatformName,Notes,FarmId,ScopeWorkId,TechId")] TechInfoWork techInfoWork)
        {
            if (ModelState.IsValid)
            {
                db.Entry(techInfoWork).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", "TechInfoWorks", new { id = techInfoWork.TechId }));
            }
            ViewBag.FarmId      = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId);
            ViewBag.ScopeWorkId = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId);
            ViewBag.TechId      = techInfoWork.TechId;

            ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName", techInfoWork.ManufacturerName);

            var objPlatform = db.Platforms.Where(c => c.ManufacturerName == techInfoWork.ManufacturerName);

            ViewBag.PlatformName = new SelectList(objPlatform, "PlatformName", "PlatformName", techInfoWork.PlatformName);

            return(View(techInfoWork));
        }
Exemplo n.º 5
0
        // GET: TechInfoWorks/Edit/5
        public ActionResult Edit(int?id, int idtech)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TechInfoWork techInfoWork = db.TechInfoWorks.Find(id);

            if (techInfoWork == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FarmId           = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId);
            ViewBag.ScopeWorkId      = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId);
            ViewBag.TechId           = idtech;
            ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName", techInfoWork.ManufacturerName);

            var objPlatform = db.Platforms.Where(c => c.ManufacturerName == techInfoWork.ManufacturerName);

            ViewBag.PlatformName = new SelectList(objPlatform, "PlatformName", "PlatformName", techInfoWork.PlatformName);

            return(View(techInfoWork));
        }