예제 #1
0
        /// <summary>
        /// 删除部门
        /// </summary>
        public static object DeleteDepartment(OrgDTO org)
        {
            ResultDTO dto = BaseHttpService.Get(string.Format(WeiXinConstant.DEPARTMENT_DELETE, GetToken(false), org.id));

            SystemLog.WriteLogs(string.Format("删除部门:{0}:{1}", org.name, dto.info.ToString()));
            if (dto.status)
            {
                return(JsonHelper.ToObject <object>(dto.info.ToString()));
            }
            return(null);
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (CubeConfig.SystemMode == Base.Enums.CubeSystemModeEnum.Single)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "SwitchToSingleMode", @"SystemMode = 'S'; $('#ddlProduct').parents('tr').hide();
$('#ddlOrg').parents('tr').hide();", true);
//$('#ddlDomain').parents('tr').hide();", true);

                    string            systemId          = CubeConfig.CubeSystemId;
                    PermissionService permissionService = new PermissionService();
                    permissionService.Url = Config.Global.PermissionServiceUrl;
                    SystemDTO systemInfo = permissionService.GetSystemInfo(Guid.Parse(systemId));
                    DomainDTO domain     = permissionService.GetDomainInfo(systemInfo.Domain_Id);
                    Page.ClientScript.RegisterStartupScript(GetType(), "SetSingleModeInfo", @"SingleModeProductId = '" + systemInfo.Product_Id
                                                            + "'; SingleModeOrgId = '" + systemInfo.Org_Id + "'; SingleModeDomain = '" + domain.Name + "';", true);
                }

                InitializeSSORequest();

                if (_SSORequest != null)
                {
                    if (_SSORequest.LoginType == LoginTypeEnum.Debug)
                    {
                        string[] datas = _SSORequest.Data.Split(',');
                        if (datas.Length >= 5)
                        {
                            if (!string.IsNullOrWhiteSpace(datas[2]) && !string.IsNullOrWhiteSpace(datas[3]))
                            {
                                string       productName = datas[2];
                                string       orgName     = datas[3];
                                string       userName    = datas[4];
                                LoginService service     = new LoginService();

                                List <SimpleProductOrgDTO> productOrgList = (List <SimpleProductOrgDTO>)service.getProductOrgList().data;
                                SimpleProductOrgDTO        product        = productOrgList.FirstOrDefault(p => p.Name.Equals(productName, StringComparison.CurrentCultureIgnoreCase));
                                if (product != null)
                                {
                                    OrgDTO org = product.OrgList.FirstOrDefault(o => o.Name.Equals(orgName, StringComparison.CurrentCultureIgnoreCase));
                                    if (org != null)
                                    {
                                        LogonInfo logonInfo = new LogonInfo();
                                        logonInfo.SSORequest  = _SSORequest;
                                        logonInfo.IsNT        = true;
                                        logonInfo.OrgID       = org.Id;
                                        logonInfo.OrgName     = orgName;
                                        logonInfo.ProductID   = product.Id;
                                        logonInfo.ProductName = productName;
                                        logonInfo.UserName    = userName;
                                        logonInfo.Language    = "zh-CN";
                                        service.wfkLoginForDebug(logonInfo);
                                    }
                                }
                            }
                        }
                    }
                    else if (_SSORequest.LoginType == LoginTypeEnum.AdminSimulate)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "HidePassword", @"$('#tbxPassword').parents('tr').hide();
$('#ddlProduct').parents('tr').hide();
$('#ddlOrg').parents('tr').hide();
$('#ddlDomain').parents('tr').hide();", true);
                    }
                }

                if (CubeConfig.SystemMode == Base.Enums.CubeSystemModeEnum.Single)
                {
                    lblSystemName.Text = CubeConfig.CubeSystemName;
                    lblSystemName.Attributes["lang"] = "";
                }

                if (CubeConfig.CubeEnvironmentVisible)
                {
                    this.textEnvironmentInfo.Text = "(" + CubeConfig.CubeEnvironment + ")";
                }
            }
        }