public ActionResult Edit(TaskAttachment TaskAttachment)
        {
            TaskAttachment oTaskAttachment = new TaskAttachment();

            oTaskAttachment.TaskID           = System.Convert.ToInt32(TaskAttachment.TaskID);
            oTaskAttachment.TaskAttachmentID = System.Convert.ToInt32(TaskAttachment.TaskAttachmentID);
            oTaskAttachment = TaskAttachmentData.Select_Record(TaskAttachment);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = TaskAttachmentData.Update(oTaskAttachment, TaskAttachment);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }
            // ComboBox
            ViewData["TaskID"] = new SelectList(TaskAttachment_TaskData.List(), "TaskID", "TaskID", TaskAttachment.TaskID);

            return(View(TaskAttachment));
        }
        // GET: /TaskAttachment/Delete/<id>
        public ActionResult Delete(
            Int32?TaskID
            , Int32?TaskAttachmentID
            )
        {
            if (
                TaskID == null ||
                TaskAttachmentID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            dtTask = TaskAttachment_TaskData.SelectAll();

            TaskAttachment TaskAttachment = new TaskAttachment();

            TaskAttachment.TaskID           = System.Convert.ToInt32(TaskID);
            TaskAttachment.TaskAttachmentID = System.Convert.ToInt32(TaskAttachmentID);
            TaskAttachment      = TaskAttachmentData.Select_Record(TaskAttachment);
            TaskAttachment.Task = new Task()
            {
                TaskID = (Int32)TaskAttachment.TaskID
            };

            if (TaskAttachment == null)
            {
                return(HttpNotFound());
            }
            return(View(TaskAttachment));
        }
        // GET: /TaskAttachment/Edit/<id>
        public ActionResult Edit(
            Int32?TaskID
            , Int32?TaskAttachmentID
            )
        {
            if (
                TaskID == null ||
                TaskAttachmentID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            TaskAttachment TaskAttachment = new TaskAttachment();

            TaskAttachment.TaskID           = System.Convert.ToInt32(TaskID);
            TaskAttachment.TaskAttachmentID = System.Convert.ToInt32(TaskAttachmentID);
            TaskAttachment = TaskAttachmentData.Select_Record(TaskAttachment);

            if (TaskAttachment == null)
            {
                return(HttpNotFound());
            }
            // ComboBox
            ViewData["TaskID"] = new SelectList(TaskAttachment_TaskData.List(), "TaskID", "TaskID", TaskAttachment.TaskID);

            return(View(TaskAttachment));
        }
        public ActionResult DeleteConfirmed(
            Int32?TaskID
            , Int32?TaskAttachmentID
            )
        {
            TaskAttachment TaskAttachment = new TaskAttachment();

            TaskAttachment.TaskID           = System.Convert.ToInt32(TaskID);
            TaskAttachment.TaskAttachmentID = System.Convert.ToInt32(TaskAttachmentID);
            TaskAttachment = TaskAttachmentData.Select_Record(TaskAttachment);

            bool bSucess = false;

            bSucess = TaskAttachmentData.Delete(TaskAttachment);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }