private void FormCloseOK(string providerid) { DataRow[] drs = DBclass.DS.contragent.Select("contragentId = " + providerid); activeContragentRow = (DataSetTpos.contragentRow)drs[0]; DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
private void button1_Click(object sender, EventArgs e) { Contragent cont = new Contragent(); if (cont.ShowDialog() == System.Windows.Forms.DialogResult.OK) { contRow = cont.activeContragentRow; lblname.Text = contRow.name.ToString(); } }
private void btnAdd_Click(object sender, EventArgs e) { DataSetTpos.contragentRow crRow = DBclass.DS.contragent.NewcontragentRow(); ContragentForm contragentForm = new ContragentForm(crRow, false); if (contragentForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DBclass.DS.contragent.AddcontragentRow(crRow); updateContragent(); //FormCloseOK(DBclass.DS.contragent.Rows[DBclass.DS.contragent.Rows.Count - 1]["contragentId"].ToString()); } }
private void btnAdd_Click(object sender, EventArgs e) { DataSetTpos.contragentRow prRow = DBclass.DS.contragent.NewcontragentRow(); ContAdd faktura = new ContAdd(prRow); if (faktura.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DBclass.DS.contragent.AddcontragentRow(prRow); updateProvider(); FormCloseOK(DBclass.DS.contragent.Rows[DBclass.DS.contragent.Rows.Count - 1]["contragentId"].ToString()); } }
private void dgvContagent_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { int contrId = (int)dgvContagent.Rows[e.RowIndex].Cells["contragentId"].Value; DataSetTpos.contragentRow crRow = DBclass.DS.contragent.Single <DataSetTpos.contragentRow>(crId => crId.contragentId == contrId); ContragentForm contForm = new ContragentForm(crRow, true); if (contForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //DBclass.DS.contragent.AddcontragentRow(crRow); updateContragent(); } } }
public ContragentForm(DataSetTpos.contragentRow contragentRow, bool is_Edit) { contRow = contragentRow; isEdit = is_Edit; InitializeComponent(); if (isEdit) { tbxName.Text = contRow.name; tbxPerson.Text = contRow.person; tbxAddress.Text = contRow.address; tbxBankAccount.Text = contRow.bankAccount; tbxPhone.Text = contRow.phone; isEdit = true; btnOK.Text = "Изменить"; //tbxName.Enabled = false; } }
public ContAdd(DataSetTpos.contragentRow contRow) { prRow = contRow; InitializeComponent(); }