示例#1
0
        private void GrdCommentsAdd()
        {
            if (ValidateCommentsFooter())
            {
                Page.Validate("commentsDataAdd");
                if (Page.IsValid)
                {
                    int workId = Int32.Parse(hdfWorkId.Value);
                    int companyId = Int32.Parse(hdfCompanyId.Value);
                    string newSubject = ((TextBox)grdComments.FooterRow.FindControl("tbxCommentSubjectNew")).Text.Trim();
                    int loginId = Convert.ToInt32(Session["loginID"]);
                    DateTime dateTime_ = DateTime.Now;
                    string newComment = ((TextBox)grdComments.FooterRow.FindControl("tbxCommentCommentNew")).Text.Trim();
                    bool inDatabase = false;
                    string workType = hdfWorkType.Value;

                    PointRepairsCommentDetails model = new PointRepairsCommentDetails(pointRepairsTDS);

                    model.Insert(workId, "Point Repairs", newSubject, loginId, dateTime_, newComment, null, false, companyId, inDatabase, workType);

                    Session.Remove("pointRepairsCommentsTempDummy");
                    Session["pointRepairsTDS"] = pointRepairsTDS;

                    grdComments.DataBind();
                }
            }
        }