Beispiel #1
0
        protected override List <ICustomer> ExecuteCommand()
        {
            Command.CommandText = "select * from tblCustomer";
            var sqlDataReader = Command.ExecuteReader();

            while (sqlDataReader.Read())
            {
                var customer = FactoryCustomerLookUp.CreateCustomer("Customer");

                customer.Id           = Convert.ToInt32(sqlDataReader["Id"]);
                customer.CustomerType = sqlDataReader["CustomerType"].ToString();
                customer.CustomerName = sqlDataReader["CustomerName"].ToString();
                customer.PhoneNumber  = sqlDataReader["PhoneNumber"].ToString();
                customer.BillAmount   = Convert.ToDecimal(sqlDataReader["BillAmount"].ToString());
                customer.BillDate     = Convert.ToDateTime(sqlDataReader["BillDate"].ToString());
                customer.Address      = sqlDataReader["Address"].ToString();

                AnyTypes.Add(customer);
            }

            return(AnyTypes);
        }
Beispiel #2
0
        public void CbxCustomerTypeSelectedIndexChanged()
        {
            var comboBox = (ComboBox)_uiControls["CbxCustomerType"];

            _customer = FactoryCustomerLookUp.CreateCustomer(comboBox.Text);
        }