Further major refactoring of code
This is another commit to mostly version the code. There have been a considerable number of changes and there is functionality that I am still determining whether it should lie within the manager or the model class itself. It makes the most sense to possibly add the "Update" or database manipulation functions on the models themselves. On the other hand, instead of creating and generating the ID in the model, the current design is to create the entry in the database first, get the last insert row ID and create a new and complete model that is returned back by the function. This allows us to leverage the autoincrement functionality of the database rather than trying to design a function and/ or make an additional call to the database. **NOTE: Code is non-functional due to some classes not having their errors resolved.
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Ophelias.Models;
|
||||
using System.Net.Mail;
|
||||
|
||||
namespace Ophelias.Models
|
||||
{
|
||||
@@ -14,34 +13,30 @@ namespace Ophelias.Models
|
||||
internal string FirstName;
|
||||
internal string LastName;
|
||||
internal string Email;
|
||||
internal string PhoneNumber;
|
||||
internal string? CreditCard;
|
||||
internal string? CCV;
|
||||
internal DateTime CreditCardExpiration;
|
||||
internal string? Expiration;
|
||||
|
||||
internal Guest(int id, string fname, string lname, string email, string phone)
|
||||
internal Guest(string FirstName, string LastName, string Email)
|
||||
{
|
||||
Id = id;
|
||||
FirstName = fname;
|
||||
LastName = lname;
|
||||
Email = email;
|
||||
PhoneNumber = phone;
|
||||
this.FirstName = FirstName;
|
||||
this.LastName = LastName;
|
||||
this.Email = Email;
|
||||
}
|
||||
internal Guest(int id, string fname, string lname, string email, string phone, string cc, DateTime expiration, string ccv)
|
||||
internal Guest(string FirstName, string LastName, string Email, string CreditCard, string Expiration, string CCV)
|
||||
{
|
||||
Id = id;
|
||||
FirstName = fname;
|
||||
LastName = lname;
|
||||
Email = email;
|
||||
PhoneNumber = phone;
|
||||
CreditCard = cc;
|
||||
CreditCardExpiration = expiration;
|
||||
this.FirstName = FirstName;
|
||||
this.LastName = LastName;
|
||||
this.Email = Email;
|
||||
this.CreditCard = CreditCard;
|
||||
this.Expiration = Expiration;
|
||||
this.CCV = CCV;
|
||||
}
|
||||
internal void SetCreditCardInformation(string cc, DateTime expiration, string ccv)
|
||||
internal void SetCreditCardInformation(string CreditCard, string Expiration, string CCV)
|
||||
{
|
||||
CreditCard = cc;
|
||||
CreditCardExpiration = expiration;
|
||||
CCV = ccv;
|
||||
this.CreditCard = CreditCard;
|
||||
this.Expiration = Expiration;
|
||||
this.CCV = CCV;
|
||||
}
|
||||
}
|
||||
internal class GuestList
|
||||
|
||||
Reference in New Issue
Block a user