public void findCheapestBestHotel(DateTime firstDate, DateTime lastDate, customerType type) { total_Days = Convert.ToInt32(lastDate.Subtract(firstDate).TotalDays) + 1; WeekendDays = total_WeekendDays(firstDate, lastDate); WeekDays = total_Days - WeekendDays; HotelDetail cheapestBestHotel = new HotelDetail(); int cheapestRate = 0; List <HotelDetail> hotel_list = CustomerBased_hotelList[type]; hotel_list.Sort((x, y) => ((getTotalRate(x)).CompareTo(getTotalRate(y)))); cheapestRate = getTotalRate(hotel_list.First()); cheapestBestRatedHotelsList = hotel_list.FindAll(x => getTotalRate(x).Equals(cheapestRate)); cheapestBestRatedHotelsList.Sort((x, y) => (y.Rating).CompareTo(x.Rating)); Console.WriteLine("Cheapest Rated Hotels are as follows: "); int bestCheapestRating = cheapestBestRatedHotelsList.First().Rating; foreach (var hotel in cheapestBestRatedHotelsList.FindAll(x => x.Rating.Equals(bestCheapestRating))) { Console.WriteLine(hotel.Name + " Rating is :" + hotel.Rating + " Total Cost :" + " " + getTotalRate(hotel)); } Console.WriteLine("\n "); }
public Customer(customerType type, string name, int age) { Type = type; Name = name; Age = age; Console.WriteLine($"{Type} customer created - {Name}, {Age}"); }
public static void customerType(customerType request) { if (null != request) { if (0 <= request.type) { request.typeSpecified = true; } } }
public void FindBestRatedHotel(DateTime firstDate, DateTime lastDate, customerType type) { total_Days = Convert.ToInt32(lastDate.Subtract(firstDate).TotalDays) + 1; WeekendDays = total_WeekendDays(firstDate, lastDate); WeekDays = total_Days - WeekendDays; List <HotelDetail> hotel_list = CustomerBased_hotelList[type]; hotel_list.Sort((x, y) => (x.Rating).CompareTo(y.Rating)); int BestRating = (hotel_list.Last()).Rating; Console.WriteLine("Best Rated Hotels are as follows "); foreach (var hotel in hotel_list.FindAll(x => x.Rating.Equals(BestRating))) { Console.WriteLine(hotel.Name + " Rating is :" + hotel.Rating + " Total Cost :" + " " + getTotalRate(hotel)); } Console.WriteLine("\n"); }
private void radioButtonWholeSale_CheckedChanged(object sender, EventArgs e) { radioButtonRetail.Checked = false; customer = customerType.wholesale; cust.customer = customerType.wholesale; }
public void SetUp() { MockContext = new MockFactory(); //initialize counter Counter = _random.Next(1, (int)(Math.Pow(2, 24))); CounterStr = GetRandomString(""); _now = DateTime.UtcNow; _nowString = _now.ToString(DateFormat); _pastDate = _now.AddMonths(-1); _nowDate = _now; _futureDate = _now.AddMonths(1); CustomMerchantAuthenticationType = new merchantAuthenticationType { name = ApiLoginIdKey, ItemElementName = ItemChoiceType.transactionKey, Item = TransactionKey, }; // merchantAuthenticationType.setSessionToken(GetRandomString("SessionToken")); // merchantAuthenticationType.setPass_word(GetRandomString("Pass_word")); // merchantAuthenticationType.setMobileDeviceId(GetRandomString("MobileDevice")); // ImpersonationAuthenticationType impersonationAuthenticationType = new ImpersonationAuthenticationType(); // impersonationAuthenticationType.setPartnerLoginId(CnpApiLoginIdKey); // impersonationAuthenticationType.setPartnerTransactionKey(CnpTransactionKey); // merchantAuthenticationType.setImpersonationAuthentication(impersonationAuthenticationType); CustomerProfileType = new customerProfileType { merchantCustomerId = GetRandomString("Customer"), description = GetRandomString("CustomerDescription"), email = CounterStr + "*****@*****.**", }; //make sure these elements are initialized by calling get as it uses lazy initialization var paymentProfiles = CustomerProfileType.paymentProfiles; var addresses = CustomerProfileType.shipToList; CreditCardOne = new creditCardType { cardNumber = "4111111111111111", expirationDate = "2038-12", }; // creditCardOne.setCardCode(""); BankAccountOne = new bankAccountType { accountType = bankAccountTypeEnum.savings, routingNumber = "125000000", accountNumber = GetRandomString("A/C#"), nameOnAccount = GetRandomString("A/CName"), echeckType = echeckTypeEnum.WEB, bankName = GetRandomString("Bank"), checkNumber = CounterStr, }; TrackDataOne = new creditCardTrackType { ItemElementName = ItemChoiceType1.track1, Item = GetRandomString("Track1"), //trackDataOne.setTrack2(GetRandomString("Track2")); }; EncryptedTrackDataOne = new encryptedTrackDataType { FormOfPayment = new KeyBlock(), }; //keyBlock.setValue(value); PayPalOne = new payPalType { successUrl = GetRandomString("https://success.anet.net"), cancelUrl = GetRandomString("https://cancel.anet.net"), paypalLc = GetRandomString("Lc"), paypalHdrImg = GetRandomString("Hdr"), paypalPayflowcolor = GetRandomString("flowClr"), payerID = GetRandomString("PayerId"), }; PaymentOne = new paymentType { Item = CreditCardOne }; //paymentOne.setBankAccount(bankAccountOne); //paymentOne.setTrackData(trackDataOne); //paymentOne.setEncryptedTrackData(encryptedTrackDataOne); //paymentOne.setPayPal( payPalOne); // driversLicenseOne = new DriversLicenseType(); // driversLicenseOne.setNumber(GetRandomString("DLNumber")); // driversLicenseOne.setState(GetRandomString("WA")); // driversLicenseOne.setDateOfBirth(nowString); CustomerAddressOne = new customerAddressType { firstName = GetRandomString("FName"), lastName = GetRandomString("LName"), company = GetRandomString("Company"), address = GetRandomString("StreetAdd"), city = "Bellevue", state = "WA", zip = "98000", country = "USA", phoneNumber = FormatToPhone(Counter), faxNumber = FormatToPhone(Counter + 1), }; CustomerPaymentProfileOne = new customerPaymentProfileType { customerType = customerTypeEnum.individual, payment = PaymentOne, }; // customerPaymentProfileOne.setBillTo(customerAddressOne); // customerPaymentProfileOne.setDriversLicense(driversLicenseOne); // customerPaymentProfileOne.setTaxId(GetRandomString("XX")); CustomerOne = new customerType { type = customerTypeEnum.individual, id = GetRandomString("Id"), email = CounterStr + "*****@*****.**", phoneNumber = FormatToPhone(Counter), faxNumber = FormatToPhone(Counter + 1), driversLicense = DriversLicenseOne, taxId = "911011011", }; CustomerTwo = new customerType(); var interval = new paymentScheduleTypeInterval { length = 1, unit = ARBSubscriptionUnitEnum.months, }; OrderType = new orderType() { //TODO ADD VALIDATION ON INVOICE LENGTH invoiceNumber = GetRandomString("Inv:"), description = GetRandomString("Description"), }; NameAndAddressTypeOne = new nameAndAddressType { firstName = GetRandomString("FName"), lastName = GetRandomString("LName"), company = GetRandomString("Company"), address = GetRandomString("Address"), city = GetRandomString("City"), state = GetRandomString("State"), zip = "98004", country = "USA", }; NameAndAddressTypeTwo = new nameAndAddressType { firstName = GetRandomString("FName"), lastName = GetRandomString("LName"), company = GetRandomString("Company"), address = GetRandomString("Address"), city = GetRandomString("City"), state = GetRandomString("State"), zip = "98004", country = "USA", }; PaymentScheduleTypeOne = new paymentScheduleType { interval = interval, startDate = _nowDate, totalOccurrences = 5, trialOccurrences = 0, }; ArbSubscriptionOne = new ARBSubscriptionType { amount = SetValidSubscriptionAmount(Counter), billTo = NameAndAddressTypeOne, customer = CustomerOne, name = GetRandomString("Name"), order = OrderType, payment = PaymentOne, paymentSchedule = PaymentScheduleTypeOne, shipTo = NameAndAddressTypeOne, trialAmount = SetValidSubscriptionAmount(0), }; CustomerDataOne = new customerDataType { driversLicense = CustomerOne.driversLicense, email = CustomerOne.email, id = CustomerOne.id, taxId = CustomerOne.taxId, type = CustomerOne.type, }; RefId = CounterStr; }
protected Account(string customer, customerType customerType, float interestRate) { Customer = customer; CustomerType = customerType; InterestRate = interestRate; }
public MortgageAccount(string customer, customerType customerType, float interestRate) : base(customer, customerType, interestRate) { }
public DepositAccount(string customer, customerType customerType, float interestRate) : base(customer, customerType, interestRate) { }