private void UpdateDatabase()
        {
            DB.Open();
            DB.BeginTransaction();
            try
            {
                int companyId = Int32.Parse(hdfCompanyId.Value);
                DateTime creationDate = DateTime.Now;

                SupportTicketAddBasicInformation supportTicketAddBasicInformation = new SupportTicketAddBasicInformation(supportTicketAddTDS);
                hdfSupportTicketId.Value = supportTicketAddBasicInformation.Save(creationDate, companyId).ToString();

                // Send mail
                SendMailForNewTicket();

                DB.CommitTransaction();

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

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }
        private void PostPageChanges()
        {
            int companyId = Int32.Parse(hdfCompanyId.Value);
            string subject = hdfSubject.Value;
            string comments = hdfComments.Value;
            DateTime? dueDate = null; if (hdfDueDate.Value != "") dueDate = DateTime.Parse(hdfDueDate.Value);
            int assignTeamMemberId = Int32.Parse(hdfTeamMemberId.Value);
            string state = "New";
            string type_ = "AssignUser";
            int loginId = Convert.ToInt32(Session["loginID"]);
            EmployeeGateway employeeGateway = new EmployeeGateway(new DataSet());
            hdfTeamMemberId.Value = employeeGateway.GetEmployeIdByLoginId(loginId).ToString();
            int employeeId = Int32.Parse(hdfTeamMemberId.Value);
            int categoryId = Int32.Parse(hdfCategoriesSelected.Value);
            SupportTicketCategoryGateway supportTicketCategoryGateway = new SupportTicketCategoryGateway();
            supportTicketCategoryGateway.LoadByCategoryId(categoryId, companyId);
            string categoryName = supportTicketCategoryGateway.GetName(categoryId);

            // Insert to dataset
            SupportTicketAddBasicInformation supportTicketAddBasicInformation = new SupportTicketAddBasicInformation(supportTicketAddTDS);
            supportTicketAddBasicInformation.Insert(categoryId, subject, comments, dueDate, assignTeamMemberId, false, companyId, state, employeeId, type_, categoryName);

            // Store session
            Session["supportTicketAddTDS"] = supportTicketAddTDS;
        }