private void LoadFromRow(DataRow row ) { if (row != null) { ID = Convert.ToInt32(row["UserID"]); _name = Utils.sqlQuoteToHTML(row["Name"].ToString()); _username = Utils.sqlQuoteToHTML(row["Name"].ToString()); _firstName = Utils.sqlQuoteToHTML(row["FirstName"].ToString()); _lastName = Utils.sqlQuoteToHTML(row["LastName"].ToString()); if (row.Table.Columns.Contains("password")) _password = row["password"].ToString(); try { _addr = new Address(row); _address = _addr.PostalAddress; _postcode = _addr.Postcode; _emailAddress = _addr.EMail; _isApproved = (Convert.ToByte(row["IsApproved"]) == 1); if (row["LastLoginDate"] != DBNull.Value) LastLoginDate = Convert.ToDateTime(row["LastLoginDate"]); _roles = Convert.ToInt32(row["Roles"]); } catch (Exception e) { AppException.LogEvent(String.Format("UserBiz.Address.LoadFromRow: UserID:{0}, UserName:{1} - error:{2} (innerException:{3})", ID, _username, e.Message, e.InnerException)); } } else { _name = ""; _addr = new Address(); } }
public User() { _user = new data.User(_moduleSettings); _addr = new Address(); }
public int Create() { _addr = new Address(); int addrid = _addr.Add(Utils.HTMLToSqlQuote(_address), _postcode, _home, _mobile, _emailAddress, ""); ID = _user.Create( Utils.HTMLToSqlQuote(_name), _password, Utils.HTMLToSqlQuote(_firstName), Utils.HTMLToSqlQuote(_lastName), addrid, _emailAddress); return ID; }