public ActionResult DeleteConfirmed(int id) { TasksDetail tasksDetail = db.TasksDetails.Find(id); db.TasksDetails.Remove(tasksDetail); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <CommonResponse> Update(TasksDetail tasksDetail) { var insetresult = await _sqliteSql.Update <TasksDetail>().SetSource(tasksDetail).ExecuteAffrowsAsync(); return(new CommonResponse { code = insetresult == 1 ? 0 : -1, message = insetresult == 1 ? "" : "更新失败!" }); }
public ActionResult Edit([Bind(Include = "Id,title,description,dueDate,hoursLeft,priority")] TasksDetail tasksDetail) { if (ModelState.IsValid) { db.Entry(tasksDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tasksDetail)); }
public ActionResult Create([Bind(Include = "Id,title,description,dueDate,hoursLeft,priority")] TasksDetail tasksDetail) { if (ModelState.IsValid) { db.TasksDetails.Add(tasksDetail); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tasksDetail)); }
public async Task <ResultData> UpdateTaskDetailInfo([FromBody] TasksDetail Task) { var insetresult = await _sqliteSql.Update <TasksDetail>().SetSource(Task).ExecuteAffrowsAsync(); if (insetresult > 0) { return(ResultData.CreateSuccessResult()); } else { return(ResultData.CreateResult("-1", "更新失败", null)); } }
// GET: TasksDetails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TasksDetail tasksDetail = db.TasksDetails.Find(id); if (tasksDetail == null) { return(HttpNotFound()); } return(View(tasksDetail)); }
public async Task <CommonResponse> Insert(TasksDetail tasksDetail) { var insetresult = await _sqliteSql.Insert(new TasksDetail { ScriptCode = tasksDetail.ScriptCode, OrgCode = tasksDetail.OrgCode, TaskCode = tasksDetail.TaskCode }).ExecuteAffrowsAsync(); return(new CommonResponse { code = insetresult == 1 ? 0 : -1, message = insetresult == 1 ? "" : "插入失败" }); }
public async Task <ResultData> AddTaskDetailInfo([FromBody] TasksDetail Task) { var insetresult = await _sqliteSql.Insert(new TasksDetail { ScriptCode = Task.ScriptCode, OrgCode = Task.OrgCode, TaskCode = Task.TaskCode }).ExecuteAffrowsAsync(); if (insetresult > 0) { return(ResultData.CreateSuccessResult()); } else { return(ResultData.CreateResult("-1", "添加失败", null)); } }