public IHttpActionResult DeleteOrg([FromBody] int orgInfoId, [UserProfile] UserProfile userProfile)
        {
            var orgInfo = _orgServiceService.Get(orgInfoId);

            var t = CheckAndReturnMsg(orgInfo, userProfile);

            if (!String.IsNullOrEmpty(t))
            {
                return(BadRequest(t));
            }

            return(DoFunction(() =>
            {
                bool bl = _orgServiceService.DeleteById(orgInfoId);
                return bl;
            }, "删除组织机构失败"));
        }
Exemple #2
0
 /// <summary>
 /// 获取全部数据
 /// </summary>
 /// <param name="username">账号</param>
 /// <param name="staffname">用户名</param>
 /// <param name="page">页数</param>
 /// <param name="rows">条数</param>
 /// <returns></returns>
 public async Task <JsonResult> GetList(string username = "", string staffname = "", int page = 0, int rows = 20)
 {
     return(await Task.Run(() =>
     {
         var para = new StaffPara
         {
             Id = username,
             RealName = staffname,
             PageNumber = page - 1,
             PageSize = rows,
             OrgId = LoginInfo.Org.Id,
             RoleId = LoginInfo.Role
         };
         var rlt = _staffService.GetList(para, out var count).OrderBy(m => m.Name);
         var data = rlt.MapTo <IEnumerable <StaffModel> >().ToList();
         data.ForEach(m => m.OrgIdDesc = _orgService.Get(m.OrgId)?.Name);
         var res = new JsonResult(new { total = count, rows = data });
         return res;
     }));
 }
        public OrgDto Get(int id)
        {
            var org = _orgService.Get(id);

            return(org);
        }
Exemple #4
0
 public async Task <OrgDto[]> Get()
 {
     return(await _orgService.Get());
 }
Exemple #5
0
 public OrgDto[] Get()
 {
     return(_orgService.Get());
 }