コード例 #1
0
ファイル: UC_alert.ascx.cs プロジェクト: nafise/hello-world1
        /// <summary>
        /// Nafise: Acknowledged by Role
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnACKRole_Click(object sender, EventArgs e)
        {
            List <NoteScheduleJob> lstACKnote = new List <NoteScheduleJob>();
            NoteScheduleJob        noteSch    = new NoteScheduleJob();

            for (int i = 0; i < gvNoteRole.Rows.Count; i++)
            {
                CheckBox chACK = (CheckBox)gvNoteRole.Rows[i].FindControl("chACK");
                if (chACK.Checked)
                {
                    noteSch                = new NoteScheduleJob();
                    noteSch.Note_ID        = long.Parse(gvNoteRole.DataKeys[i].Values[1].ToString());
                    noteSch.Is_Acknowledge = true;
                    noteSch.Acknowledge_By = HttpContext.Current.User.Identity.Name;
                    lstACKnote.Add(noteSch);
                }
            }
            noteSch.Update_Scheduled_note(lstACKnote);
            UpdateControl();
        }
コード例 #2
0
ファイル: UC_alert.ascx.cs プロジェクト: nafise/hello-world1
        protected void btn_ACK_Click(object sender, EventArgs e)
        {
            List <NoteScheduleJob> lstACKnote = new List <NoteScheduleJob>();
            NoteScheduleJob        noteSch = new NoteScheduleJob();
            int i, chCount = 0;

            for (i = 0; i < gvNote.Rows.Count; i++)
            {
                CheckBox chACK = (CheckBox)gvNote.Rows[i].FindControl("chACK");
                if (chACK.Checked)
                {
                    noteSch                = new NoteScheduleJob();
                    noteSch.Note_ID        = long.Parse(gvNote.DataKeys[i].Values[1].ToString());
                    noteSch.Is_Acknowledge = true;
                    noteSch.Acknowledge_By = HttpContext.Current.User.Identity.Name;
                    lstACKnote.Add(noteSch);
                    chCount++;
                }
            }
            noteSch.Update_Scheduled_note(lstACKnote);
            DataTable dtMorningAfter = new DataTable();

            dtMorningAfter    = (new NoteScheduleJob()).MorningAfterAutoMsg(false);
            gvNote.DataSource = dtMorningAfter;
            gvNote.DataBind();
            if (gvNote.Rows.Count == chCount)
            {
                HyperLink hplWarning = Page.Master.FindControl("hplWarning") as HyperLink;
                hplWarning.Visible = false;
            }

            if (gvNote.Rows.Count != 0)
            {
                btn_ACK.Visible = true;
            }
        }