예제 #1
0
 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();
 }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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());
            }
        }
예제 #4
0
        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());
            }
        }
예제 #5
0
        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();
                }
            }
        }
예제 #6
0
 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;
     }
 }
예제 #7
0
 public ContAdd(DataSetTpos.contragentRow contRow)
 {
     prRow = contRow;
     InitializeComponent();
 }