public SiteMember(int userId) { DataRow dr = MemberManage.GetUserInfo(userId); if (dr != null) { FillHelper.Fill(dr, this); } }
public SiteMember(string userName) { if (string.IsNullOrEmpty(userName) == true) { throw new ArgumentException("loginName is null or empty"); } DataRow dr = MemberManage.GetUserInfo(userName); if (dr != null) { FillHelper.Fill(dr, this); } }
void btnSave_Click(object sender, EventArgs e) { SiteMember sm = new SiteMember(userId); sm.IsPass = cbIsPass.Checked; sm.Update(); DataRow dr = MemberManage.GetUserInfo(userId); if (cbIsPass.Checked) { Roles.AddUsersToRoles(new string[] { dr["UserName"].ToString() }, new string[] { "Admin" }); } }