Exemple #1
0
 private void AddButton_Click(object sender, EventArgs e)
 {
     try
     {
         CustomerListForm.m_phoneNumber = String.Empty;
         CCustomerInfoForm tempCustomerInfoForm = new CCustomerInfoForm("Add", null);
         tempCustomerInfoForm.Show();
         CFormManager.Forms.Push(this);
         this.Hide();
     }
     catch (Exception exp)
     {
         Console.Write(exp.Message);
     }
 }
Exemple #2
0
        /// <summary>
        /// Modified by Baruri at 12.12.2008 for the new customer address format
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateButton_Click(object sender, EventArgs e)
        {
            try
            {
                for (int rowIndex = 0; rowIndex < CustomerDataGridView.Rows.Count; rowIndex++)
                {
                    if (CustomerDataGridView.Rows[rowIndex].Selected == true && CustomerDataGridView.Rows[rowIndex].Cells["PhoneNumber"].Value != null)
                    {
                        string phone = CustomerDataGridView.Rows[rowIndex].Cells[4].Value.ToString(); //for phone number
                        CCustomerManager tempCustomerManager = new CCustomerManager();
                        CCustomerInfo tempCustomerInfo = new CCustomerInfo();
                        CResult tempResult = tempCustomerManager.CustomerInfoGetByPhone(phone);

                        if (tempResult.IsSuccess)
                        {
                            CCustomerInfoForm tempCustomerInfoForm = new CCustomerInfoForm("Update", (CCustomerInfo)tempResult.Data);
                            tempCustomerInfoForm.Show();
                            CFormManager.Forms.Push(this);
                            this.Hide();
                        }
                        break;
                    }
                }
            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }
Exemple #3
0
 private void NewCustomerButton_Click(object sender, EventArgs e)
 {
     CCustomerInfoForm tempCustomerInfoForm= new CCustomerInfoForm("Add",null);
     tempCustomerInfoForm.Show();
     CFormManager.Forms.Push(this);
     this.Hide();
 }