private void tsAdd_Click(object sender, EventArgs e) { this.pop = new popupAddForm(); this.pop.accountsForm = this; this.pop.Show(); }
private void toolStripButton2_Click(object sender, EventArgs e) { int num1; try { int index = this.dgvAccounts.SelectedRows[0].Index; int num2 = Convert.ToInt32(this.dgvAccounts.Rows[index].Cells[0].Value); int parent = this.accounts.getParent(num2); num1 = parent; popupClient _popupClient = new popupClient(); _popupClient.edit = true; _popupClient.clientF = null; _popupClient.row = index; _popupClient.tbAccCode.Text = this.dgvAccounts.Rows[index].Cells[0].Value.ToString(); _popupClient.tbEName.Text = this.dgvAccounts.Rows[index].Cells[1].Value.ToString(); _popupClient.tbBalance.Visible = true; _popupClient.tbBalance.ReadOnly = true; _popupClient.lblBalance.Visible = true; _popupClient.lblBalance.Enabled = false; _popupClient.Text = "تعديل معلومات عميل"; _popupClient.Show(); this.pop = new popupAddForm(); this.pop.pnlType.Enabled = false; this.pop.accountsForm = this; if (string.IsNullOrEmpty(this.dgvAccounts.Rows[index].Cells[6].Value.ToString())) { this.pop.pnlSub.Visible = false; this.pop.ddlCategory.SelectedValue = this.dgvAccounts.Rows[index].Cells[3].Value.ToString(); this.pop.ddlCategory.Enabled = false; this.pop.rbType2.Checked = true; this.pop.rbType1.Checked = false; } else { this.pop.pnlSub.Visible = true; this.pop.pnlSub.Dock = DockStyle.Top; this.pop.ddlSub.SelectedValue = this.dgvAccounts.Rows[index].Cells[0].Value.ToString().Substring(0, 2); this.pop.ddlSub.Enabled = false; this.pop.rbType2.Checked = false; this.pop.rbType1.Checked = true; } L_039f: this.pop.tbName.Text = this.dgvAccounts.Rows[index].Cells[1].Value.ToString(); this.pop.tbCode.Text = this.dgvAccounts.Rows[index].Cells[0].Value.ToString(); this.pop.tbCode.ReadOnly = true; this.pop.tbBalance.Text = this.dgvAccounts.Rows[index].Cells[5].Value.ToString(); this.pop.tbBalance.ReadOnly = true; this.pop.btnAdd.Text = "حفظ"; this.pop.edit = true; this.pop.Show(); goto L_039f; } catch (Exception exception) { MessageBox.Show(exception.Message); } if (num1 != 23) { } else { } }