예제 #1
0
        private void UpdateButton_Click_1(object sender, EventArgs e)
        {
            Adresy     Adres_Kursor = Current_Cursor_Address();
            int        saveRow      = dataGridView1.CurrentCell.RowIndex;
            int        saveColumn   = dataGridView1.CurrentCell.ColumnIndex;
            Form_Ustaw form2        = new Form_Ustaw(1, Adres_Kursor);

            form2.SetDesktopLocation(this.Location.X + this.Size.Width, this.Location.Y);
            var result = form2.ShowDialog();

            if (result == DialogResult.OK)
            {
                Adresy returnedAdres = form2.ReturnValue;

                if (cb_linq.Checked)
                {
                    Update_Adres_Linq(returnedAdres, Adres_Kursor.Id);
                }
                else if (cb_procedura.Checked)
                {
                    Update_Adres_Procedure(returnedAdres);
                }
                dataGridView1.CurrentCell = dataGridView1[saveColumn, saveRow];
            }
        }
예제 #2
0
        private void DeleteButton_Click_1(object sender, EventArgs e)
        {
            Adresy     Adres_Kursor = Current_Cursor_Address();
            Form_Ustaw form2        = new Form_Ustaw(2, Adres_Kursor);
            int        saveRow      = dataGridView1.CurrentCell.RowIndex;
            int        saveColumn   = dataGridView1.CurrentCell.ColumnIndex;

            form2.SetDesktopLocation(this.Location.X + this.Size.Width, this.Location.Y);
            var result = form2.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (cb_linq.Checked)
                {
                    Delete_Adres_Linq(Adres_Kursor);
                }
                else if (cb_procedura.Checked)
                {
                    Delete_Adres_Procedure(Adres_Kursor);
                }
                if (saveRow > 1)
                {
                    dataGridView1.CurrentCell = dataGridView1[saveColumn, saveRow - 1];
                }
            }
        }
예제 #3
0
        private void InsertButton_Click_1(object sender, EventArgs e)
        {
            Adresy     AdresKursor = Current_Cursor_Address();
            Form_Ustaw form2       = new Form_Ustaw(0, AdresKursor);

            form2.SetDesktopLocation(this.Location.X + this.Size.Width, this.Location.Y);

            var result = form2.ShowDialog();

            if (result == DialogResult.OK)
            {
                Adresy adres = form2.ReturnValue;

                if (cb_linq.Checked)
                {
                    Insert_Adres_Linq(adres);
                }
                else if (cb_procedura.Checked)
                {
                    Insert_Adres_Procedure(adres);
                }
                dataGridView1.CurrentCell = dataGridView1[0, dataGridView1.RowCount - 1];
            }
        }