/// <summary> /// 查询部门信息 /// </summary> /// <param name="request"></param> /// <param name="response"></param> public void QueryDepartInfo(DepartConfig request, DepartConfigResponse response) { var list = _insideDepartRepository.QueryDepartInfo(request.DepartNo); response.QueryData = new Report { total = list.Count, rows = list }; response.ResponseStatus.ErrorCode = "OK"; }
public ActionResult DeletePrDepartConfig(IEnumerable <string> ids) { DepartConfig request = new DepartConfig { RequestType = 3, DepartNo = ids.First() }; DepartConfigResponse response = WeChatHelper.PostService <DepartConfig, DepartConfigResponse>("DepartConfig", request); return(Json(response, JsonRequestBehavior.DenyGet)); }
public void DeleteDepart(DepartConfig request, DepartConfigResponse response) { ValidRequest(request, new DepartConfigVaildator(), ruleSet: "Delete"); //验证部门编号是否存在 var departConfigs = _insideDepartRepository.QueryDepartInfo(); if (!(departConfigs.Any(i => i.DEPARTNO == request.DepartNo))) { throw new Utility.WeChatException("DEPART_DELETE_ERROR", "当前部门编号不存在"); } _insideDepartRepository.DeleteDepart(request.DepartNo); response.ResponseStatus.ErrorCode = "OK"; }
public void ModifyDepart(DepartConfig request, DepartConfigResponse response) { ValidRequest(request, new DepartConfigVaildator(), ruleSet: "Edit"); //验证部门编号是否存在 var departConfigs = _insideDepartRepository.QueryDepartInfo(); if (!(departConfigs.Any(i => i.DEPARTNO == request.DepartNo))) { throw new Utility.WeChatException("DEPART_EDIT_ERROR", "当前部门编号不存在"); } _insideDepartRepository.UpdateDepartInfo(request.DepartNo, request.DepartName, request.CurrOper, request.Remark); response.ResponseStatus.ErrorCode = "OK"; }
public void AddDepart(DepartConfig request, DepartConfigResponse response) { ValidRequest(request, new DepartConfigVaildator(), ruleSet: "Add"); //验证部门编号是否重复 var departConfigs = _insideDepartRepository.QueryDepartInfo(); if (departConfigs.Any(i => i.DEPARTNO == request.DepartNo)) { throw new Utility.WeChatException("DEPART_ADD_ERROR", "部门编号已存在"); } _insideDepartRepository.InsertDepart(request.DepartNo, request.DepartName, request.CurrOper, request.Remark); response.ResponseStatus.ErrorCode = "OK"; }
public ActionResult ModifyPrDepartConfig(IEnumerable <string> ids, string departName, string remark) { DepartConfig request = new DepartConfig { RequestType = 2, DepartNo = ids.First(), DepartName = departName, Remark = remark, CurrOper = Session["StaffNo"].CastTo(""), }; DepartConfigResponse response = WeChatHelper.PostService <DepartConfig, DepartConfigResponse>("DepartConfig", request); return(Json(response, JsonRequestBehavior.DenyGet)); }
public ActionResult AddPrDepartConfig(string departNo, string departName, string remark) { DepartConfig request = new DepartConfig { RequestType = 1, DepartNo = departNo, DepartName = departName, Remark = remark, CurrOper = Session["StaffNo"].CastTo(""), }; DepartConfigResponse response = WeChatHelper.PostService <DepartConfig, DepartConfigResponse>("DepartConfig", request); return(Json(response, JsonRequestBehavior.DenyGet)); }
/// <summary> /// 部门维护 /// </summary> /// <param name="request"></param> /// <returns></returns> public object Post(DepartConfig request) { DepartConfigResponse rsp = new DepartConfigResponse(); if (request.RequestType == (short)DepartConfigRequestType.QueryDepart) { _privilegeService.QueryDepartInfo(request, rsp); } if (request.RequestType == (short)DepartConfigRequestType.AddDepart) { _privilegeService.AddDepart(request, rsp); } if (request.RequestType == (short)DepartConfigRequestType.ModifyDepart) { _privilegeService.ModifyDepart(request, rsp); } if (request.RequestType == (short)DepartConfigRequestType.DeleteDepart) { _privilegeService.DeleteDepart(request, rsp); } return(rsp); }