Example #1
0
    private void ReBindGrid()
    {
        var cmIds = ServerModel.DB.LookupIds <TblComment>(News);

        CommentsGrid.DataSource = new CachedBindingList <TblComment>(ServerModel.DB, cmIds);
        CommentsGrid.DataBind();
    }
        protected void CommentsCreateNew_Click(object sender, EventArgs e)
        {
            // Response.Write("hahahahhahahahahahahah");
            PopulateCommentPopUp();
            Incident_Comments_PopUp.ShowOnPageLoad = true;
            Incident_Comments_PopUp.HeaderText     = "التعليقات";
            // var Comments_CommentsCreateNew_TextBox = (ASPxTextBox)(CommentsGrid.FindTitleTemplateControl("CommentsCreateNew_TextBox"));
            CommentsCreateNew_TextBox.Focus();
            if (CommentsCreateNew_TextBox == null)
            {
                return;
            }
            if (CommentsCreateNew_TextBox.Text == "")
            {
                return;
            }
            var IncidentID = Session["CommentsIncidentID"];

            if (IncidentID == null)
            {
                return;
            }
            var sessionuser = Session["User"];

            if (sessionuser == null)
            {
                return;
            }
            var user = (User)sessionuser;
            DataClassesDataContext db = new DataClassesDataContext(Handler_Global.connectString);

            var newComment = new IncidentsComment();

            newComment.IncidentID = Convert.ToInt64(IncidentID.ToString());
            newComment.Text       = CommentsCreateNew_TextBox.Text;

            var result = Core.Handler_Incidents.Add_New_Comment(user, newComment);

            if (result.StatusID == Core.Handler_Operations.Opeartion_Status_Success)
            {
                CommentsGrid.DataBind();
                IncidentsGrid.DataBind();
                CommentsCreateNew_TextBox.Text = "";
            }
        }
 protected void CommentsRefresh_Click(object sender, EventArgs e)
 {
     CommentsGrid.DataBind();
 }