Example #1
0
        private void cmdADD_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                Guid headerID;
                ISA.Bengkel.BaseForm ifrmChild;

                switch (selectedGrid)
                {
                case enumSelectedGrid.HeaderSelected:
                    ifrmChild = new frmPembelianUpdate(this);
                    ifrmChild.ShowDialog();
                    break;

                case enumSelectedGrid.Detail1Selected:
                    headerID  = (Guid)dgvHeader.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                    ifrmChild = new frmPembelianDetailUpdate(this, headerID, FormTools.enumFormMode.New);
                    ifrmChild.ShowDialog();
                    break;
                }
            }
            catch (System.Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #2
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (!CekAddEditDel())
            {
                return;
            }
            Guid rowID;

            try
            {
                this.Cursor = Cursors.WaitCursor;

                ISA.Bengkel.BaseForm ifrmChild;

                switch (selectedGrid)
                {
                case enumSelectedGrid.HeaderSelected:
                    rowID     = (Guid)dgvHeader.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                    ifrmChild = new frmPembelianUpdate(this, rowID);
                    ifrmChild.ShowDialog();
                    break;

                case enumSelectedGrid.Detail1Selected:
                    rowID     = (Guid)dgvDetail1.SelectedCells[0].OwningRow.Cells["RowIDDetail"].Value;
                    _headerID = (Guid)dgvHeader.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                    ifrmChild = new frmPembelianDetailUpdate(this, rowID, FormTools.enumFormMode.Update);
                    ifrmChild.ShowDialog();
                    break;
                }
            }
            catch (System.Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }