Beispiel #1
0
        public ActionResult Create([Bind(Include = "id_task,title,descr,asigned_to,id_list")] Task task)
        {
            if (ModelState.IsValid)
            {
                TasksBLL.Create(task);
                return(RedirectToAction("Index"));
            }

            ViewBag.id_list = new SelectList(db.List, "id_list", "name_list", task.id_list);
            return(View(task));
        }
Beispiel #2
0
        public IHttpActionResult PostTask(Task task)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            TasksBLL.Create(task);

            return(CreatedAtRoute("DefaultApi", new { id = task.id_task }, task));
        }