Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(
            Int32?TaskStateID
            )
        {
            TaskState TaskState = new TaskState();

            TaskState.TaskStateID = System.Convert.ToInt32(TaskStateID);
            TaskState             = TaskStateData.Select_Record(TaskState);

            bool bSucess = false;

            bSucess = TaskStateData.Delete(TaskState);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }
Exemplo n.º 2
0
        // GET: /TaskState/Delete/<id>
        public ActionResult Delete(
            Int32?TaskStateID
            )
        {
            if (
                TaskStateID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }


            TaskState TaskState = new TaskState();

            TaskState.TaskStateID = System.Convert.ToInt32(TaskStateID);
            TaskState             = TaskStateData.Select_Record(TaskState);

            if (TaskState == null)
            {
                return(HttpNotFound());
            }
            return(View(TaskState));
        }
Exemplo n.º 3
0
        public ActionResult Edit(TaskState TaskState)
        {
            TaskState oTaskState = new TaskState();

            oTaskState.TaskStateID = System.Convert.ToInt32(TaskState.TaskStateID);
            oTaskState             = TaskStateData.Select_Record(TaskState);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = TaskStateData.Update(oTaskState, TaskState);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }

            return(View(TaskState));
        }