public ResidentAppBL() { app = new ApplicationResidentApplication(); applicants = new List <ApplicationApplicant>(); pets = new List <ApplicationPets>(); others = new List <ApplicationOccupants>(); }
private int CreateApp(ApplicationResidentApplication app) { SqlCommand cmd = new SqlCommand("insert into Application values (@applicants, @occupants, @pets, @vehicles, @propertyid); SELECT CAST(scope_identity() AS int);"); cmd.Parameters.Add("@applicants", SqlDbType.Int).Value = app.Applicants; cmd.Parameters.Add("@occupants", SqlDbType.Int).Value = app.Occupants; cmd.Parameters.Add("@pets", SqlDbType.Int).Value = app.Pets; cmd.Parameters.Add("@vehicles", SqlDbType.Int).Value = app.Vehicles; cmd.Parameters.Add("@propertyid", SqlDbType.Int).Value = 1; return((int)ExecuteScalar(cmd)); }
public void StoreApplicationData(ApplicationResidentApplication appInfo, List <ApplicationApplicant> applicantsInfo, List <ApplicationPets> petInfo, List <ApplicationOccupants> othersInfo) { int AppID = CreateApp(appInfo); StoreApplicants(applicantsInfo, AppID); }