示例#1
0
        //
        private void DoSelect()
        {
            string sort = RequestData.Get("sort") + "";
            string tp   = RequestData.Get("tp") + ""; //my个人积分 mgr 管理员

            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    default:
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%' ";
                        break;
                    }
                }
            }
            string sql = " select * from FL_Culture..V_SurveyScore where UserName is not null  ";

            if (tp.Contains("mgr"))   //角色验证-->配置
            {
                CommPowerSplit ps = new CommPowerSplit();
                if (ps.IsScoreRole(UserInfo.UserID, UserInfo.LoginName))
                {
                    this.PageState.Add("Power", "1");
                }
                else //分公司判断
                {
                    string          corp = string.Empty;
                    UserContextInfo UC   = new UserContextInfo();
                    corp = UC.GetUserCurrentCorpId(UserInfo.UserID);

                    this.PageState.Add("Power", "1");
                    where += " and CorpId='" + corp + "' ";
                }
            }
            else if (tp.Contains("my")) //个人
            {
                where += " and UserID='" + UserInfo.UserID + "' ";
                this.PageState.Add("Power", "0");
            }

            sql += where;
            this.PageState.Add("DataList", GetPageData(sql, SearchCriterion));
        }