public JsonResult Put([FromBody] Department Department) { _service.Update(Department); return(new JsonResult(new { code = 20000 })); }
public ActionResult Edit(DepartmentDto model) { try { // TODO: Add insert logic here // model.depAddTime = DateTime.Now; _appService.Update(model); AjaxModel.Statu = "ok"; } catch (Exception ex) { AjaxModel.Statu = "err"; AjaxModel.Msg = ex.ToString(); } return(Json(AjaxModel)); }
private string UpdateDepartmentInfo(VMMasterForm MstrInf) { var DeptInfo = _departmentService.All().ToList().FirstOrDefault(x => x.DeptID == MstrInf.ID); if (DeptInfo != null) { var DepInfList = _departmentService.All().ToList().Where(c => c.DeptID != MstrInf.ID).ToList(); var IsCodExst = DepInfList.FirstOrDefault(x => x.DeptCode == MstrInf.Code); if (IsCodExst == null) { DeptInfo.DeptCode = MstrInf.Code; DeptInfo.DeptName = MstrInf.Name; DeptInfo.DeptLocalName = MstrInf.LocalName; DeptInfo.DeptDesc = MstrInf.Descr; _departmentService.Update(DeptInfo); _departmentService.Save(); var DeptID = DeptInfo.DeptID; TransactionLogService.SaveTransactionLog(_transactionLogService, "MasterInformation", "UpdateDepartmentInfo", DeptID.ToString(), Session["UserName"].ToString()); return("1"); } else { return("3"); } } else { return("2"); } }
public IActionResult Update(DepartmentDto department) { _departmentAppService.Update(department); return(RedirectToAction("Index", "Department")); }
public DepartmentUpdateResponse Update(int id, DepartmentUpdateRequest request) { return(_departmentAppService.Update(id, request)); }
public async Task <IActionResult> Update([FromBody] EditDepartmentCommand command) { var result = _service.Update(command); return(await Response(result, result.Notifications)); }