コード例 #1
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);
            }
        }
コード例 #2
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.gridComands.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewLinkCell;

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

                if (linkCell.Value.Equals("edit"))
                {
                    FrmBroadcastSchedule frmBroadcast = new FrmBroadcastSchedule();
                    frmBroadcast.showData(int.TryParse(jadwalID, 0));

                    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.TryParse(jadwalID));
                        frmBroadcast.deleteData(int.TryParse(jadwalID));
                        showBroadcastSchedule(true);
                    }
                }
                //MessageBox.Show("ada : " + regType + "-" + regName);
            }
        }