Esempio n. 1
0
 private void btnChooseCustomer_Click(object sender, EventArgs e)
 {
     try
     {
         Customers view = new Customers();
         if (view.dgvChooseCustomersList.Rows.Count <= 0)
         {
             if (MessageBox.Show(" لا يوجد عملاء.. إضافة عملاء  ؟", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 CustomersManagement viewForm = new CustomersManagement();
                 viewForm.ShowDialog();
                 return;
             }
         }
         else
         {
             view.ShowDialog();
             if (Convert.ToInt32(view.dgvChooseCustomersList.CurrentRow.Cells[3].Value) < 1)
             {
                 MessageBox.Show("لا يوجد رصيد مدين لهذا العميل لخصم قيمة سند قبض جديد", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
             txtCustomerName.Text = view.dgvChooseCustomersList.CurrentRow.Cells[1].Value.ToString();
         }
     }
     catch
     {
         return;
     }
 }
Esempio n. 2
0
 private void btnChooseCustomer_Click(object sender, EventArgs e)
 {
     try
     {
         if (btnChooseCustomer.Text == "اختر عميل")
         {
             Customers view = new Customers();
             if (view.dgvChooseCustomersList.Rows.Count <= 0)
             {
                 if (MessageBox.Show(" لا يوجد عملاء.. إضافة عملاء  ؟", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                 {
                     CustomersManagement viewForm = new CustomersManagement();
                     viewForm.ShowDialog();
                     return;
                 }
             }
             view.ShowDialog();
             if (view.dgvChooseCustomersList != null || view.dgvChooseCustomersList.Rows.Count > 0)
             {
                 txtCusid.Text           = view.dgvChooseCustomersList.CurrentRow.Cells[0].Value.ToString();
                 txtOrderPersonName.Text = view.dgvChooseCustomersList.CurrentRow.Cells[1].Value.ToString();
             }
         }
         else
         {
             Providers view = new Providers();
             if (view.dgvChooseProvidersList.Rows.Count <= 0)
             {
                 if (MessageBox.Show(" لا يوجد موردين.. إضافة موردين  ؟", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                 {
                     ProvidersManagement viewForm = new ProvidersManagement();
                     viewForm.ShowDialog();
                     return;
                 }
             }
             view.ShowDialog();
             if (view.dgvChooseProvidersList != null)
             {
                 txtCusid.Text           = view.dgvChooseProvidersList.CurrentRow.Cells[0].Value.ToString();
                 txtOrderPersonName.Text = view.dgvChooseProvidersList.CurrentRow.Cells[1].Value.ToString();
             }
         }
     }
     catch
     {
         return;
     }
 }