Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh")
            {
                Response.Write("");
                Response.End();
            }
            IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();

            if (UserContext.AccessibleApplications.Count > 0)
            {
                SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == EXAMINING_APP_CODE);

                if (examApp != null && UserContext.AccessibleModules.Count > 0)
                {
                    topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                    topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                }
            }
            //string IsPrompt = "False";
            //IList<EasyDictionary> dicAssConfig = DataHelper.QueryDictList("select * from " + db + "..P_AssConfig where CloseState='1'");
            //if (dicAssConfig.Count > 0)
            //{
            //    string assConfigId = dicAssConfig[0].Get<String>("Id");
            //    IList<EasyDictionary> dicList = DataHelper.QueryDictList("select * from " + db + "..P_StageSubmitUser where UserId='" + WebPortalService.CurrentUserInfo.UserID + "'  and P_AssConfigId='" + assConfigId + "'");
            //    if (dicList.Count == 0)
            //    {
            //        IsPrompt = "True";
            //    }
            //}
            this.PageState.Add("Modules", topAuthExamMdls);
            //this.PageState.Add("Prompt", IsPrompt);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SysApplication    app  = SysApplicationRule.FindByCode(APP_CODE);
            IList <SysModule> mdls = app.GetModulesByLevel(0, 5);    // 获取深度为0~5的模块

            PageState.Add("Mdls", mdls);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 刷新应用模块
        /// </summary>
        public void RefreshModules()
        {
            applications = new ReadOnlyCollection <SysApplication>(SysApplication.FindAll());
            modules      = new ReadOnlyCollection <SysModule>(SysModule.FindAll(Expression.Eq(SysModule.Prop_Status, 1)));

            auths  = new ReadOnlyCollection <SysAuth>(SysAuth.FindAll());
            roles  = new ReadOnlyCollection <SysRole>(SysRole.FindAll());
            groups = new ReadOnlyCollection <SysGroup>(SysGroup.FindAll());
        }
        /// <summary>
        /// 刷新应用模块
        /// </summary>
        private void RefreshModules()
        {
            applications = new List <SysApplication>(SysApplication.FindAll());
            modules      = new List <SysModule>(SysModule.FindAll(Expression.Eq(SysModule.Prop_Status, 1)));

            auths  = new List <SysAuth>(SysAuth.FindAll());
            roles  = new List <SysRole>(SysRole.FindAll());
            groups = new List <SysGroup>(SysGroup.FindAll());
        }
Exemplo n.º 5
0
        public async Task <SysApplicationViewModel> UpdateSysApplication(SysApplicationViewModel model)
        {
            SysApplication entity = new SysApplication();

            entity.ApplicationName = model.ApplicationName;
            entity.ApplicationUrl  = model.ApplicationUrl;
            entity.Id = model.Id;
            _repository.Update(entity, a => a.ApplicationName, a => a.ApplicationUrl);
            await _context.SaveChangesAsync();

            return(model);
        }
Exemplo n.º 6
0
        public async Task <SysApplicationViewModel> SaveSysApplication(SysApplicationViewModel model)
        {
            SysApplication entity = new SysApplication();

            entity.ApplicationName = model.ApplicationName;
            entity.ApplicationUrl  = model.ApplicationUrl;
            entity.CreateTime      = DateTime.Now;
            entity.Id = SequenceQueue.NewIdString("");
            await _repository.AddAsync(entity);

            await _context.SaveChangesAsync();

            model.Id         = entity.Id;
            model.CreateTime = entity.CreateTime;
            return(model);
        }
Exemplo n.º 7
0
        string id = String.Empty;   // 对象id

        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op"); // 用户编辑操作
            id = RequestData.Get <string>("id");

            SysApplication ent = null;

            if (IsAsyncRequest)
            {
                switch (RequestAction)
                {
                case RequestActionEnum.Query:
                case RequestActionEnum.Read:
                case RequestActionEnum.Default:
                    break;

                case RequestActionEnum.Create:
                    ent = this.GetPostedData <SysApplication>();
                    ent.DoCreate();
                    break;

                case RequestActionEnum.Update:
                    ent = this.GetMergedData <SysApplication>();
                    ent.DoUpdate();
                    break;

                case RequestActionEnum.Delete:
                    ent = this.GetTargetData <SysApplication>();
                    ent.DoDelete();
                    break;
                }
            }
            else
            {
                if (op != "c")
                {
                    if (!String.IsNullOrEmpty(id))
                    {
                        ent = SysApplication.Find(id);
                    }
                }
            }

            this.SetFormData(ent);
        }
Exemplo n.º 8
0
        public void GetUserCreateMoudles()
        {
            IEnumerable <SysModule> topAuthEPCMdls = new List <SysModule>();
            IEnumerable <SysModule> ents           = new List <SysModule>();

            if (UserContext.AccessibleApplications.Count > 0)
            {
                SysApplication epcApp = UserContext.AccessibleApplications.First(tent => tent.Code == EXAMINING_APP_CODE);

                if (epcApp != null && UserContext.AccessibleModules.Count > 0)
                {
                    topAuthEPCMdls = UserContext.AccessibleModules.Where(tent => tent.IsQuickCreate == true);
                    topAuthEPCMdls = topAuthEPCMdls.OrderBy(tent => tent.SortIndex);
                    ents           = UserContext.AccessibleModules.Where(tent => tent.IsQuickSearch == true)
                                     .OrderBy(tent => tent.SortIndex);
                }
            }
            this.PageState.Add("ModulesCreate", topAuthEPCMdls);
            this.PageState.Add("ModulesSearch", ents);
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (RequestActionString)
            {
            case "unreadmessage":
                GetUserTasks();
                try
                {
                    GoodwaySSO.Sso.Singletion.RefreshUserState(Session["PassCode"].ToString());
                }
                catch { }
                break;

            default: if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh")
                {
                    Response.Write("");
                    Response.End();
                }
                if (Session["PassCode"] == null)
                {
                    SqlDataAdapter sda = new SqlDataAdapter("select Id,WorkNo,UserName,SystemName from OgUser where SystemName='" + this.UserInfo.LoginName + "' ", System.Configuration.ConfigurationManager.ConnectionStrings["BJKY_BeAdmin"].ConnectionString);
                    DataTable      dt  = new DataTable();
                    sda.Fill(dt);
                    if (dt.Rows.Count > 0)
                    {
                        DataRow row      = dt.Rows[0];
                        string  template = "<Form Name='" + row["Id"] + "'><Id>" + row["Id"] + "</Id><WorkNo>" + row["WorkNo"] + "</WorkNo><UserName>" + row["UserName"] + "</UserName><SystemName>" + row["SystemName"] + "</SystemName><Password></Password><Field></Field></Form>";
                        string  passCode = "";
                        try
                        {
                            passCode = GoodwaySSO.Sso.LoginGW(template, row["Id"].ToString(), row["UserName"].ToString());
                        }
                        catch { }
                        this.PageState.Add("PassCode", passCode);
                        Session["PassCode"] = passCode;
                    }
                    else
                    {
                        Session["PassCode"] = "";
                    }
                }
                IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();
                if (UserContext.AccessibleApplications.Count > 0)
                {
                    SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == EXAMINING_APP_CODE);

                    if (examApp != null && UserContext.AccessibleModules.Count > 0)
                    {
                        topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                        topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                    }
                }
                DataTable             dtps = DataHelper.QueryDataTable("select distinct DeptId,DeptName from WebPart where isnull(DeptId,'')<>''");
                List <EasyDictionary> ess  = new List <EasyDictionary>();
                foreach (DataRow row in dtps.Rows)
                {
                    try
                    {
                        string[] deptIds   = row["DeptId"].ToString().Split(',');
                        string[] deptNames = row["DeptName"].ToString().Split(',');
                        for (var i = 0; i < deptIds.Length; i++)
                        {
                            EasyDictionary es = new EasyDictionary();
                            es.Add("DeptId", deptIds[i]);
                            es.Add("DeptName", deptNames[i]);
                            if (!ess.Exists(ens => ens.Get("DeptId").ToString() == deptIds[i]))
                            {
                                ess.Add(es);
                            }
                        }
                    }
                    catch { continue; }
                }
                this.PageState.Add("Depts", ess);
                this.PageState.Add("Modules", topAuthExamMdls);
                GetUserTasks();
                break;
            }
            //string IsPrompt = "False";
            //IList<EasyDictionary> dicAssConfig = DataHelper.QueryDictList("select * from " + db + "..P_AssConfig where CloseState='1'");
            //if (dicAssConfig.Count > 0)
            //{
            //    string assConfigId = dicAssConfig[0].Get<String>("Id");
            //    IList<EasyDictionary> dicList = DataHelper.QueryDictList("select * from " + db + "..P_StageSubmitUser where UserId='" + WebPortalService.CurrentUserInfo.UserID + "'  and P_AssConfigId='" + assConfigId + "'");
            //    if (dicList.Count == 0)
            //    {
            //        IsPrompt = "True";
            //    }
            //}
            //this.PageState.Add("Prompt", IsPrompt);
        }
Exemplo n.º 10
0
 public static SysApplicationViewModel ToModel(this SysApplication entity)
 {
     return(entity.MapTo <SysApplication, SysApplicationViewModel>());
 }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (RequestActionString)
            {
            case "logout":
                WebPortalService.Logout();
                break;

            default:
                if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh")
                {
                    try
                    {
                        GoodwaySSO.Sso.Singletion.RefreshUserState(Session["PassCode"].ToString());
                    }
                    catch { }
                    //在线人数
                    int urcts = 0;
                    Aim.Portal.ServicesProvider.WebPortalServiceProvider ws = (Aim.Portal.ServicesProvider.WebPortalServiceProvider)WebPortalService.GetDefaultProvider();
                    urcts = Aim.Common.ServiceHelper.DeserializeFromBytes <SysUser[]>(ws.USService.GetSystemData("<container><parameters><parameter Name='SessionID'></parameter><parameter Name='Operation'>getonlineusers</parameter></parameters></container>")).Length;
                    Response.Write(urcts);
                    Response.End();
                }
                //string connStr = ConfigurationManager.AppSettings["BJKY_Examine"].ToString();
                //SqlConnection conn = new SqlConnection(connStr);
                //string sql = "select Id from BJKY_Examine..PersonConfig where ClerkIds like '%" + UserInfo.UserID + "%' and GroupType <>'系统部门'";//判定登陆人是不是员工
                //SqlCommand com = new SqlCommand(sql, conn);
                //conn.Open();
                //DataSet ds = new DataSet();
                //SqlDataAdapter da = new SqlDataAdapter(com);
                //da.Fill(ds);
                //conn.Close();
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    PageState.Add("IsClerk", "T");
                //}
                //else
                //{
                //    PageState.Add("IsClerk", "F");
                //}
                IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();
                string appcode = EXAMINING_APP_CODE;
                if (this.Request.QueryString["App"] != null && this.Request.QueryString["App"].Trim() != "")
                {
                    appcode = this.Request.QueryString["App"];
                }
                if (UserContext.AccessibleApplications.Count > 0)
                {
                    SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == appcode);
                    if (examApp != null && UserContext.AccessibleModules.Count > 0)
                    {
                        topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                        topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                    }
                }
                if (Session["PassCode"] == null)
                {
                    SqlDataAdapter sda = new SqlDataAdapter("select Id,WorkNo,UserName,SystemName from OgUser where SystemName='" + this.UserInfo.LoginName + "' ", System.Configuration.ConfigurationManager.ConnectionStrings["BJKY_BeAdmin"].ConnectionString);
                    DataTable      dt  = new DataTable();
                    sda.Fill(dt);
                    if (dt.Rows.Count > 0)
                    {
                        DataRow row      = dt.Rows[0];
                        string  template = "<Form Name='" + row["Id"] + "'><Id>" + row["Id"] + "</Id><WorkNo>" + row["WorkNo"] + "</WorkNo><UserName>" + row["UserName"] + "</UserName><SystemName>" + row["SystemName"] + "</SystemName><Password></Password><Field></Field></Form>";
                        string  passCode = "";
                        //  20140409 潘注释   不然导致首页加载非常慢
                        try
                        {
                            passCode = GoodwaySSO.Sso.LoginGW(template, row["Id"].ToString(), row["UserName"].ToString());
                        }
                        catch { }
                        PageState.Add("PassCode", passCode);
                        Session["PassCode"] = passCode;
                    }
                    else
                    {
                        Session["PassCode"] = "";
                    }
                }
                IList <SysApplication> saEnts = UserContext.AccessibleApplications.OrderBy(tens => tens.SortIndex).Where(ent => ent.Status == 1).ToArray();
                this.PageState.Add("Modules", saEnts);
                DataTable dtps = DataHelper.QueryDataTable("select  GroupID DeptId,Name DeptName from SysGroup where GroupID in (select BaseTemplateId from WebPartTemplate where BlockType='DeptPortal')");
                this.PageState.Add("Depts", DataHelper.DataTableToDictList(dtps));
                //在线人数
                int urs = 0;
                Aim.Portal.ServicesProvider.WebPortalServiceProvider uss = (Aim.Portal.ServicesProvider.WebPortalServiceProvider)WebPortalService.GetDefaultProvider();
                urs = Aim.Common.ServiceHelper.DeserializeFromBytes <SysUser[]>(uss.USService.GetSystemData("<container><parameters><parameter Name='SessionID'></parameter><parameter Name='Operation'>getonlineusers</parameter></parameters></container>")).Length;
                this.PageState.Add("UserOnLine", urs);
                //PopWin();
                break;
            }
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh")
            {
                try
                {
                    GoodwaySSO.Sso.Singletion.RefreshUserState(Session["PassCode"].ToString());
                }
                catch { }
                int urcts = DataHelper.QueryValue <int>(@"select count(UserID) from (
                select count(UserID)%2 cnt,UserID from SysEvent where DateTime>=dateadd(day,-2,GetDate()) and Type is null
                group by UserID) a where cnt>0");
                Response.Write(urcts);
                Response.End();
            }
            IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();
            string appcode = EXAMINING_APP_CODE;

            if (this.Request.QueryString["App"] != null && this.Request.QueryString["App"].Trim() != "")
            {
                appcode = this.Request.QueryString["App"];
            }
            if (UserContext.AccessibleApplications.Count > 0)
            {
                SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == appcode);
                if (examApp != null && UserContext.AccessibleModules.Count > 0)
                {
                    topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                    topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                }
            }
            if (Session["PassCode"] == null)
            {
                SqlDataAdapter sda = new SqlDataAdapter("select Id,WorkNo,UserName,SystemName from OgUser where SystemName='" + this.UserInfo.LoginName + "' ", System.Configuration.ConfigurationManager.ConnectionStrings["BJKY_BeAdmin"].ConnectionString);
                DataTable      dt  = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    DataRow row      = dt.Rows[0];
                    string  template = "<Form Name='" + row["Id"] + "'><Id>" + row["Id"] + "</Id><WorkNo>" + row["WorkNo"] + "</WorkNo><UserName>" + row["UserName"] + "</UserName><SystemName>" + row["SystemName"] + "</SystemName><Password></Password><Field></Field></Form>";
                    string  passCode = "";
                    try
                    {
                        passCode = GoodwaySSO.Sso.LoginGW(template, row["Id"].ToString(), row["UserName"].ToString());
                    }
                    catch { }
                    PageState.Add("PassCode", passCode);
                    Session["PassCode"] = passCode;
                }
                else
                {
                    Session["PassCode"] = "";
                }
            }

            IList <SysApplication> saEnts = UserContext.AccessibleApplications.OrderBy(tens => tens.SortIndex).Where(ent => ent.Status == 1).ToArray();

            this.PageState.Add("Modules", saEnts);
            DataTable dtps = DataHelper.QueryDataTable("select  GroupID DeptId,Name DeptName from SysGroup where GroupID in (select BaseTemplateId from WebPartTemplate where BlockType='DeptPortal')");

            this.PageState.Add("Depts", DataHelper.DataTableToDictList(dtps));
            //在线人数
            int urs = 0;

            urs = DataHelper.QueryValue <int>(@"select count(UserID) from (
            select count(UserID)%2 cnt,UserID from SysEvent where DateTime>=dateadd(day,-2,GetDate()) and Type is null
            group by UserID) a where cnt>0");
            this.PageState.Add("UserOnLine", urs);
            PopWin();
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SearchCriterion.DefaultPageSize = 50;
            id = RequestData.Get <string>("id", String.Empty);
            if (Request.QueryString["tag"] != null && Request.QueryString["tag"] == "Refresh")
            {
                Response.Write("");
                Response.End();
            }
            switch (RequestActionString)
            {
            case "querychildren":
                if (String.IsNullOrEmpty(id))
                {
                    sysgroupents = SysGroup.FindAll("FROM SysGroup as ent WHERE ParentId is null and (Type = 2 or Type = 3) Order By SortIndex asc");
                }
                else
                {
                    sysgroupents = SysGroup.FindAll("FROM SysGroup as ent WHERE ParentId = '" + id + "' and (Type = 2 or Type = 3) Order By SortIndex asc");
                }
                this.PageState.Add("DtList", sysgroupents);
                break;

            case "treerowselect":
                using (new Castle.ActiveRecord.SessionScope())
                {
                    ICriterion cirt = Expression.Sql("UserID IN (SELECT UserID FROM SysUserGroup WHERE GroupID = ?)", id, NHibernateUtil.String);
                    sysuserents = SysUserRule.FindAll(SearchCriterion, cirt);
                }
                this.PageState.Add("UsrList", sysuserents);
                break;

            case "sendmessage":
                SysMessage ent = new SysMessage();
                ent.SenderId       = UserInfo.UserID;
                ent.SenderName     = UserInfo.Name;
                ent.ReceiverId     = RequestData.Get <string>("ReceiverId");
                ent.ReceiverName   = RequestData.Get <string>("ReceiverName");
                ent.MessageContent = RequestData.Get <string>("MessageContent");
                ent.Attachment     = RequestData.Get <string>("Attachment");
                ent.SendTime       = System.DateTime.Now;
                ent.DoCreate();
                this.PageState.Add("entity", ent);
                break;

            case "chanagestate":
                IList <string> idList = RequestData.GetList <string>("IdArray");
                if (idList != null && idList.Count > 0)
                {
                    foreach (object obj in idList)
                    {
                        DataHelper.ExecSql("update SysMessage set IsRead='True' where Id='" + obj.ToString() + "'");
                    }
                }
                break;

            case "unreadmessage":
                string receiverId = RequestData.Get <string>("ReceiverId");
                string sql        = string.Empty;
                if (!string.IsNullOrEmpty(receiverId))
                {
                    sql = "select * from SysMessage where IsRead is null and ReceiverId='{0}' and SenderId='{1}'order by SendTime asc";
                    sql = string.Format(sql, UserInfo.UserID, receiverId);
                }
                else
                {
                    sql = @"select * from SysMessage where IsRead is null and ReceiverId='{0}' and 
                        SenderId=(select top(1) SenderId from  SysMessage where IsRead is null and ReceiverId='{1}' order by SendTime asc) order by SendTime asc";
                    sql = string.Format(sql, UserInfo.UserID, UserInfo.UserID);
                }
                IList <EasyDictionary> dicts = DataHelper.QueryDictList(sql);
                PageState.Add("unreadmessage", dicts);
                break;

            default:
                SysGroup[] grpList = SysGroup.FindAll("From SysGroup as ent where ParentId is null and (Type = 2 or Type = 21) Order By SortIndex, CreateDate Desc");
                this.PageState.Add("DtList", grpList);
                break;
            }
            IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();

            if (UserContext.AccessibleApplications.Count > 0)
            {
                SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == EXAMINING_APP_CODE);

                if (examApp != null && UserContext.AccessibleModules.Count > 0)
                {
                    topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                    topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                }
            }
            this.PageState.Add("Modules", topAuthExamMdls);
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (RequestActionString == "changeCorp")
            {
                string corpdeptId = RequestData.Get <string>("corpdeptId");
                UserContext.ExtData["CompanyId"] = corpdeptId;
                Session["CompanyId"]             = corpdeptId;

                //公司
                SysGroup group = SysGroup.TryFind(corpdeptId);
                if (group != null)
                {
                    UserContext.ExtData["CompanyName"] = group.Name;
                }
                else
                {
                    UserContext.ExtData["CompanyName"] = "";
                }
                PageState.Add("corpdeptId", corpdeptId);
                return;
            }

            IEnumerable <SysModule> topAuthExamMdls = new List <SysModule>();
            string appcode = EXAMINING_APP_CODE;

            if (this.Request.QueryString["App"] != null && this.Request.QueryString["App"].Trim() != "")
            {
                appcode = this.Request.QueryString["App"];
            }
            if (UserContext.AccessibleApplications.Count > 0)
            {
                SysApplication examApp = UserContext.AccessibleApplications.FirstOrDefault(tent => tent.Code == appcode);
                if (examApp != null && UserContext.AccessibleModules.Count > 0)
                {
                    topAuthExamMdls = UserContext.AccessibleModules.Where(tent => tent.ApplicationID == examApp.ApplicationID && String.IsNullOrEmpty(tent.ParentID));
                    topAuthExamMdls = topAuthExamMdls.OrderBy(tent => tent.SortIndex);
                }
            }

            //查询是不是多公司

            /*SysUser userent = SysUser.Find(UserInfo.UserID);
             * string sql = @"select *, GroupId as corpId, GroupId as corpName, GroupId as deptId, GroupId as deptName from SysUserGroup where UserId='{0}'
             *                     and GroupId not in (select RoleId from sysRole) and isnull(outdutydate,'')='' and pk_gw is not null";
             * DataTable dtgroup = DataHelper.QueryDataTable(string.Format(sql, userent.UserID));
             * string corpId = "";
             * string corpName = "";
             * string deptId = "";
             * string deptName = "";
             * foreach (DataRow row in dtgroup.Rows)
             * {
             *  corpId = "";
             *  corpName = "";
             *  deptName = "";
             *  deptId = row["GroupId"] + "";
             *  getDeptInfo(ref corpId, ref corpName, deptId, ref deptName);
             *  row["corpId"] = corpId;
             *  row["corpName"] = corpName;
             * }
             * PageState.Add("gsbms", DataHelper.DataTableToDictList(dtgroup));
             * PageState.Add("corpdeptId", Session["CompanyId"]);*/

            if (Session["CompanyId"] == null)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "adsf", "window.parent.location.href='/Login.aspx'", true);
            }
            else
            {
                PageState.Add("CompanyName", SysGroup.Find(Session["CompanyId"]).Name);
            }

            //if (this.Request.QueryString["App"] != null && this.Request.QueryString["App"].Trim() != "")
            //{
            //    appcode = this.Request.QueryString["App"];
            //}
            //IList<SysApplication> saEnts = UserContext.AccessibleApplications.OrderBy(tens => tens.SortIndex).Where(ent => ent.Status == 1).ToArray();
            PageState.Add("Modules", topAuthExamMdls);
        }