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; } }
private void btnProviders_Click_1(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; ProvidersManagement viewForm = null; if (viewForm == null) { viewForm = new ProvidersManagement(); if (this.ActiveMdiChild != null) { this.ActiveMdiChild.Close(); } viewForm.MdiParent = this; } viewForm.Show(); Cursor.Current = Cursors.Default; }
private void chooseProvider_Click(object sender, EventArgs e) { 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; } } else { view.ShowDialog(); if (Convert.ToInt32(view.dgvChooseProvidersList.CurrentRow.Cells[4].Value) < 1) { MessageBox.Show("لا يوجد رصيد دائن لهذا المورد لخصم قيمة سند دفع جديد", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } txtProviderName.Text = view.dgvChooseProvidersList.CurrentRow.Cells[1].Value.ToString(); } }