protected override List <CustomerBase> ExecuteCommand() { objCommand.CommandText = "select * from tblCustomer"; SqlDataReader dr = null; dr = objCommand.ExecuteReader(); List <CustomerBase> custs = new List <CustomerBase>(); while (dr.Read()) { CustomerBase icust = FactoryCust <CustomerBase> .Create("Customer"); icust.Id = Convert.ToInt16(dr["Id"]); icust.CustomerName = dr["CustomerName"].ToString(); icust.CustomerType = dr["CustomerType"].ToString(); icust.BillDate = Convert.ToDateTime(dr["BillDate"]); icust.BillAmount = Convert.ToDecimal(dr["BillAmount"]); icust.PhoneNumber = dr["PhoneNumber"].ToString(); icust.Address = dr["Address"].ToString(); custs.Add(icust); } return(custs); }
private void cmbCustomerType_SelectedIndexChanged(object sender, EventArgs e) { cust = FactoryCust <CustomerBase> .Create(cmbCustomerType.Text); }