/// <summary> /// Returns a new ADO.net BLAddress model defined by the parameters given. /// </summary> /// <param name="type"></param> /// <param name="street"></param> /// <param name="suburb"></param> /// <param name="state"></param> /// <param name="zip"></param> /// <returns></returns> public static BLAddress fillAddress(char type, string street, string suburb, string state, int zip) { BLAddress address = new BLAddress { addType = type, addStreet = street, addSuburb = suburb, addState = state, addZip = zip }; return(address); }
/// <summary> /// Update user's information using row of table from SQL database. /// </summary> /// <param name="userData"></param> private void fillUser(DataRow userData) { userID = Convert.ToInt32(userData["userID"]); userFirstName = userData["userFirstName"].ToString(); userLastName = userData["userLastName"].ToString(); userEmail = userData["userEmail"].ToString(); userPhone = userData["userPhone"].ToString(); userPassword = userData["userPassword"].ToString(); userAdmin = Convert.ToBoolean(userData["userAdmin"]); userActive = Convert.ToBoolean(userData["userActive"]); billAddress = !userAdmin ? new BLAddress().getAddress(userID, 'B') : billAddress = null; postAddress = new BLAddress().getAddress(userID, 'P'); }