Пример #1
0
        private void cmdEDIT_Click(object sender, EventArgs e)
        {
            String src = (String)this.dataGridHI.SelectedCells[0].OwningRow.Cells["Src"].Value;

            //if (!src.Equals("INP"))
            //{
            //    MessageBox.Show("Maaf, data ini tidak bisa diedit.");
            //    return;
            //}

            //if (ValidasiManipulasi() == true)
            //{
            //    MessageBox.Show("Maaf, proses Edit data sudah tidak bisa dilakukan," + Environment.NewLine + "karena sudah di luar dari batas waktu yang ditentukan.");
            //    return;
            //}
            //else if ((Guid)Tools.isNull(this.dataGridHI.SelectedCells[0].OwningRow.Cells["JournalRowID"].Value,Guid.Empty)!=Guid.Empty)
            //            {
            //                MessageBox.Show("Maaf, data ini tidak bisa diedit karena sudah masuk jurnal.");
            //                return;
            //            }
            //else
            //{
            _editable = ValidasiManipulasi();
            if (dataGridHI.SelectedCells.Count > 0)
            {
                Guid   _headerRowID = (Guid)dataGridHI.SelectedCells[0].OwningRow.Cells["RowIDHeader"].Value;
                string _noBukti     = dataGridHI.SelectedCells[0].OwningRow.Cells["NoBukti"].Value.ToString();
                switch (_selectedGrid)
                {
                case enumSelectedGrid.dataGridHI:
                {
                    HI.frmDKNUpdate ifrmChild = new HI.frmDKNUpdate(this, _headerRowID, _editable);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                }
                break;

                case enumSelectedGrid.dataGridDetil:
                    if (dataGridDetil.SelectedCells.Count > 0)
                    {
                        Guid _detailRowID = (Guid)dataGridDetil.SelectedCells[0].OwningRow.Cells["RowIDDetail"].Value;
                        HI.frmDKNUpdateDetail ifrmChild = new HI.frmDKNUpdateDetail(this, _noBukti, _detailRowID, _editable);
                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                    break;
                }
            }
            //}
        }
Пример #2
0
        private void cmdADD_Click(object sender, EventArgs e)
        {
            switch (_selectedGrid)
            {
            case enumSelectedGrid.dataGridHI:
            {
                HI.frmDKNUpdate ifrmChild = new HI.frmDKNUpdate(this);
                ifrmChild.MdiParent = Program.MainForm;
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.Show();
            }
            break;

            case enumSelectedGrid.dataGridDetil:
            {
                if (dataGridHI.SelectedCells.Count > 0)
                {
                    if (ValidasiManipulasi() == true)
                    {
                        //    MessageBox.Show("Tidak dapat menambah item data," + Environment.NewLine + "karena sudah di luar dari batas waktu yang ditentukan.");
                        //    return;
                        //}
                        //else if ((Guid)Tools.isNull(this.dataGridHI.SelectedCells[0].OwningRow.Cells["JournalRowID"].Value, Guid.Empty) != Guid.Empty)
                        //{
                        //    MessageBox.Show("Tidak dapat menambah item data, karena sudah masuk jurnal.");
                        //    return;
                        //}
                        //else
                        //{
                        Guid   _headerRowID             = (Guid)dataGridHI.SelectedCells[0].OwningRow.Cells["RowIDHeader"].Value;
                        string _noBukti                 = dataGridHI.SelectedCells[0].OwningRow.Cells["NoBukti"].Value.ToString();
                        HI.frmDKNUpdateDetail ifrmChild = new HI.frmDKNUpdateDetail(this, _headerRowID, _noBukti);
                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                }
            }
            break;
            }
        }