Exemplo n.º 1
0
        //添加部门
        private void btn_addDepartment_Click(object sender, EventArgs e)
        {
            try
            {
                DepartmentInfo _info = new DepartmentInfo();
                _info.userId         = this.txt_Account.Text.Trim();
                _info.departmentName = this.txt_departmentName.Text.Trim();
                _info.parentId       = this.txt_parentId.Text.Trim();
                _info.departmentId   = this.txt_departmentId.Text.Trim();

                DepartmentResponse result = ecBusiness.AddDepartment(_info);
                if (result != null)
                {
                    this.txt_ResultCode.Text = result.resultCode;
                    this.txt_Content.Text    = result.resultContext;
                    this.txt_ResultInfo.Text = eSDKServiceHelper.GetJsonString(result);
                    if (result.resultCode == "0")
                    {
                        this.WriteLog("call add department success.");
                    }
                    else
                    {
                        this.WriteLog("call add department failed," + result.resultContext);
                    }
                }
                else
                {
                    this.WriteLog("call add department fail,response is null.");
                }
            }
            catch (Exception ex)
            {
                this.WriteLog("call add department fail," + ex.Message);
            }
        }
Exemplo n.º 2
0
        public static DepartmentResponse addDepartment(DepartmentInfo info)
        {
            DepartmentResponse result = eSDKServiceHelper.CallService <DepartmentResponse>(ECConstUri.department_uri, HttpMethod.POST, info);

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 添加部门
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public DepartmentResponse AddDepartment(DepartmentInfo info)
        {
            DepartmentResponse result = eSDKServiceHelper.addDepartment(info);

            return(result);
        }