public int JMD_PAGE_SAVE(string pageId, string siteURL, string pageName,
            string pageCaption, string metaTitle, string metaDesc,
            string metaKeywords, string parentPageName, string isPublished,
            string isRoot, string isMenuItem,
            string viewRoles, string addRoles, string editRoles, string deleteRoles,
            string moveRoles, string addModuleRoles, string isInternal,
            string loadShared_Modules, string pageSort, string isViewStateEnabled)
        {
            int returnValue = 0;
            DBConnManager dbConn = new DBConnManager();
            SqlConnection myConn = dbConn.GetDBConnection();
            try
            {
                SqlCommand command = new SqlCommand("JMD_PAGE_SAVE");
                command.Connection = myConn;
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("@Page_Id", SqlDbType.Int));
                command.Parameters["@Page_Id"].Value = pageId;
                command.Parameters.Add(new SqlParameter("@Site_URL", SqlDbType.NVarChar, 255));
                command.Parameters["@Site_URL"].Value = siteURL;
                command.Parameters.Add(new SqlParameter("@PAGE_NAME", SqlDbType.NVarChar, 255));
                command.Parameters["@PAGE_NAME"].Value = pageName;
                command.Parameters.Add(new SqlParameter("@PAGE_CAPTION", SqlDbType.NVarChar, 255));
                command.Parameters["@PAGE_CAPTION"].Value = pageCaption;
                command.Parameters.Add(new SqlParameter("@META_TITLE", SqlDbType.NVarChar, 255));
                command.Parameters["@META_TITLE"].Value = metaTitle;
                command.Parameters.Add(new SqlParameter("@META_DESC", SqlDbType.NVarChar, 1000));
                command.Parameters["@META_DESC"].Value = metaDesc;
                command.Parameters.Add(new SqlParameter("@META_KEYWORDS", SqlDbType.NVarChar, 1000));
                command.Parameters["@META_KEYWORDS"].Value = metaKeywords;
                command.Parameters.Add(new SqlParameter("@PARENT_PAGE_NAME", SqlDbType.NVarChar, 255));
                command.Parameters["@PARENT_PAGE_NAME"].Value = parentPageName;
                command.Parameters.Add(new SqlParameter("@IS_PUBLISHED", SqlDbType.Int));
                command.Parameters["@IS_PUBLISHED"].Value = isPublished;
                command.Parameters.Add(new SqlParameter("@IS_ROOT", SqlDbType.Int));
                command.Parameters["@IS_ROOT"].Value = isRoot;
                command.Parameters.Add(new SqlParameter("@IS_MENU_ITEM", SqlDbType.Int));
                command.Parameters["@IS_MENU_ITEM"].Value = isMenuItem;
                command.Parameters.Add(new SqlParameter("@VIEW_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@VIEW_ROLES"].Value = viewRoles;
                command.Parameters.Add(new SqlParameter("@ADD_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@ADD_ROLES"].Value = addRoles;
                command.Parameters.Add(new SqlParameter("@EDIT_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@EDIT_ROLES"].Value = editRoles;
                command.Parameters.Add(new SqlParameter("@DELETE_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@DELETE_ROLES"].Value = deleteRoles;
                command.Parameters.Add(new SqlParameter("@MOVE_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@MOVE_ROLES"].Value = moveRoles;
                command.Parameters.Add(new SqlParameter("@ADD_MODULE_ROLES", SqlDbType.NVarChar, 1000));
                command.Parameters["@ADD_MODULE_ROLES"].Value = addModuleRoles;
                command.Parameters.Add(new SqlParameter("@IS_INTERNAL", SqlDbType.Int));
                command.Parameters["@IS_INTERNAL"].Value = isInternal;
                command.Parameters.Add(new SqlParameter("@Load_Shared_Modules", SqlDbType.Int));
                command.Parameters["@Load_Shared_Modules"].Value = loadShared_Modules;
                command.Parameters.Add(new SqlParameter("@iPage_Sort", SqlDbType.Int));
                command.Parameters["@iPage_Sort"].Value = pageSort;
                command.Parameters.Add(new SqlParameter("@Is_ViewState_Enabled", SqlDbType.Int));
                command.Parameters["@Is_ViewState_Enabled"].Value = isViewStateEnabled;
                command.Parameters.Add(new SqlParameter("@Return_Page_Id", SqlDbType.Int));
                command.Parameters["@Return_Page_Id"].Direction = ParameterDirection.Output;
                command.ExecuteNonQuery();
                command.Dispose();

                returnValue = (int)command.Parameters["@Return_Page_Id"].Value;
            }
            catch (Exception ex)
            {
                returnValue = -1;
            }
            finally
            {
                dbConn.CloseDBConnection(myConn);
            }
            return returnValue;
        }
        public int CreateSite(string companyId, string siteName, string aliasSiteId,
            string styleSheet, string siteVersion, string siteFolder, string userName)
        {
            int returnValue = 0;
            /*string tempSql = string.Format(SqlCreate_Site, companyId, siteId, siteURL, aliasSiteId, styleSheet, siteVersion, siteFolder, userName, DateTime.Now, userName, DateTime.Now, "0");
            returnValue = dbAccessManager.GetCommand(tempSql);*/
            DBConnManager dbConn = new DBConnManager();
            SqlConnection myConn = dbConn.GetDBConnection();
            try
            {
                SqlCommand command = new SqlCommand();
                command.CommandText = "EXEC JMD_SITE_CREATE '" + siteName + "','*****@*****.**'";
                command.CommandType = CommandType.Text;
                command.Connection = myConn;
                command.ExecuteNonQuery();
                command.Dispose();

                returnValue = dbAccessManager.GetCommand(string.Format(SqlCreate_Site, companyId, styleSheet, siteFolder, userName, DateTime.Now, siteName));
            }
            catch (Exception ex)
            {
                returnValue = -1;
            }
            finally
            {
                dbConn.CloseDBConnection(myConn);
            }
            return returnValue;
        }