コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tasking tasking = db.taskings.Find(id);

            db.taskings.Remove(tasking);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Idd,UserId,TaskName,TaskNumber,TaskDesc,TaskComments,Id,completed")] tasking tasking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tasking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Id = new SelectList(db.CoreUsers, "Id", "UserName", tasking.Id);
     return(View(tasking));
 }
コード例 #3
0
        // GET: taskings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tasking tasking = db.taskings.Find(id);

            if (tasking == null)
            {
                return(HttpNotFound());
            }
            return(View(tasking));
        }
コード例 #4
0
        // GET: taskings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tasking tasking = db.taskings.Find(id);

            if (tasking == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Id = new SelectList(db.CoreUsers, "Id", "UserName", tasking.Id);
            return(View(tasking));
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "Idd,UserId,TaskName,TaskNumber,TaskDesc,TaskComments,Id,completed")] tasking tasking)
        {
            if (ModelState.IsValid)
            {
                tasking.UserId = User.Identity.Name;

                string temp = "UD&A";
                var    guid = Convert.ToString((new Random()).Next(100000));
                //string temp2 = s.IdNumber.Substring(6, 13);
                //string temp1 = "ajd";
                tasking.TaskNumber   = temp + guid;
                tasking.TaskComments = "";
                tasking.completed    = false;
                db.taskings.Add(tasking);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Id = new SelectList(db.CoreUsers, "Id", "UserName", tasking.Id);
            return(View(tasking));
        }