public ActionResult DeleteConfirmed(int id)
        {
            tasking tasking = db.taskings.Find(id);

            db.taskings.Remove(tasking);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 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));
 }
        // 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));
        }
        // 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));
        }
        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));
        }