Beispiel #1
0
 private void AddButton_Click(object sender, EventArgs e)
 {
     try
     {
        // CMemberShipAddForm.m_phoneNumber = String.Empty;
         CMemberShipAddForm tempCustomerInfoForm = new CMemberShipAddForm("Add", null);
         tempCustomerInfoForm.ShowDialog();
         //CFormManager.Forms.Push(this);
         //this.Hide();
     }
     catch (Exception exp)
     {
         Console.Write(exp.Message);
     }
 }
Beispiel #2
0
        private void SetMembershipCard()
        {
            try
            {
                for (int recordCounter = 0; recordCounter < CustomerDataGridView.Rows.Count; recordCounter++)
                {
                    if (CustomerDataGridView.Rows[recordCounter].Selected == true && CustomerDataGridView.Rows[recordCounter].Cells["PhoneColumn"].Value != null)
                    {
                        //DialogResult tempDialogResult = MessageBox.Show("WARNING!!!\nDeleting this Customer may also delete some other information.\nAre you sure to delete this Customer?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        //if (tempDialogResult.Equals(DialogResult.No)) return;
                        //else
                        //{

                        string phone = CustomerDataGridView.Rows[recordCounter].Cells[4].Value.ToString();
                        CCustomerManager tempCustomerManager = new CCustomerManager();
                        CCustomerInfo tempCustomerInfo = new CCustomerInfo();
                        CResult tempResult = tempCustomerManager.CustomerInfoGetByPhone(phone);

                        if (tempResult.IsSuccess)
                        {
                            CMemberShipAddForm tempCustomerInfoForm = new CMemberShipAddForm("Update", (CCustomerInfo)tempResult.Data);

                            tempCustomerInfoForm.ShowDialog();
                          //  CFormManager.Forms.Push(this);
                          //  this.Hide();
                        }

                    }
                }
            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }
Beispiel #3
0
        private void membershipfunctionalButton_Click(object sender, EventArgs e)
        {
            try
              {

              CMemberShipAddForm tempCustomerInfoForm = new CMemberShipAddForm("Add", null);

              tempCustomerInfoForm.ISSetMemberShipCard = true;
              tempCustomerInfoForm.btnFindCustomer.Visible = false;
              tempCustomerInfoForm.btnSearchByPhone.Visible = false;
              tempCustomerInfoForm.btnSelect.Visible = true;
              tempCustomerInfoForm.FinishButton.Visible = false;

              //tempCustomerInfoForm.Show();
              //CFormManager.Forms.Push(this);
              //this.Hide();

             tempCustomerInfoForm.ShowDialog(this);

              if (tempCustomerInfoForm.DialogResult == DialogResult.OK)
              {
                  membership = tempCustomerInfoForm.MembershipData;

                  TotalAmountCalculation();
              }

              }
              catch (Exception exp)
              {
              Console.Write(exp.Message);
              }
        }
Beispiel #4
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 < dgvMembership.Rows.Count; rowIndex++)
                {
                    if (dgvMembership.Rows[rowIndex].Selected == true && dgvMembership.Rows[rowIndex].Cells["id"].Value != null)
                    {
                        long ID = Convert.ToInt64(dgvMembership.Rows[rowIndex].Cells["id"].Value.ToString()); //for phone number

                        Membership  membership = membershipDao.GetMembershipByID(ID);

                        //CCustomerManager tempCustomerManager = new CCustomerManager();
                        //CCustomerInfo tempCustomerInfo = new CCustomerInfo();
                        //CResult tempResult = tempCustomerManager.CustomerInfoGetByPhone(phone);

                        if (membership != null )
                        {
                            CMemberShipAddForm tempCustomerInfoForm = new CMemberShipAddForm();
                            tempCustomerInfoForm.ISModify = true;
                            tempCustomerInfoForm.MembershipData = membership;
                            tempCustomerInfoForm.ShowDialog();
                            //CFormManager.Forms.Push(this);
                            //this.Hide();

                        }
                        break;
                    }
                }
            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }