Пример #1
0
        private void ShowWarrantyForm()
        {
            var st = (StcrdMin)this.dgvSTCRD.Rows[this.dgvSTCRD.CurrentCell.RowIndex].Cells[this.col_stcrdmin.Name].Value;

            DialogWarranty war = new DialogWarranty(this, st);

            if (war.ShowDialog() == DialogResult.OK)
            {
                if (this.tabControl2.SelectedTab == this.tabIV)
                {
                    this.curr_invoice = DbfTable.InVoice(this.data_path, this.curr_invoice.artrn.docnum.Trim());
                }
                else
                {
                    this.curr_invoice = DbfTable.InVoice(this.data_path, this.curr_invoice.artrn.docnum.Trim());
                }

                this.FillForm(this.curr_invoice);

                if (this.dgvSTCRD.Rows.Count > 0)
                {
                    this.dgvSTCRD.Rows.Cast <DataGridViewRow>().Where(r => ((StcrdMin)r.Cells[this.col_stcrdmin.Name].Value).seqnum == st.seqnum).First().Cells[this.col_stkcod.Name].Selected = true;
                }
            }
        }
Пример #2
0
        private void dgvIV_CurrentCellChanged(object sender, EventArgs e)
        {
            if (((DataGridView)sender).CurrentCell == null)
            {
                this.curr_invoice = null;
            }
            else
            {
                if (this.tabControl2.SelectedTab == this.tabIV)
                {
                    this.curr_invoice = DbfTable.InVoice(this.data_path, (string)((DataGridView)sender).Rows[((DataGridView)sender).CurrentCell.RowIndex].Cells[this.col_iv_docnum.Name].Value);
                }
                else
                {
                    this.curr_invoice = DbfTable.InVoice(this.data_path, (string)((DataGridView)sender).Rows[((DataGridView)sender).CurrentCell.RowIndex].Cells[this.col_hs_docnum.Name].Value);
                }
            }

            this.FillForm(this.curr_invoice);
        }