private void GrdNotesAddFromCost(string subject, string note)
        {
            int serviceId = Int32.Parse(hdfServiceId.Value);
            int companyId = Int32.Parse(hdfCompanyId.Value);
            string newSubject = subject;
            int loginId = Convert.ToInt32(Session["loginID"]);
            DateTime dateTime_ = DateTime.Now;
            string newNote = note;
            bool inServiceNoteDatabase = false;
            int? libraryFilesId = null;

            ServiceInformationServiceNote model = new ServiceInformationServiceNote(serviceInformationTDS);
            model.Insert(serviceId, newSubject, loginId, dateTime_, newNote, libraryFilesId, false, companyId, inServiceNoteDatabase);

            Session.Remove("serviceNotesDummy");
            Session["serviceInformationTDS"] = serviceInformationTDS;

            grdNotes.DataBind();
            grdNotes.PageIndex = grdNotes.PageCount - 1;
        }
        private void GrdNotesAdd()
        {
            if (ValidateNotesFooter())
            {
                Page.Validate("notesDataAdd");
                if (Page.IsValid)
                {
                    int serviceId = Int32.Parse(hdfServiceId.Value);
                    int companyId = Int32.Parse(hdfCompanyId.Value);
                    string newSubject = ((TextBox)grdNotes.FooterRow.FindControl("tbxNoteSubjectNew")).Text.Trim();
                    int loginId = Convert.ToInt32(Session["loginID"]);
                    DateTime dateTime_ = DateTime.Now;
                    string newNote = ((TextBox)grdNotes.FooterRow.FindControl("tbxNoteNoteNew")).Text.Trim();
                    bool inServiceNoteDatabase = false;
                    int? libraryFilesId = null;
                    string fileName = ((Label)grdNotes.FooterRow.FindControl("lblFileNameNoteAttachmentNew")).Text.Trim();
                    if (fileName != "")
                    {
                        LibraryFilesGateway libraryFilesGateway = new LibraryFilesGateway();
                        libraryFilesId = libraryFilesGateway.GetlibraryFilesId(fileName);
                    }

                    ServiceInformationServiceNote model = new ServiceInformationServiceNote(serviceInformationTDS);
                    model.Insert(serviceId, newSubject, loginId, dateTime_, newNote, libraryFilesId, false, companyId, inServiceNoteDatabase);

                    Session.Remove("serviceNotesDummy");
                    Session["serviceInformationTDS"] = serviceInformationTDS;

                    grdNotes.DataBind();
                    grdNotes.PageIndex = grdNotes.PageCount - 1;
                }
            }
        }