public static DialogResult CreateInsertDialog()
        {
            var form = new SupplierDetailsForm();
            form.isForUpdate = false;

            return form.ShowDialog();
        }
        public static DialogResult CreateUpdateDialog(DataRow selectedRow)
        {
            var form = new SupplierDetailsForm();
            form.isForUpdate = true;
            form.GetInfo(selectedRow);

            return form.ShowDialog();
        }
예제 #3
0
        public static DialogResult CreateInsertDialog()
        {
            var form = new SupplierDetailsForm();

            form.isForUpdate = false;

            return(form.ShowDialog());
        }
예제 #4
0
        public static DialogResult CreateUpdateDialog(DataRow selectedRow)
        {
            var form = new SupplierDetailsForm();

            form.isForUpdate = true;
            form.GetInfo(selectedRow);

            return(form.ShowDialog());
        }
예제 #5
0
        private void insertButton_Click(object sender, EventArgs e)
        {
            var  result   = SupplierDetailsForm.CreateInsertDialog();
            bool inserted = result == DialogResult.OK;

            if (inserted)
            {
                LoadDataToGrid();
            }
        }
예제 #6
0
        private void ShowUpdateForm()
        {
            Debug.Assert(gridView.FocusedRowHandle != -1);

            DataRow selected = gridView.GetFocusedDataRow();

            var  result   = SupplierDetailsForm.CreateUpdateDialog(selected);
            bool inserted = result == DialogResult.OK;

            if (inserted)
            {
                LoadDataToGrid();
            }
        }