private void UpdateDatabase()
        {
            DB.Open();
            DB.BeginTransaction();
            try
            {
                Guid id = new Guid(hdfId.Value);
                int refId = Int32.Parse(hdfRefId.Value);
                int companyId = Int32.Parse(hdfCompanyId.Value);

                // Save Comments
                FlatSectionJlinerJuntionLiner2Comment flatSectionJlinerJuntionLiner2Comment = new FlatSectionJlinerJuntionLiner2Comment(flatSectionJlinerTDS);
                flatSectionJlinerJuntionLiner2Comment.Save(id, companyId);

                // Save History
                FlatSectionJlinerJuntionLiner2History flatSectionJlinerJuntionLiner2History = new FlatSectionJlinerJuntionLiner2History(flatSectionJlinerTDS);
                flatSectionJlinerJuntionLiner2History.Save(id, companyId);

                // Save jliner
                FlatSectionJliner flatSectionJlinerUpdateCommentsHistory = new FlatSectionJliner();
                flatSectionJlinerUpdateCommentsHistory.LoadByIdRefId(id, refId, companyId);
                flatSectionJlinerUpdateCommentsHistory.UpdateComments(id.ToString());
                flatSectionJlinerUpdateCommentsHistory.UpdateHistory(id.ToString());

                Session["flatSectionJlinerTDS"] = flatSectionJlinerTDS;
                flatSectionJlinerUpdateCommentsHistory.Save(companyId);

                // Update FlatSectionJliner for new Comments
                FlatSectionJliner flatSectionJlinerForCommentsHistory = new FlatSectionJliner(flatSectionJlinerTDS);
                flatSectionJlinerForCommentsHistory.UpdateCommentsHistoryForSummaryEdit();

                Session["flatSectionJlinerTDS"] = flatSectionJlinerTDS;

                DB.CommitTransaction();
            }
            catch (Exception ex)
            {
                DB.RollbackTransaction();

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }