Beispiel #1
0
 public ActionResult Approve([Bind(Include = "Status")] Work work)
 {
     if (ModelState.IsValid)
     {
         work.Status          = Status.Approved;
         db.Entry(work).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("AccomWorksforApproval"));
     }
     ViewBag.User_ID = new SelectList(db.Opwauthorisation2, "User_ID", "User_Name", work.User_ID);
     return(View(work));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Property_ID,OPW_Building_Code,Address,County,Type,Cost_Centre,Team,WorkId")] Property property)
 {
     if (ModelState.IsValid)
     {
         db.Entry(property).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(property));
 }
 public ActionResult Edit([Bind(Include = "User_ID,User_Name,User_Password,Email,Company,Usersect,Usersectcode,User_Approval_Limit,WorkId,approvalStatus")] Authorisation authorisation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(authorisation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(authorisation));
 }
Beispiel #4
0
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        //                                                         DEASP - Actions Controllers
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        // GET / POST: Work/Edit/5  - Approve Project
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        public ActionResult Approve(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Work work = db.Opwwork2.Find(id);

            if (work == null)
            {
                return(HttpNotFound());
            }
            if (ModelState.IsValid)
            {
                work.Status = Status.Approved;
                work.Proj_budget_Approved = work.Proj_budget_Requested;
                db.Entry(work).State      = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("AccomWorksforApproval"));
            }
            ViewBag.User_ID = new SelectList(db.Opwauthorisation2, "User_ID", "User_Name", work.User_ID);
            return(View(work));
        }