protected void Page_Load(object sender, EventArgs e)
    {
        Service_CompanyFastModule.CompanyFastModuleClient bll = new Service_CompanyFastModule.CompanyFastModuleClient();
        if (Request.HttpMethod.ToLower() == "post")
        {
            bll.BatchAdd(LoginCompanyId
                         , LoginUserId
                         , GetRequest.GetRequestValue("ModuleIds", Method.Post)
                         , GetRequest.GetRequestValue("FnUrls", Method.Post)
                         , GetRequest.GetRequestValue("FnNames", Method.Post)
                         );
            bll.Abort();
            bll.Close();
            Success();
        }
        else
        {
            Service_CompanyModule.CompanyModuleClient cmBll = new Service_CompanyModule.CompanyModuleClient();
            __CompanyFastList = bll.ListByUser(LoginCompanyId, LoginUserId);
            V_CompanyModule[] cmList = cmBll.List(LoginCompanyId);
            Service_PublicUser.UserServiceClient puBll    = new Service_PublicUser.UserServiceClient();
            Service_PublicUser.CompanyManageUser userInfo = puBll.CompanyManageGet(LoginCompanyId, LoginUserId);
            __HasModuleIds = ",";
            foreach (V_CompanyModule item in cmList)
            {
                if (userInfo.RoleTypeId != 1 && userInfo._UserPowerExLst.Where(m => m.ModuleId == item.ModuleId).ToArray().Length == 0)
                {
                    continue;
                }
                __HasModuleIds += item.ModuleId + ",";
            }
            foreach (CompanyFastModule item in __CompanyFastList)
            {
                __FnUrls += item.Url + "|";
            }

            bll.Abort();
            bll.Close();
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        switch (GetRequest.GetRequestValue("action"))
        {
        case "HasNewMsg":
            NameValueCollection Pars = new NameValueCollection();
            Pars.Add("LoginUserId", LoginUserId.ToString());
            Response.Write(GetHTML("http://person.968ch.com/Message/HasNew", Pars, Method.Get));
            Response.End();
            return;

        default:
            break;
        }

        try
        {
            Service_CompanyFastModule.CompanyFastModuleClient fastModuleBll = new Service_CompanyFastModule.CompanyFastModuleClient();
            __FastModule = fastModuleBll.ListByUser(LoginCompanyId, LoginUserId).OrderBy(m => m.ModuleId).ToArray();
            fastModuleBll.Abort();
            fastModuleBll.Close();
            Service_OEMAgent.AgentServiceClient oemBll = new Service_OEMAgent.AgentServiceClient();
            __OEMInfo = oemBll.AgentGetByComId(LoginCompanyId);
            Service_SystemModule.SystemModuleClient systemModuleBll = new Service_SystemModule.SystemModuleClient();
            __AllList = systemModuleBll.ListByCompany(LoginCompanyId, "", LoginUserId).OrderBy(m => m.OrderBy).ToArray();
            systemModuleBll.Abort();
            systemModuleBll.Close();
            Service_Company.CompanyServiceClient companyBll = new Service_Company.CompanyServiceClient();
            __Company   = companyBll.GetCompany(LoginCompanyId);
            __IsCompany = companyBll.CompanyValid(LoginCompanyId);
            companyBll.Abort();
            companyBll.Close();
            Service_PublicUser.UserServiceClient puBll = new Service_PublicUser.UserServiceClient();
            __userInfo       = puBll.CompanyManageGet(LoginCompanyId, LoginUserId);
            __HasMoreCompany = puBll.CompanyManageListAll(LoginUserId).Length > 1;
            puBll.Abort();
            puBll.Close();
            if (__userInfo == null)
            {
                Response.Redirect("http://m.968ch.com/admin/login.aspx");
                return;
            }

            if (__AllList != null)
            {
                foreach (SystemModule item in __AllList)
                {
                    if (item.State == 3 ||//未购买
                        (__userInfo.RoleTypeId != 1 && __userInfo._UserPowerExLst.Where(m => m.ModuleId == item.id).ToArray().Length == 0)   //无操作权限
                        )
                    {
                        continue;
                    }

                    if (item.State == 0)
                    {
                        switch (item.Type)
                        {
                        case 1:
                            __OpenModule_1.Add(item);
                            break;

                        case 2:
                            __OpenModule_2.Add(item);
                            break;

                        case 3:
                            __OpenModule_3.Add(item);
                            break;

                        default:
                            break;
                        }
                    }
                    else if (__userInfo.RoleTypeId == 1)
                    {
                        switch (item.Type)
                        {
                        case 1:
                            __NotOpenModule_1.Add(item);
                            break;

                        case 2:
                            __NotOpenModule_2.Add(item);
                            break;

                        case 3:
                            __NotOpenModule_3.Add(item);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            oemBll.Abort();
            oemBll.Close();
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }