Esempio n. 1
0
        private void CustomerList_SelectedIndexChanged(object sender, EventArgs e)
        {
            string custname = this.CustomerList.SelectedItem.ToString();

            list = new List <Customer>();
            list = CustomerCL.GetAll();
            foreach (Customer cust in list)
            {
                if (custname.Equals(cust.name))
                {
                    this.CustIDLabel.Text    = cust.customerId.ToString();
                    this.NameLabel.Text      = cust.name.ToString();
                    this.AddressLabel.Text   = cust.address.ToString();
                    this.MobileLabel.Text    = cust.mobile.ToString();
                    this.CreditAmtLabel.Text = cust.creditAmount.ToString();
                    lists = new List <Vehicle>();
                    lists = VehicleCL.GetALL();
                    foreach (Vehicle veh in lists)
                    {
                        if (cust.customerId.Equals(veh.customerId))
                        {
                            this.VehicleList.Items.Add(veh.vehicleNumber);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 private void ExistingCustomer_Load(object sender, EventArgs e)
 {
     list = new List <Customer>();
     list = CustomerCL.GetAll();
     foreach (Customer cust in list)
     {
         this.CustomerList.Items.Add(cust.name);
     }
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var customer     = new Customer();
            var goldCustomer = new GoldCustomer();

            goldCustomer.GiveOffer();

            var custome1 = new CustomerCL();
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            int      customerId      = int.Parse(CustomerID.Text);
            string   customerName    = CustomerName.Text;
            string   customerAddress = CustAddress.Text;
            string   mobile          = CustMobile.Text;
            double   creditAmt       = double.Parse(CustCreditAmt.Text);
            Customer cust            = new Customer(customerId, customerName, customerAddress, mobile, creditAmt);

            CustomerCL.Insert(cust);
        }
Esempio n. 5
0
        private void CustomerList_SelectedIndexChanged(object sender, EventArgs e)
        {
            string custname = this.CustomerList.SelectedItem.ToString();

            list = new List <Customer>();
            list = CustomerCL.GetAll();
            foreach (Customer cust in list)
            {
                if (custname.Equals(cust.name))
                {
                    lists = new List <Vehicle>();
                    lists = VehicleCL.GetALL();
                    foreach (Vehicle veh in lists)
                    {
                        if (cust.customerId.Equals(veh.customerId))
                        {
                            this.VehicleList.Items.Add(veh.vehicleNumber);
                        }
                    }
                }
            }
        }