Пример #1
0
        private void gridBroadcastSchedule_CellContentClick(object sender, DataGridViewCellEventArgs e) {
            if (e.RowIndex < 0 || e.RowIndex >= this.gridComands.Rows.Count || e.ColumnIndex < 0 || e.ColumnIndex >= this.gridComands.Columns.Count)
                return;

            DataGridViewLinkCell linkCell = this.gridBroadcastSchedule.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewLinkCell;

            if (linkCell != null) {
                string jadwalID = this.gridBroadcastSchedule.Rows[e.RowIndex].Cells[2].Value.ToString();

                if (linkCell.Value.Equals("edit")) {

                    FrmBroadcastSchedule frmBroadcast = new FrmBroadcastSchedule();
                    frmBroadcast.showData(int.Parse(jadwalID));

                    DialogResult hasil = frmBroadcast.ShowDialog(this);
                    if (hasil == DialogResult.OK) {
                        showBroadcastSchedule(true);
                    }
                } else if (linkCell.Value.Equals("delete")) {
                    if (MessageBox.Show("Are you sure?", "Delete Data", MessageBoxButtons.YesNo) == DialogResult.Yes) {
                        FrmBroadcastSchedule frmBroadcast = new FrmBroadcastSchedule();

                        frmBroadcast.showData(int.Parse(jadwalID));
                        frmBroadcast.deleteData(int.Parse(jadwalID));
                        showBroadcastSchedule(true);
                    }
                }
                //MessageBox.Show("ada : " + regType + "-" + regName); 
            }
        }
Пример #2
0
 private void Btn_Add_Broadcast_Click(object sender, EventArgs e) {
     FrmBroadcastSchedule frmBroadcast = new FrmBroadcastSchedule();
     DialogResult hasil = frmBroadcast.ShowDialog(this);
     if (hasil == DialogResult.OK) {
         showBroadcastSchedule(true);
     }
 }