Ejemplo n.º 1
0
        public static Result BatchDelete(string param)
        {
            Result      model       = new Result();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.BatchDeleteEmployee(accessToken.Value);

            model = DingTalkHttpHelp <Result> .Post(url, param);

            return(model);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static Result Update(string param)
        {
            Result      model       = new Result();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.UpdateDepartment(accessToken.Value);

            model = DingTalkHttpHelp <Result> .Post(url, param);

            return(model);
        }
Ejemplo n.º 3
0
        public static Result Delete(string userid)
        {
            Result      model       = new Result();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.DeleteEmployee(accessToken.Value, userid);

            model = DingTalkHttpHelp <Result> .Get(url);

            return(model);
        }
Ejemplo n.º 4
0
        public static GetEmployee Get(string userid)
        {
            GetEmployee model       = new GetEmployee();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.GetEmployee(accessToken.Value, userid);

            model = DingTalkHttpHelp <GetEmployee> .Get(url);

            return(model);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static DepartmentResult Create(DepartmentEntity model)
        {
            DepartmentResult resul       = new DepartmentResult();
            AccessToken      accessToken = TokenHelp.GetAccessToken();
            string           url         = DingTalkUrlHelp.CreateDepartment(accessToken.Value);

            resul = DingTalkHttpHelp <DepartmentResult> .Post(url, model.ToJson());

            return(resul);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取部门详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static GetDepartment Get(string id)
        {
            AccessToken   accessToken = TokenHelp.GetAccessToken();
            string        url         = DingTalkUrlHelp.GetDepartment(accessToken.Value, id);
            GetDepartment model       = new GetDepartment();

            model = DingTalkHttpHelp <GetDepartment> .Get(url);

            return(model);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取管理员列表
        /// </summary>
        /// <returns></returns>
        public static Result GetByDepartmentIdForAdmin()
        {
            Result      model       = new Result();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.GetByDepartmentIdForAdmin(accessToken.Value);

            model = DingTalkHttpHelp <Result> .Get(url);

            return(model);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 获取部门成员(详情)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static GetDepartmentForUserList GetByDepartmentIdForUserInfoList(string id)
        {
            GetDepartmentForUserList model = new GetDepartmentForUserList();
            AccessToken accessToken        = TokenHelp.GetAccessToken();
            string      url = DingTalkUrlHelp.GetByDepartmentIdForUserInfoList(accessToken.Value, id);

            model = DingTalkHttpHelp <GetDepartmentForUserList> .Get(url);

            return(model);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取部门成员
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static ByDepIdFroSimpleListResult GetByDepartmentIdForSimpleList(string id)
        {
            ByDepIdFroSimpleListResult model = new ByDepIdFroSimpleListResult();
            AccessToken accessToken          = TokenHelp.GetAccessToken();
            string      url = DingTalkUrlHelp.GetByDepartmentIdForSimpleList(accessToken.Value, id);

            model = DingTalkHttpHelp <ByDepIdFroSimpleListResult> .Get(url);

            return(model);
        }
Ejemplo n.º 10
0
        public static Result Update(string param)
        {
            Result      model       = new Result();
            AccessToken accessToken = TokenHelp.GetAccessToken();
            string      url         = DingTalkUrlHelp.UpdateEmployee(accessToken.Value);

            model = DingTalkHttpHelp <Result> .Post(url, param);

            if (model.errmsg == "40014")
            {
                accessToken = TokenHelp.GetAccessToken();
                url         = DingTalkUrlHelp.UpdateEmployee(accessToken.Value);
                model       = DingTalkHttpHelp <Result> .Post(url, param);
            }
            return(model);
        }