コード例 #1
0
ファイル: InitialState.cs プロジェクト: Zerodisk/TestOOP
 public InitialState(ProcessBooking bookingProc)
     : base(bookingProc.Booking)
 {
     this.bookingProc = bookingProc;
     SupplierFactory factory = new SupplierFactory();
     supplier = factory.GetSupplier(bookingProc.Booking);
 }
コード例 #2
0
        //Adds a new supplier to the DB-Grace
        public bool AddNewSupplier(int supplierID, string name, string phoneNum, string email, string street, string city, string county, string additionalInfo)
        {
            SupplierList = DataLayer.getAllSuppliers();
            ISupplier supplier;

            DataLayer.AddNewSupplierToDB(supplierID, name, phoneNum, email, street, city, county, additionalInfo);
            supplier = SupplierFactory.GetSupplier(supplierID, name, phoneNum, email, street, city, county, additionalInfo);   // Using a Factory to create the user entity object. ie seperating object creation from business logic
            SupplierList.Add(supplier);
            // Add a reference to the newly created object to the Models UserList
            //Gets the DataLayer to add the new user to the DB.
            return(true);
        }
コード例 #3
0
 public Boolean addnewSupplier(string SupplierID, string CompanyName, string Email, string Phone, string Street, string City, string County, string Country)
 {
     try
     {
         ISupplier theSupplier = SupplierFactory.GetSupplier(SupplierID, CompanyName, Email, Phone, Street, City, County, Country); // Using a Factory to create the user entity object. ie seperating object creation from business logic
         SupplierList.Add(theSupplier);                                                                                             // Add a reference to the newly created object to the Models UserList
         DataLayer.addNewSupplierToDB(theSupplier);                                                                                 //Gets the DataLayer to add the new user to the DB.
         return(true);
     }
     catch (System.Exception excep)
     {
         return(false);
     }
 }