public List <UserAdminProfile> ListAdminPrifileWithUID(int AdminID) { if (!this.dt.OpenConnection()) { return(null); } string sql = "select * from UserAdminProfile where AdminID=@AdminID"; SqlParameter pAdminID = new SqlParameter("@AdminID", AdminID); DataTable tb = dt.DATable(sql, pAdminID); List <UserAdminProfile> lst = new List <UserAdminProfile>(); foreach (DataRow r in tb.Rows) { UserAdminProfile up = new UserAdminProfile(); up.ProfileID = (int)r["ProfileID"]; up.AdminID = (int)r["AdminID"]; up.FirstName = (string.IsNullOrEmpty(r["FirstName"].ToString())) ? "" : (string)r["FirstName"]; up.LastName = (string.IsNullOrEmpty(r["LastName"].ToString())) ? "" : (string)r["LastName"]; up.Sex = (string.IsNullOrEmpty(r["Sex"].ToString())) ? false : (Boolean)r["Sex"]; up.Birthday = (string.IsNullOrEmpty(r["Birthday"].ToString())) ? DefaultDate : (DateTime)r["Birthday"]; up.UserAddress = (string.IsNullOrEmpty(r["UserAddress"].ToString())) ? "" : (string)r["UserAddress"]; up.Images = (string.IsNullOrEmpty(r["Images"].ToString())) ? 0 : (int)r["Images"]; up.ProfileStatus = (string.IsNullOrEmpty(r["ProfileStatus"].ToString())) ? false : (Boolean)r["ProfileStatus"]; up.DateOfStart = (DateTime)r["DateOfStart"]; lst.Add(up); } this.dt.CloseConnection(); return(lst); }
protected Boolean checkUserStaus(int adminid) { useradminprofile = new UserAdminProfileBLL(); List <UserAdminProfile> lst = useradminprofile.ListAdminPrifileWithUID(adminid); UserAdminProfile pro = lst.FirstOrDefault(); return(pro.ProfileStatus); }