private void UpdateDatabase()
        {
            // Get ids
            int companyId = Int32.Parse(hdfCompanyId.Value);

            DB.Open();
            DB.BeginTransaction();
            try
            {
                // ... Update general todo list state
                ToDoListInformationBasicInformation toDoListInformationBasicInformation = new ToDoListInformationBasicInformation(toDoListInformationTDS);
                toDoListInformationBasicInformation.Save(companyId);

                // ... Save to do list details
                ToDoListInformationActivityInformation toDoListInformationActivityInformation = new ToDoListInformationActivityInformation(toDoListInformationTDS);
                toDoListInformationActivityInformation.Save(companyId);

                // ... Send mails
                if (hdfCompleted.Value == "True")
                {
                    SendMailForCompletedToDo();
                }

                DB.CommitTransaction();

                // Store datasets
                toDoListInformationTDS.AcceptChanges();
                Session["toDoListInformationTDS"] = toDoListInformationTDS;
            }
            catch (Exception ex)
            {
                DB.RollbackTransaction();

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }
        private void UpdateDatabase()
        {
            // Get ids & location
            //string workType = hdfWorkType.Value.Trim();
            int companyId = Int32.Parse(hdfCompanyId.Value);
            int toDoId = Int32.Parse(hdfToDoId.Value);

            DB.Open();
            DB.BeginTransaction();
            try
            {
                // Save toDo details
                ToDoListInformationBasicInformation toDoListInformationBasicInformation = new ToDoListInformationBasicInformation(toDoListInformationTDS);
                toDoListInformationBasicInformation.Save(companyId);

                //// Save work details
                //PointToDoWorkDetails pointToDoWorkDetails = new PointToDoWorkDetails(toDoListInformationTDS);
                //pointToDoWorkDetails.Save(countryId, provinceId, countyId, cityId, projectId, sectionAssetId, companyId);

                DB.CommitTransaction();

                // Store datasets
                toDoListInformationTDS.AcceptChanges();
                Session["toDoListInformationTDS"] = toDoListInformationTDS;
            }
            catch (Exception ex)
            {
                DB.RollbackTransaction();

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