Ejemplo n.º 1
0
        public ActionResult Index(string ans = "", string username = "")
        {
            if (username == "")
            {
                return(View());
            }
            else if (ans == "a")
            {
                try
                {
                    CustomerClass User = Repo.LoadCustomerByUsername(username); // check to see if username exists

                    return(RedirectToAction(nameof(AddAddress), new { username = User.Username }));
                }
                catch
                {
                    return(View());
                }
            }
            else
            {
                try
                {
                    CustomerClass User = Repo.LoadCustomerByUsername(username); // check to see if username exists
                    TempData["user"] = username;
                    return(RedirectToAction(nameof(PlaceOrder)));
                }
                catch
                {
                    return(View());
                }
            }
        }
 private void MakePayment_button_Click(object sender, RoutedEventArgs e)
 {
     if (Surname_ManageBooking_combo.Items.Count == 0)
     {
         MessageBox.Show("Please search for a customer to make payment");
     }
     else
     {
         int chosenCustomerID = int.Parse(this.Surname_ManageBooking_combo.SelectedValue.ToString());
         if (AvailableBookings_DataGrid.SelectedIndex == 1)
         {
             MessageBox.Show("Empty row - Please select a valid booking");
         }
         else
         {
             if (CustomerClass.getAllBookkingsMadeByCustomer(chosenCustomerID).Tables[0].Rows.Count == 0)
             {
                 MessageBox.Show("No Booking available for payment");
             }
             else
             {
                 DataRowView chosenRow = (DataRowView)AvailableBookings_DataGrid.SelectedItem;
                 int         chosenId  = int.Parse(chosenRow["Booking_Id"].ToString());
                 BookingsClass.payBooking(chosenId);
                 MessageBox.Show("Payment complete");
             }
         }
     }
 }
        //---------------------------------------------- Edit/Delete Member  Tab ------------------------------------------------------//

        private void SurnameSearch_EditDel_buttonClick(object sender, RoutedEventArgs e)
        {
            string surname = Surname_EditDel_txt.Text.ToString();

            if (surname.Length == 0)
            {
                MessageBox.Show("Please enter a customer to search for");
            }
            else
            {
                dataSet = CustomerClass.getCustomerByLastName(Surname_EditDel_txt.Text.ToString());
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Customer not found - Try entering another customer name or check spelling");
                }
                else
                {
                    this.Surname_EditDel_combo.Items.Clear();
                    this.Surname_EditDel_combo.SelectedValuePath = "Key";
                    this.Surname_EditDel_combo.DisplayMemberPath = "Value";

                    foreach (DataRow row in dataSet.Tables[0].Rows)
                    {
                        this.Surname_EditDel_combo.Items.Add(new KeyValuePair <int, string>(int.Parse(row["Customer_Id"].ToString()), row["First_Name"].ToString() + " " + row["Last_Name"].ToString() + " - " + row["Email"]));
                    }
                }
            }
        }
        public IActionResult Modify(CustomerClass model)
        {
            if (!_loginServices.isInAdminRoles(this.GetRoles()))
            {
                return(RedirectToAction("Login", "Accounts"));
            }

            if (ModelState.IsValid)
            {
                if (model.ID <= 0)
                {
                    model.Create_On = DateUtil.Now();
                    model.Create_By = this.HttpContext.User.Identity.Name;
                    model.Update_On = DateUtil.Now();
                    model.Update_By = this.HttpContext.User.Identity.Name;
                    this._context.CustomerClasses.Add(model);
                    this._context.SaveChanges();
                    return(RedirectToAction("Index"));
                }
                else
                {
                    model.Update_On = DateUtil.Now();
                    model.Update_By = this.HttpContext.User.Identity.Name;

                    this._context.Update(model);
                    this._context.SaveChanges();

                    return(RedirectToAction("Index"));
                }
            }

            return(View("CustomerClassInfo", model));
        }
        public IActionResult Delete()
        {
            if (!_loginServices.isInAdminRoles(this.GetRoles()))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            string        idParam = this.RouteData.Values["id"].ToString();
            CustomerClass model   = null;

            if (idParam != null && idParam != string.Empty)
            {
                int recordId = Int32.Parse(idParam);
                model = this._context.CustomerClasses.Where(a => a.ID == recordId).FirstOrDefault();
                if (model == null)
                {
                    ModelState.AddModelError("Error", "ไม่พบข้อมูล");
                }
                else
                {
                    this._context.CustomerClasses.Remove(model);
                    this._context.SaveChanges();
                }
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 6
0
        private void CustomersTabComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string customerName = e.AddedItems[0].ToString();

            CustomerClass newCustomer = CustomerList.First(x => x.CustomerName == customerName);

            CustomerName.Text        = newCustomer.CustomerName;
            CustomerPhoneNumber.Text = newCustomer.CustomerPhone;
            CustomerAddress.Text     = newCustomer.CustomerAddress;
            CustomerZipCode.Text     = newCustomer.CustomerZipCode;
            CustomerCity.Text        = newCustomer.CustomerCity;



            #region OLD
            //switch (customerName)
            //{
            //    case "Lisa Underwood":
            //        //var message = new MessageDialog(DataContextProperty.ToString());
            //        var message = new MessageDialog("CustomersTab ComboBox Changed");
            //        await message.ShowAsync();
            //        break;
            //}

            #endregion
        }
Ejemplo n.º 7
0
 private void Save()
 {
     try
     {
         using (IUnitOfWork w = new UnitOfWork())
         {
             CustomersClassesRepository custClassesRepos = (CustomersClassesRepository)w.CustomersClasses;
             Console.WriteLine("At Save Method Customer Classes List Count = " + _customersClassesList.Count);
             foreach (var customerClass in _customersClassesList)
             {
                 CustomerClassFields f = customerClass;
                 CustomerClass       existCustomerClass = custClassesRepos.GetById(f.CustomerId);
                 if (existCustomerClass != null)
                 {
                     existCustomerClass.Class = f.CustomerClass;
                 }
                 else
                 {
                     CustomerClass dbCustomerClass = new CustomerClass();
                     dbCustomerClass.CustomerId = f.CustomerId;
                     dbCustomerClass.Class      = f.CustomerClass;
                     custClassesRepos.Add(dbCustomerClass);
                 }
             }
             w.Save();
         }
         MaintainSate(InternalState.Saved);
     }
     catch (Exception ex)
     {
         Helper.LogShowError(ex);
         MaintainSate(InternalState.Failed);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor used to create an order. This is the one from the database
 /// </summary>
 public Order(Location location, CustomerClass customer, int orderID, DateTime dateOfOrder)
 {
     Location = location;
     Customer = customer;
     Date     = dateOfOrder;
     OrderID  = orderID;
 }
        public void testGetAllCustomers()
        {
            dataSet = CustomerClass.getAllCustomers();

            string actualFirstNameRow0          = dataSet.Tables[0].Rows[0]["First_Name"].ToString();
            string actualLastNameRow0           = dataSet.Tables[0].Rows[0]["Last_Name"].ToString();
            string actualEmailRow0              = dataSet.Tables[0].Rows[0]["Email"].ToString();
            string actualGoldClubMembershipRow0 = dataSet.Tables[0].Rows[0]["Membership_Expiry_Date"].ToString();

            string expectedFirstNameRow0          = "DeletedCustomerFirstName";
            string expectedLastNameRow0           = "DeletedCustomerLastName";
            string expectedEmailRow0              = "";
            string expectedGoldClubMembershipRow0 = "";

            string actualFirstNameRow1          = dataSet.Tables[0].Rows[1]["First_Name"].ToString();
            string actualLastNameRow1           = dataSet.Tables[0].Rows[1]["Last_Name"].ToString();
            string actualEmailRow1              = dataSet.Tables[0].Rows[1]["Email"].ToString();
            string actualGoldClubMembershipRow1 = dataSet.Tables[0].Rows[1]["Membership_Expiry_Date"].ToString();

            string expectedFirstNameRow1          = "CustomerFirstNameEdited";
            string expectedLastNameRow1           = "CustomerLastNameEdited";
            string expectedEmailRow1              = "*****@*****.**";
            string expectedGoldClubMembershipRow1 = "2017-12-28";

            Assert.AreEqual(expectedFirstNameRow0, actualFirstNameRow0);
            Assert.AreEqual(expectedLastNameRow0, actualLastNameRow0);
            Assert.AreEqual(expectedEmailRow0, actualEmailRow0);
            Assert.AreEqual(expectedGoldClubMembershipRow0, actualGoldClubMembershipRow0);

            Assert.AreEqual(expectedFirstNameRow1, actualFirstNameRow1);
            Assert.AreEqual(expectedLastNameRow1, actualLastNameRow1);
            Assert.AreEqual(expectedEmailRow1, actualEmailRow1);
            Assert.AreEqual(expectedGoldClubMembershipRow1, actualGoldClubMembershipRow1);
        }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Userses"] != null)
     {
         CustomerClass customer = (CustomerClass)Session["Userses"];
         uid = customer.id;
         SqlConnection con = DB_helper.GetConnection();
         con.Open();
         String     cquery  = "SELECT * from Staff Where sid = '" + uid + "'";
         SqlCommand command = new SqlCommand(cquery, con);
         using (SqlDataReader reader = command.ExecuteReader())
         {
             if (reader.Read())
             {
                 port = String.Format("{0}", reader["portID"]);
             }
         }
         BindShipment(port);
         con.Close();
     }
     else
     {
         Response.Redirect("~/Default.aspx");
     }
 }
Ejemplo n.º 11
0
        private async void confirmClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Settings.AccessBillingAddress1))
            {
                await DisplayAlert("Message", "Please enter your address details first", "OK");
            }
            else
            {
                this.IsBusy = true;
                CustomerClass customer = new CustomerClass();
                customer.customer_id            = Convert.ToInt32(Settings.AccessToken);
                customer.item_name              = Settings.AccessItemName;
                customer.total_qty              = Convert.ToInt32(Settings.AccessQuantity);
                customer.total_amount           = Total;
                customer.amount_currency        = "$";
                customer.order_date             = myDate;
                customer.estimate_delivery_date = myestimatedDate.ToString();
                customer.order_status           = "In Process";
                customer.notes               = "null";
                customer.is_sync             = "null";
                customer.tracking_no         = "null";
                customer.glbl_retrn_cust_id  = 0;
                customer.billing_address_1   = Settings.AccessBillingAddress1;
                customer.billing_address_2   = Settings.AccessBillingAddress2;
                customer.billing_company     = Settings.AccessBillingCompany;
                customer.billing_first_name  = Settings.AccessBillingFirstName;
                customer.billing_last_name   = Settings.AccessBillingLastName;
                customer.billing_city        = Settings.AccessBillingCity;
                customer.billing_state       = Settings.AccessBillingState;
                customer.billing_postcode    = Settings.AccessBillingPostcode;
                customer.billing_country     = Settings.AccessBillingCountry;
                customer.billing_email       = Settings.AccessBillingEmail;
                customer.billing_phone       = Settings.AccessBillingPhone;
                customer.shipping_address_1  = Settings.AccessShippingAddress1;
                customer.shipping_address_2  = Settings.AccessShippingAddress2;
                customer.shipping_company    = Settings.AccessShippingCompany;
                customer.shipping_first_name = Settings.AccessShippingFirstName;
                customer.shipping_last_name  = Settings.AccessShippingLastName;
                customer.shipping_city       = Settings.AccessShippingCity;
                customer.shipping_state      = Settings.AccessShippingState;
                customer.shipping_postcode   = Settings.AccessShippingPostcode;
                customer.shipping_country    = Settings.AccessShippingCountry;

                string              url             = "https://woccloudpublish.azurewebsites.net/api/Customer/confirmOrder";
                HttpClient          client          = new HttpClient();
                string              JsonData        = JsonConvert.SerializeObject(customer);
                StringContent       content         = new StringContent(JsonData, Encoding.UTF8, "application/json");
                HttpResponseMessage responseMessage = await client.PostAsync(url, content);

                string result = await responseMessage.Content.ReadAsStringAsync();

                this.IsBusy = false;

                await DisplayAlert("Message", "Your order has been confirmed", "OK");

                Navigation.PopAsync();
                Navigation.PopAsync();
                Navigation.PushAsync(new NavigationDrawer(Settings.AccessName));
            }
        }
Ejemplo n.º 12
0
        public void DeleteCustomer()
        {
            Console.Clear();
            DisplayLists();
            CustomerClass existingUser = new CustomerClass();

            Console.WriteLine("Enter the first name of the user you want to remove:");
            existingUser.FirstName = Console.ReadLine();
            Console.WriteLine("Enter the last name of the user you want to remove:");
            existingUser.LastName = Console.ReadLine();

            bool deleteResult = _customerRepo.DeleteCustomer(existingUser.FirstName, existingUser.LastName);

            if (deleteResult)
            {
                Console.WriteLine("User was deleted!");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("User was not deleted. please try again");
                Console.ReadLine();
            }
            Console.Clear();
        }
Ejemplo n.º 13
0
 private void BtnDelete_Click(object sender, System.EventArgs e)
 {
     try
     {
         var customerClass = new CustomerClass
         {
             Customer = new Customer
             {
                 CustomerCode = this.customerCode
             },
             MasterClass = new MasterClass
             {
                 ClassId = Convert.ToInt32(cboMasterClass.SelectedValue)
             },
             StartDate  = dtpStartDate.Value,
             ModifiedBy = "system",
         };
         CustomerClassController.Delete(customerClass);
         MessageBox.Show("ลบข้อมูลเรียบร้อย.", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 14
0
        internal static CustomerClass Map(CustomerUI customer)
        {
            if (customer == null)
            {
                return(null);
            }
            CustomerClass cust = new CustomerClass()
            {
                Username             = customer.Username,
                FirstName            = customer.FirstName,
                LastName             = customer.LastName,
                FavoriteStoreID      = customer.FavoriteStoreID,
                FailedPasswordChecks = customer.FailedPasswordChecks,
                UserID = customer.UserID
            };

            foreach (var add in customer.Addresses)
            {
                cust.Addresses.Add(Map(add));
            }

            foreach (var order in customer.Orders)
            {
                cust.PreviousOrders.Add(Map(order));
            }

            return(cust);
        }
Ejemplo n.º 15
0
        //Add Customers - input validation

        private void btnAddCustomer_Click(object sender, EventArgs e)
        {
            //If the user left it blank => Inform to enter all the value

            if (string.IsNullOrWhiteSpace(txtCusName.Text) ||
                string.IsNullOrWhiteSpace(txtAddress.Text) ||
                string.IsNullOrWhiteSpace(txtPhone.Text) ||
                string.IsNullOrWhiteSpace(txtSSN.Text) ||
                string.IsNullOrWhiteSpace(txtState.Text) ||
                string.IsNullOrWhiteSpace(txtZip.Text))
            {
                MessageBox.Show("Please enter all the information please", "Error");
            }
            else
            {
                if (Convert.ToInt64(txtPhone.Text) > 9999999999 || Convert.ToInt64(txtPhone.Text) < 1000000000)
                {
                    MessageBox.Show("Please enter a correct phone number", "Error");   //input validation for phone number
                }
                else if (dateTime1.Value.Year > DateTime.Now.Year || dateTime1.Value.Year < DateTime.MinValue.Year)
                {
                    MessageBox.Show("Please enter a correct birth year", "Error");       //input validation for birth year
                }
                else
                {
                    Cusfun = new CustomerClass(
                        txtCusName.Text,
                        Convert.ToInt64(txtSSN.Text),
                        Convert.ToInt64(txtPhone.Text),
                        dateTime1.Value,
                        txtAddress.Text,
                        txtState.Text,
                        Convert.ToInt32(txtZip.Text)
                        );

                    Cusfun.CusAge = DateTime.Now.Year - dateTime1.Value.Year;

                    string s = "We have " + Cusfun.CusAge;

                    CusList.AddCustomer(Cusfun);
                    txtCusName.Text = "";
                    txtSSN.Text     = "";
                    txtPhone.Text   = "";
                    txtAddress.Text = "";
                    txtState.Text   = "";
                    txtZip.Text     = "";

                    bool successCus = CusList.WriteCustomerIntoText();
                    if (successCus)
                    {
                        MessageBox.Show("Successed", "Result");
                    }
                    else
                    {
                        MessageBox.Show("Failed", "Result");
                    }
                }
            }
        }
Ejemplo n.º 16
0
        public void AddAddressToCustomer(AddressClass address, CustomerClass customer)
        {
            Customer cust = _db.Customer.Include(c => c.CustomerAddress).First(c => c.Username == customer.Username);

            address.StoreID = _db.Store.Where(s => s.Zip == address.Zip).First().StoreId;
            cust.CustomerAddress.Add(Map(address));
            Save();
        }
Ejemplo n.º 17
0
        public void MokTest(string username, CustomerClass cust)
        {
            var mockRepo = new Mock <IPizzaStoreRepo>();

            mockRepo.Setup(repo => repo.LoadCustomerByUsername(username)).Returns(cust);

            mockRepo.Setup(repo => repo.ChangeUserPassword(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <CustomerClass>(), It.IsAny <string>()));
        }
        public void TestOrderTooManyFail(int value)
        {
            var customer = new CustomerClass();

            bool tf = customer.AddToCart("Dumb McFlurry", value);

            Assert.False(tf, "These values are too many or too few");
        }
Ejemplo n.º 19
0
        public void NewCustomerHasNameGivenToConstructor(string testName)
        {
            CustomerClass SUT = new CustomerClass {
                Username = testName, Password = "******"
            };

            Assert.Equal(testName, SUT.Username);
        }
        public void TestOrderTooManyPass(int value)
        {
            var customer = new CustomerClass();

            bool tf = customer.AddToCart("Dumb McFlurry", value);

            Assert.True(tf, "These values are within the range to order");
        }
Ejemplo n.º 21
0
        //Register button click
        private async void Button_Clicked_1(object sender, EventArgs e)
        {
            this.IsBusy = true;
            CustomerClass customer = new CustomerClass();

            customer.first_name   = fname.Text;
            customer.last_name    = lname.Text;
            customer.email        = emailID.Text;
            customer.phone_number = phone.Text;
            customer.country      = chooseCountry.Text;
            Settings.AccessName   = fname.Text;

            string              url             = "https://woccloudpublish.azurewebsites.net/api/Customer/emailCheck";
            HttpClient          client          = new HttpClient();
            string              JsonData        = JsonConvert.SerializeObject(customer);
            StringContent       content         = new StringContent(JsonData, Encoding.UTF8, "application/json");
            HttpResponseMessage responseMessage = await client.PostAsync(url, content);

            string result = await responseMessage.Content.ReadAsStringAsync();

            Response response = JsonConvert.DeserializeObject <Response>(result);

            if (response.Status == 0)
            {
                this.IsBusy = false;
                await DisplayAlert("Message", "Please fill all the fields", "ok");
            }
            else if (response.Status == 4)
            {
                this.IsBusy = false;
                await DisplayAlert("Message", "Email format is incorrect", "ok");
            }
            else if (response.Status == 1)
            {
                this.IsBusy = false;
                await DisplayAlert("Message", "Email/Username already exists", "ok");
            }
            else if (response.Status == 5)
            {
                this.IsBusy = false;

                code  = new Random().Next(1000, 9999).ToString();
                first = fname.Text.ToString();
                last  = lname.Text.ToString();
                mob   = phone.Text.ToString();
                const string accountSid = "AC616a7e7cb46e4c864a3d9061f4dbde4e";
                const string authToken  = "9af49549b7c865d0a8d0eb92adc6b38e";

                TwilioClient.Init(accountSid, authToken);

                var message = MessageResource.Create(
                    body: "Your verification code is" + code,
                    from: new Twilio.Types.PhoneNumber("+12024101762"),
                    to: new Twilio.Types.PhoneNumber(mob)
                    );
                Navigation.PushAsync(new Verification(first, last, emailID.Text, password.Text, code, mob, chooseCountry.Text));
            }
        }
Ejemplo n.º 22
0
        // Login Button click
        private async void Button_Clicked(object sender, EventArgs e)
        {
            this.IsBusy = true;
            CustomerClass customer = new CustomerClass();

            customer.email     = emailID.Text;
            customer.user_name = emailID.Text;
            customer.password  = pass.Text;
            string              url             = "https://woccloudpublish.azurewebsites.net/api/Customer/LoginUser";
            HttpClient          client          = new HttpClient();
            string              JsonData        = JsonConvert.SerializeObject(customer);
            StringContent       content         = new StringContent(JsonData, Encoding.UTF8, "application/json");
            HttpResponseMessage responseMessage = await client.PostAsync(url, content);

            string result = await responseMessage.Content.ReadAsStringAsync();

            Response response = JsonConvert.DeserializeObject <Response>(result);

            if (response.Status == 1 || response.Status == 2)
            {
                this.IsBusy = false;
                await DisplayAlert("Message", "Enter Your Email and Password", "ok");
            }
            else if (response.Status == 3)
            {
                OneSignal.Current.SendTag("user", "logged_in");
                Settings.AccessToken = response.SessionID.ToString();
                Settings.AccessName  = response.Name;

                CustomerClass customer2 = new CustomerClass();
                customer2.customer_id = Convert.ToInt16(Settings.AccessToken);
                string              url2             = "https://woccloudpublish.azurewebsites.net/api/Customer/checkPreference";
                HttpClient          client2          = new HttpClient();
                string              JsonData2        = JsonConvert.SerializeObject(customer2);
                StringContent       content2         = new StringContent(JsonData2, Encoding.UTF8, "application/json");
                HttpResponseMessage responseMessage2 = await client2.PostAsync(url2, content2);

                string result2 = await responseMessage2.Content.ReadAsStringAsync();

                Response response2 = JsonConvert.DeserializeObject <Response>(result2);

                this.IsBusy = false;

                if (response2.Status == 1)
                {
                    await Navigation.PushAsync(new NavigationDrawer(Settings.AccessName));
                }
                else
                {
                    await Navigation.PushAsync(new Preference(Settings.AccessToken, dumList, 2));
                }
            }
            else
            {
                this.IsBusy = false;
                await DisplayAlert("Message", "Email or Password is incorrect", "ok");
            }
        }
        public ActionResult CustomStatement(DateTime fromDate, DateTime toDate)
        {
            CustomerClass       obj          = new CustomerClass();
            int                 accountNo    = Int32.Parse((Session["accountNumber"].ToString()));
            IList <Transaction> transactions = obj.customstatement(accountNo, fromDate, toDate);


            return(View("customStatementTable", transactions));
        }
 public ActionResult EditCustomer(Customer cus)
 {
     if (ModelState.IsValid) { 
     CustomerClass custcls = new CustomerClass();
    custcls.UpdateCustomerSave(cus);
         return RedirectToAction("Index", "CustomerINFO");
         }
     return View(cus);
 }
Ejemplo n.º 25
0
        public void SeedCustomerList()
        {
            CustomerClass user1 = new CustomerClass("JHONY", "BRAVO", CustomerType.Current);

            _testRepo.AddNewCustomer(user1);

            _testRepo._listOfEmails.Add(CustomerType.Current, "We currently have the lowest rates on Helicopter Insurance!");
            _testRepo._listOfEmails.Add(CustomerType.Potential, "It's been a long time since we've heard from you, we want you back");
        }
Ejemplo n.º 26
0
        public void ChangeUserPassword(CustomerClass customer, string NewPassword)
        {
            Customer NewCust = _db.Customer.First(c => c.Username == customer.Username);

            NewCust.Password             = NewPassword;
            NewCust.FailedPasswordChecks = 0;
            _db.Customer.Update(NewCust);
            Save();
        }
    private void LoadCustomers()
    {
        custObj        = new CustomerClass();
        custObj.custId = "%";
        DataTable dtCust = custObj.GetCustomerMasterByCustId();

        rptCustomer.DataSource = dtCust.Rows.Count > 0 ? custObj.GetCustomerMasterByCustId() : null;
        rptCustomer.DataBind();
    }
Ejemplo n.º 28
0
        public void Test_GetGreetEmail()
        {
            SeedCustomerList();
            CustomerClass testUser = new CustomerClass("TEST", "TEST", CustomerType.Potential);

            _testRepo.AddNewCustomer(testUser);
            string emailResult = _testRepo.GetGreetEmail(testUser.Type);

            Assert.IsNotNull(emailResult);
        }
Ejemplo n.º 29
0
 protected void ButtonCheckout_Click1(object sender, EventArgs e)
 {
     if (OrderTable.getOrderString() != "" && TextBoxAddress.Text != "" && TextBoxName.Text != "" && TextBoxNumber.Text != "")
     {
         //call stored proc here saveToSQL(OrderTable.getOrderString,TextBoxAddress.Text,TextboxName.Text,TextboxNumber.Text)
         CustomerClass.AddNewCustomerOrder(OrderTable.getOrderString(), TextBoxAddress.Text, TextBoxName.Text, TextBoxNumber.Text);
         OrderTable.DT.Clear();
         LoadPage();
     }
 }
Ejemplo n.º 30
0
        private void LoadGoldClubMembers_button_Click(object sender, RoutedEventArgs e)
        {
            this.GoldClubMembers_txt.Text = "";
            DataSet dataSet = CustomerClass.getCustomersGoldClubMembers();

            foreach (DataRow row in dataSet.Tables[0].Rows)
            {
                this.GoldClubMembers_txt.Text = this.GoldClubMembers_txt.Text + row["First_Name"].ToString() + " " + row["Last_Name"].ToString() + " - " + row["Email"].ToString() + "\n";
            }
        }
Ejemplo n.º 31
0
        public Customer(string identifier, string firstName, string lastName, int yearJoined, Address postalAddress, CustomerClass customerClass)
        {
            if (string.IsNullOrEmpty(identifier))
                throw new ArgumentNullException("identifier");
            if (string.IsNullOrEmpty(firstName))
                throw new ArgumentNullException("firstName");
            if (string.IsNullOrEmpty(lastName))
                throw new ArgumentNullException("lastName");

            Identifier = identifier;
            FirstName = firstName;
            LastName = lastName;
            YearJoined = yearJoined;
            PostalAddress = postalAddress;
            CustomerClass = customerClass;
        }