protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.txtUserName.Attributes["ReadOnly"] = "true"; if (base.Request["action"].ToString() == "update") { DataTable corpRole = FlowRoleAction.GetCorpRole(base.Request["uid"].ToString()); this.hfldUserCode.Value = corpRole.Rows[0]["UserCode"].ToString(); this.txtUserName.Text = corpRole.Rows[0]["v_xm"].ToString(); string text = corpRole.Rows[0]["CorpCode"].ToString(); string[] t = ( from c in text.Split(new char[] { ',' }) where c.Length > 1 select c).ToArray <string>(); this.hfldCorpCode.Value = JsonHelper.JsonSerializer <string[]>(t); DataTable corpTable = FlowRoleAction.GetCorpTable(corpRole.Rows[0]["CorpCode"].ToString()); this.gvCorpList.DataSource = corpTable; this.gvCorpList.DataBind(); return; } DataTable dataSource = new DataTable(); this.gvCorpList.DataSource = dataSource; this.gvCorpList.DataBind(); } }
public void BindGv() { if (this.hfldCorpCode.Value.Length >= 2) { string text = this.hfldCorpCode.Value.Substring(1, this.hfldCorpCode.Value.Length - 2); text = text.Replace('"', '\''); DataTable corpTable = FlowRoleAction.GetCorpTable(text); this.gvCorpList.DataSource = corpTable; this.gvCorpList.DataBind(); return; } DataTable dataSource = new DataTable(); this.gvCorpList.DataSource = dataSource; this.gvCorpList.DataBind(); }