Пример #1
0
        // GET: TASK/Delete/5
        public ActionResult Delete(int id)
        {
            TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT();

            customer = dao.Read(id);
            return(View(customer));
        }
Пример #2
0
        // GET: TASK/Edit/5
        public ActionResult Edit(int?id)
        {
            TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT();

            customer = dao.Read(Convert.ToInt32(id));
            return(View(customer));
        }
        //Update Operation
        public void Update(TASK_ASSIGNMENT obj)
        {
            TASK_ASSIGNMENT std = _DB.TASK_ASSIGNMENT.Find(obj.ID);

            std = obj;
            _DB.SaveChanges();
        }
        //Delete Operation
        public void Delete(int id)
        {
            TASK_ASSIGNMENT obj = new TASK_ASSIGNMENT();

            obj = _DB.TASK_ASSIGNMENT.Find(id);
            _DB.TASK_ASSIGNMENT.Remove(obj);
            _DB.SaveChanges();
        }
Пример #5
0
 public ActionResult Create(TASK_ASSIGNMENT customer)
 {
     try
     {
         dao.Create(customer);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("Error", ex.Message);
     }
     return(RedirectToAction("Index"));
 }
Пример #6
0
        public ActionResult Edit(int id, FormCollection formValues)
        {
            try
            {
                TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT();
                customer           = dao.Read(id);
                customer.WORKER_ID = Convert.ToInt32(Request.Form["WORKER_ID"]);
                customer.TASK_ID   = Convert.ToInt32(Request.Form["TASK_ID"]);

                dao.Update(customer);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", ex.Message);
            }
            return(RedirectToAction("Index"));
        }
Пример #7
0
        // GET: TASK/Create
        public ActionResult Create()
        {
            TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT();

            return(View(customer));
        }
 //Create Operation
 public void Create(TASK_ASSIGNMENT obj)
 {
     _DB.TASK_ASSIGNMENT.Add(obj);
     _DB.SaveChanges();
 }