Пример #1
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                List <string> uids = new List <string>();
                foreach (RepeaterItem item in commentList.Items)
                {
                    CheckBox cb = (CheckBox)item.FindControl("commentCheckbox");
                    if (cb.Checked)
                    {
                        HiddenField commentID = (HiddenField)item.FindControl("commentID");
                        uids.Add(commentID.Value);
                    }
                }

                ChangeCommentApproval(uids.ToArray(), 1);
                DisplayAllComment(true);

                MyTask otherUC = this.Page.FindControl("MyTaskUC") as MyTask;
                otherUC.DisplayAllComment(false);
                DeletedComment otherUC2 = this.Page.FindControl("DeletedCommentUC") as DeletedComment;
                otherUC2.DisplayAllComment(false);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "error", $@"$(document).ready(function () {{ alert('Error: {ex.Message}') }});", true);
            }
        }
Пример #2
0
 protected void BtnSearchByDate_Click(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         DisplayComment(Keyword.Text, CategoryList.Text, DatePickerStart.Text, DatePickerEnd.Text, true);
         MyTask otherUC = this.Page.FindControl("MyTaskUC") as MyTask;
         otherUC.DisplayAllComment(false);
         DeletedComment otherUC2 = this.Page.FindControl("DeletedCommentUC") as DeletedComment;
         otherUC2.DisplayAllComment(false);
     }
 }
Пример #3
0
 protected void BtnShowAll_Click(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         try
         {
             DisplayAllComment(true);
             MyTask otherUC = this.Page.FindControl("MyTaskUC") as MyTask;
             otherUC.DisplayAllComment(false);
             DeletedComment otherUC2 = this.Page.FindControl("DeletedCommentUC") as DeletedComment;
             otherUC2.DisplayAllComment(false);
         }
         catch (Exception ex)
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "load", $@"$(document).ready(function () {{ alert('Error: {ex.Message}') }});", true);
         }
     }
 }