예제 #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            DialogResult createMaterial = new CreateCompany().ShowDialog();

            if (createMaterial == DialogResult.Cancel)
            {
                ShowMaterialGrid();
            }
        }
예제 #2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            using (UnitOfWork db = new UnitOfWork())
            {
                int    id          = int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString());
                var    findCompany = db.CompanyService.GetOne(id);
                string name        = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                var    form        = new CreateCompany();
                form.companyId           = id;
                form.txtCompanyName.Text = findCompany.CompanyName;
                DialogResult createMaterial = form.ShowDialog();

                if (createMaterial == DialogResult.OK)
                {
                    ShowMaterialGrid();
                }
            }
        }