예제 #1
0
        public List <Customer> GetCustomers()
        {
            CustomerDO      customerDAL = new CustomerDO();
            List <Customer> customers   = new List <Customer>();

            try
            {
                customers = customerDAL.GetCustomers();
                if (customers == null)
                {
                    customers = new List <Customer>();
                    customers.Add(new Customer
                    {
                        customerID    = 1,
                        firstName     = "Fred",
                        lastName      = "Flinstone",
                        middleInitial = "",
                        name          = "Fred Flinstone",
                        address1      = "",
                        address2      = "",
                        city          = "Bedrock",
                        state         = "A place right out of History",
                        zip           = "",
                        address       = "Bedrock, A place right out of History"
                    });
                    customers.Add(new Customer
                    {
                        customerID    = 2,
                        firstName     = "Wilma",
                        lastName      = "Flinstone",
                        middleInitial = "",
                        name          = "Wilma Flinstone",
                        address1      = "",
                        address2      = "",
                        city          = "Bedrock",
                        state         = "A place right out of History",
                        zip           = "",
                        address       = "Bedrock, A place right out of History"
                    });
                }
                else
                {
                    FormatCustomers(ref customers);
                }
            }
            catch (Exception ex)
            {
                throw;
            }


            return(customers);
        }
예제 #2
0
        public List <Customer> GetCustomers()
        {
            CustomerDO      customerDAL = new CustomerDO();
            List <Customer> customers   = new List <Customer>();

            try
            {
                customers = customerDAL.GetCustomers();

                if (customers == null)
                {
                    customers = new List <Customer>();
                    customers.Add(new Customer
                    {
                        CustomerID    = 1,
                        FirstName     = "Fred",
                        LastName      = "Flinstone",
                        MiddleInitial = "",
                        Address1      = "",
                        Address2      = "",
                        City          = "Bedrock",
                        State         = "A place right out of History",
                        Zip           = ""
                    });
                    customers.Add(new Customer
                    {
                        CustomerID    = 2,
                        FirstName     = "Wilma",
                        LastName      = "Flinstone",
                        MiddleInitial = "",
                        Address1      = "",
                        Address2      = "",
                        City          = "Bedrock",
                        State         = "A place right out of History",
                        Zip           = ""
                    });
                }
            }
            catch (Exception ex)
            {
                throw;
            }


            return(customers);
        }
예제 #3
0
        public void GetCustomersAccess(object sender, System.EventArgs e)
        {
            CustomerDO         customerDO   = new CustomerDO();
            List <CustomerRow> customerRows = customerDO.GetCustomers();

            if (customerRows != null)
            {
                if (customerRows.Count > 0)
                {
                    foreach (CustomerRow customerRow in customerRows)
                    {
                        bindingSource1.Add(customerRow);
                    }
                }
            }

            //	BuildCustomerGrid();
        }