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

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

            return form.ShowDialog();
        }
        public static DialogResult CreateInsertDialog()
        {
            var form = new ProductDetailsForm();

            form.isForUpdate = false;

            return(form.ShowDialog());
        }
        public static DialogResult CreateUpdateDialog(DataRow selectedRow)
        {
            var form = new ProductDetailsForm();

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

            return(form.ShowDialog());
        }
Ejemplo n.º 5
0
        private void insertButton_Click(object sender, EventArgs e)
        {
            var  result   = ProductDetailsForm.CreateInsertDialog();
            bool inserted = result == DialogResult.OK;

            if (inserted)
            {
                LoadDataToGrid();
            }
        }
Ejemplo n.º 6
0
        private void ShowUpdateForm()
        {
            Debug.Assert(cardView.FocusedRowHandle != -1);

            DataRow selected = cardView.GetFocusedDataRow();

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

            if (inserted)
            {
                LoadDataToGrid();
            }
        }