private void DoSelect() { CommPowerSplit ps = new CommPowerSplit(); if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName)) { this.PageState.Add("IsCanGrant", "1"); SearchCriterion.SetSearch("IsFixed", "1"); // SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } else { string SQL = @"select * from SysRole As A inner join SysUserRole As B on A.RoleID=B.RoleID where A.Code='PubSurvey' and B.UserId='{0}'"; SQL = string.Format(SQL, UserInfo.UserID); object obj = DataHelper.QueryValue(SQL); if (obj == null) { if (Session["CompanyId"] != null) { string CorpId = Session["CompanyId"].ToString(); CorpId = !string.IsNullOrEmpty(CorpId) ? CorpId : "1007"; SearchCriterion.SetSearch("CompanyId", CorpId); } } SearchCriterion.SetSearch("IsFixed", "1"); // SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } }
private void DoSelect() { CommPowerSplit ps = new CommPowerSplit(); if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName)) { SearchCriterion.SetSearch("IsFixed", "2"); //固定问卷 SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } else { SearchCriterion.SetSearch("IsFixed", "2"); //固定问卷 string CompanyId = string.Empty; //公司ID //first depend login corpid var Ent = SysUser.Find(UserInfo.UserID); UserContextInfo UC = new UserContextInfo(); CompanyId = UC.GetUserCurrentCorpId(UserInfo.UserID); SearchCriterion.AddSearch("CompanyId", CompanyId); SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } }
protected void Page_Load(object sender, EventArgs e) { SurveyQuestion[] arr = SurveyQuestion.FindAll(); //Response.Write(Razor.JsonHelper.GetJsonString(arr)); Response.Write(arr[0].ToString()); arr[0].RazorPropertyChanged += _Default_RazorPropertyChanged; arr[0].SurveyTitile = "sssss"; Response.Write("<br/>"); // Response.Write(SurveyQuestion.TableName); //SurveyQuestion Ent = new SurveyQuestion(); }