public ActionResult saveEventData() { string start = Request.Form["start"]; string end = Request.Form["end"]; string title = Request.Form["title"]; string body = Request.Form["body"]; int client = Convert.ToInt32(Request.Form["client"]); int project = Convert.ToInt32(Request.Form["project"]); int product = Convert.ToInt32(Request.Form["product"]); int service = Convert.ToInt32(Request.Form["service"]); Task tsk = new Task(); tsk.dtStartDate = Convert.ToDateTime(start); tsk.dtEndDate = Convert.ToDateTime(end); tsk.dtCreation = DateTime.Now; tsk.strTitle = title; tsk.strComment = body; tsk.Proyect_id = project; tsk.Service_id = service; tsk.Resource_id = getUserbyName(User.Identity.Name); // Add Items to Repository _repository.Add(tsk); // Persist Changes _repository.Save(); return(null); }
/// <summary> /// This function manage data from service to repository pattern. /// </summary> /// <param name="item">Inserted object</param> /// <returns>Pre-mapped object</returns> public Time Create(TimeDTO item) { _repository.Add(item); _repository.Save(); return(_mapper.Map <Time>(item)); }
public int?Post([FromBody] TimeRule value) { if (timeRepo.Add(value)) { return(value.ID); } return(null); }