/// <summary> /// 初始化修改数据界面 /// </summary> /// <returns></returns> public ActionResult Update(int Id) { string title = "请选择"; List <SelectListItem> parent = _workLogAttributeContract.SelectList(title); ViewBag.Parents = parent; WorkLogAttributeDto dto = _workLogAttributeContract.Edit(Id); return(PartialView(dto)); }
/// <summary> /// 栏目下工作手册数据更改 /// </summary> /// <param name="workLogAttributeId">该手册内容所属栏目</param> /// <param name="num">要更改的数量(增加为正,减少为负)</param> /// <returns></returns> public bool AddWorkLogCount(int workLogAttributeId, int num) { try { while (workLogAttributeId > 0) { WorkLogAttributeDto workLogAttribute = _workLogAttributeContract.Edit(workLogAttributeId); workLogAttribute.WorkLogCount = (workLogAttribute.WorkLogCount + num) < 0 ? 0 : workLogAttribute.WorkLogCount + num; _workLogAttributeContract.Update(workLogAttribute); workLogAttributeId = workLogAttribute.ParentId == null ? 0 : Convert.ToInt32(workLogAttribute.ParentId); } return true; } catch (Exception ex) { return false; } }
public JsonResult Update(WorkLogAttributeDto dto) { OperationResult res = _workLogAttributeContract.Update(dto); return(Json(res)); }
public JsonResult Create(WorkLogAttributeDto dto) { OperationResult oper = _workLogAttributeContract.Insert(dto); return(Json(oper)); }