Ejemplo n.º 1
0
        public static int Create(
            string userId,
            string claimType,
            string claimValue)
        {
            FbParameter[] arParams = new FbParameter[3];

            arParams[0]           = new FbParameter(":UserId", FbDbType.VarChar, 128);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = userId;

            arParams[1]           = new FbParameter(":ClaimType", FbDbType.VarChar, -1);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = claimType;

            arParams[2]           = new FbParameter(":ClaimValue", FbDbType.VarChar, -1);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = claimValue;

            string statement = "EXECUTE PROCEDURE mp_USERCLAIMS_INSERT ("
                               + FBSqlHelper.GetParamString(arParams.Length) + ")";

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            ConnectionString.GetWriteConnectionString(),
                                            CommandType.StoredProcedure,
                                            statement,
                                            arParams));

            return(newID);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts a row in the mp_BannedIPAddresses table. Returns new integer id.
        /// </summary>
        /// <param name="bannedIP"> bannedIP </param>
        /// <param name="bannedUTC"> bannedUTC </param>
        /// <param name="bannedReason"> bannedReason </param>
        /// <returns>int</returns>
        public static int Add(
            string bannedIP,
            DateTime bannedUtc,
            string bannedReason)
        {
            #region Bit Conversion

            #endregion

            FbParameter[] arParams = new FbParameter[3];

            arParams[0]           = new FbParameter(":BannedIP", FbDbType.VarChar, 50);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = bannedIP;

            arParams[1]           = new FbParameter(":BannedUTC", FbDbType.TimeStamp);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = bannedUtc;

            arParams[2]           = new FbParameter(":BannedReason", FbDbType.VarChar, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = bannedReason;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_BANNEDIPADDRESSES_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Inserts a row in the mp_SystemLog table. Returns new integer id.
        /// </summary>
        /// <param name="logDate"> logDate </param>
        /// <param name="ipAddress"> ipAddress </param>
        /// <param name="culture"> culture </param>
        /// <param name="url"> url </param>
        /// <param name="shortUrl"> shortUrl </param>
        /// <param name="thread"> thread </param>
        /// <param name="logLevel"> logLevel </param>
        /// <param name="logger"> logger </param>
        /// <param name="message"> message </param>
        /// <returns>int</returns>
        public static int Create(
            DateTime logDate,
            string ipAddress,
            string culture,
            string url,
            string shortUrl,
            string thread,
            string logLevel,
            string logger,
            string message)
        {
            FbParameter[] arParams = new FbParameter[9];

            arParams[0]           = new FbParameter(":LogDate", FbDbType.TimeStamp);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = logDate;

            arParams[1]           = new FbParameter(":IpAddress", FbDbType.VarChar, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = ipAddress;

            arParams[2]           = new FbParameter(":Culture", FbDbType.VarChar, 10);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = culture;

            arParams[3]           = new FbParameter(":Url", FbDbType.VarChar);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = url;

            arParams[4]           = new FbParameter(":ShortUrl", FbDbType.VarChar, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = shortUrl;

            arParams[5]           = new FbParameter(":Thread", FbDbType.VarChar, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = thread;

            arParams[6]           = new FbParameter(":LogLevel", FbDbType.VarChar, 20);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = logLevel;

            arParams[7]           = new FbParameter(":Logger", FbDbType.VarChar, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = logger;

            arParams[8]           = new FbParameter(":Message", FbDbType.VarChar);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = message;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetWriteConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_SYSTEMLOG_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 4
0
        public static int SchemaScriptHistoryAddSchemaScriptHistory(
            Guid applicationId,
            string scriptFile,
            DateTime runTime,
            bool errorOccurred,
            string errorMessage,
            string scriptBody)
        {
            #region Bit Conversion
            int intErrorOccurred;
            if (errorOccurred)
            {
                intErrorOccurred = 1;
            }
            else
            {
                intErrorOccurred = 0;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[6];

            arParams[0]           = new FbParameter(":ApplicationID", FbDbType.Char, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = applicationId.ToString();

            arParams[1]           = new FbParameter(":ScriptFile", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = scriptFile;

            arParams[2]           = new FbParameter(":RunTime", FbDbType.TimeStamp);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = runTime;

            arParams[3]           = new FbParameter(":ErrorOccurred", FbDbType.SmallInt);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = intErrorOccurred;

            arParams[4]           = new FbParameter(":ErrorMessage", FbDbType.VarChar);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = errorMessage;

            arParams[5]           = new FbParameter(":ScriptBody", FbDbType.VarChar);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = scriptBody;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_SCHEMASCRIPTHISTORY_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Inserts a row in the mp_IndexingQueue table. Returns new integer id.
        /// </summary>
        /// <param name="indexPath"> indexPath </param>
        /// <param name="serializedItem"> serializedItem </param>
        /// <param name="itemKey"> itemKey </param>
        /// <param name="removeOnly"> removeOnly </param>
        /// <returns>int</returns>
        public static Int64 Create(
            int siteId,
            string indexPath,
            string serializedItem,
            string itemKey,
            bool removeOnly)
        {
            #region Bit Conversion
            int intRemoveOnly;
            if (removeOnly)
            {
                intRemoveOnly = 1;
            }
            else
            {
                intRemoveOnly = 0;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[5];

            arParams[0]           = new FbParameter(":SiteID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = siteId;

            arParams[1]           = new FbParameter(":IndexPath", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = indexPath;

            arParams[2]           = new FbParameter(":SerializedItem", FbDbType.VarChar);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = serializedItem;

            arParams[3]           = new FbParameter(":ItemKey", FbDbType.VarChar, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = itemKey;

            arParams[4]           = new FbParameter(":RemoveOnly", FbDbType.SmallInt);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = intRemoveOnly;

            Int64 newID = Convert.ToInt64(FBSqlHelper.ExecuteScalar(
                                              ConnectionString.GetWriteConnectionString(),
                                              CommandType.StoredProcedure,
                                              "EXECUTE PROCEDURE MP_INDEXINGQUEUE_INSERT ("
                                              + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                              arParams));

            return(newID);
        }
Ejemplo n.º 6
0
        public static int AddSharedFileFolder(
            Guid folderGuid,
            Guid moduleGuid,
            Guid parentGuid,
            int moduleId,
            string folderName,
            int parentId)
        {
            FbParameter[] arParams = new FbParameter[6];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":FolderName", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = folderName;

            arParams[2]           = new FbParameter(":ParentID", FbDbType.Integer);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = parentId;

            arParams[3]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = moduleGuid.ToString();

            arParams[4]           = new FbParameter(":FolderGuid", FbDbType.Char, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = folderGuid.ToString();

            arParams[5]           = new FbParameter(":ParentGuid", FbDbType.Char, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = parentGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_SHAREDFILEFOLDERS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Deletes a row from the mp_BannedIPAddresses table. Returns true if row deleted.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <returns>bool</returns>
        public static bool Delete(
            int rowId)
        {
            FbParameter[] arParams = new FbParameter[1];

            arParams[0]           = new FbParameter("@RowID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowId;


            int rowsAffected = FBSqlHelper.ExecuteNonQuery(
                GetConnectionString(),
                CommandType.StoredProcedure,
                "EXECUTE PROCEDURE MP_BANNEDIPADDRESSES_DELETE ("
                + FBSqlHelper.GetParamString(arParams.Length) + ")",
                arParams);

            return(rowsAffected > -1);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Updates a row in the mp_BannedIPAddresses table. Returns true if row updated.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <param name="bannedIP"> bannedIP </param>
        /// <param name="bannedUTC"> bannedUTC </param>
        /// <param name="bannedReason"> bannedReason </param>
        /// <returns>bool</returns>
        public static bool Update(
            int rowId,
            string bannedIP,
            DateTime bannedUtc,
            string bannedReason)
        {
            #region Bit Conversion


            #endregion

            FbParameter[] arParams = new FbParameter[4];

            arParams[0]           = new FbParameter("@RowID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowId;

            arParams[1]           = new FbParameter("@BannedIP", FbDbType.VarChar, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = bannedIP;

            arParams[2]           = new FbParameter("@BannedUTC", FbDbType.TimeStamp);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = bannedUtc;

            arParams[3]           = new FbParameter("@BannedReason", FbDbType.VarChar, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = bannedReason;


            int rowsAffected = FBSqlHelper.ExecuteNonQuery(
                GetConnectionString(),
                CommandType.StoredProcedure,
                "EXECUTE PROCEDURE MP_BANNEDIPADDRESSES_UPDATE ("
                + FBSqlHelper.GetParamString(arParams.Length) + ")",
                arParams);

            return(rowsAffected > -1);
        }
Ejemplo n.º 9
0
        public static int RoleCreate(
            Guid roleGuid,
            Guid siteGuid,
            int siteId,
            string roleName)
        {
            FbParameter[] arParams = new FbParameter[5];

            arParams[0]           = new FbParameter(":SiteID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = siteId;

            arParams[1]           = new FbParameter(":RoleName", FbDbType.VarChar, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = roleName;

            arParams[2]           = new FbParameter(":DisplayName", FbDbType.VarChar, 50);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = roleName;

            arParams[3]           = new FbParameter(":SiteGuid", FbDbType.Char, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = siteGuid.ToString();

            arParams[4]           = new FbParameter(":RoleGuid", FbDbType.Char, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = roleGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_ROLES_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 10
0
        public static bool AddUser(
            int roleId,
            int userId,
            Guid roleGuid,
            Guid userGuid
            )
        {
            //MS SQL proc checks that no matching record exists, may need to check that
            //here
            FbParameter[] arParams = new FbParameter[4];

            arParams[0]           = new FbParameter(":UserID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = userId;

            arParams[1]           = new FbParameter(":RoleID", FbDbType.Integer);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = roleId;

            arParams[2]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = roleGuid.ToString();

            arParams[3]           = new FbParameter(":RoleGuid", FbDbType.Char, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = roleGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_USERROLES_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID > -1);
        }
Ejemplo n.º 11
0
        public static bool CreateModuleSetting(
            Guid settingGuid,
            Guid moduleGuid,
            int moduleId,
            string settingName,
            string settingValue,
            string controlType,
            string regexValidationExpression,
            string controlSrc,
            string helpKey,
            int sortOrder)
        {
            FbParameter[] arParams = new FbParameter[10];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":SettingName", FbDbType.VarChar, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = settingName;

            arParams[2]           = new FbParameter(":SettingValue", FbDbType.VarChar, 4000);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = settingValue;

            arParams[3]           = new FbParameter(":ControlType", FbDbType.VarChar, 50);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = controlType;

            arParams[4]           = new FbParameter(":RegexValidationExpression", FbDbType.VarChar);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = regexValidationExpression;

            arParams[5]           = new FbParameter(":SettingGuid", FbDbType.Char, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = settingGuid.ToString();

            arParams[6]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = moduleGuid.ToString();

            arParams[7]           = new FbParameter(":ControlSrc", FbDbType.VarChar, 50);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = controlSrc;

            arParams[8]           = new FbParameter(":HelpKey", FbDbType.VarChar, 50);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = helpKey;

            arParams[9]           = new FbParameter(":SortOrder", FbDbType.Integer);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = sortOrder;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_MODULESETTINGS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID > -1);
        }
Ejemplo n.º 12
0
        public static int AddRssFeed(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            int moduleId,
            int userId,
            string author,
            string url,
            string rssUrl,
            DateTime createdUtc,
            string imageUrl,
            string feedType,
            bool publishByDefault,
            int sortRank)
        {
            #region Bit Conversion
            int intPublishByDefault;
            if (publishByDefault)
            {
                intPublishByDefault = 1;
            }
            else
            {
                intPublishByDefault = 0;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[13];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = createdUtc;

            arParams[2]           = new FbParameter(":UserID", FbDbType.Integer);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = userId;

            arParams[3]           = new FbParameter(":Author", FbDbType.VarChar, 100);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = author;

            arParams[4]           = new FbParameter(":Url", FbDbType.VarChar, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = url;

            arParams[5]           = new FbParameter(":RssUrl", FbDbType.VarChar, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = rssUrl;

            arParams[6]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = itemGuid.ToString();

            arParams[7]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = moduleGuid.ToString();

            arParams[8]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = userGuid.ToString();

            arParams[9]           = new FbParameter(":ImageUrl", FbDbType.VarChar, 255);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = imageUrl;

            arParams[10]           = new FbParameter(":FeedType", FbDbType.VarChar, 20);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = feedType;

            arParams[11]           = new FbParameter(":PublishByDefault", FbDbType.SmallInt);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = intPublishByDefault;

            arParams[12]           = new FbParameter(":SortRank", FbDbType.Integer);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = sortRank;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_RSSFEEDS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 13
0
        public static int AddModuleDefinition(
            Guid featureGuid,
            int siteId,
            string featureName,
            string controlSrc,
            int sortOrder,
            int defaultCacheTime,
            String icon,
            bool isAdmin,
            string resourceFile,
            bool isCacheable,
            bool isSearchable,
            string searchListName,
            bool supportsPageReuse,
            string deleteProvider,
            string partialView)
        {
            #region Bit Conversion

            int intIsAdmin = 0;
            if (isAdmin)
            {
                intIsAdmin = 1;
            }

            int intIsCacheable = 0;
            if (isCacheable)
            {
                intIsCacheable = 1;
            }

            int intIsSearchable = 0;
            if (isSearchable)
            {
                intIsSearchable = 1;
            }

            int intSupportsPageReuse = 0;
            if (supportsPageReuse)
            {
                intSupportsPageReuse = 1;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[14];

            arParams[0]           = new FbParameter(":FeatureName", FbDbType.VarChar, 255);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = featureName;

            arParams[1]           = new FbParameter(":ControlSrc", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = controlSrc;

            arParams[2]           = new FbParameter(":SortOrder", FbDbType.Integer);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = sortOrder;

            arParams[3]           = new FbParameter(":IsAdmin", FbDbType.SmallInt);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = intIsAdmin;

            arParams[4]           = new FbParameter(":Icon", FbDbType.VarChar, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = icon;

            arParams[5]           = new FbParameter(":DefaultCacheTime", FbDbType.Integer);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = defaultCacheTime;

            arParams[6]           = new FbParameter(":Guid", FbDbType.Char, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = featureGuid.ToString();

            arParams[7]           = new FbParameter(":ResourceFile", FbDbType.VarChar, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = resourceFile;

            arParams[8]           = new FbParameter(":IsCacheable", FbDbType.SmallInt);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = intIsCacheable;

            arParams[9]           = new FbParameter(":IsSearchable", FbDbType.SmallInt);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = intIsSearchable;

            arParams[10]           = new FbParameter(":SearchListName", FbDbType.VarChar, 255);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = searchListName;

            arParams[11]           = new FbParameter(":SupportsPageReuse", FbDbType.SmallInt);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = intSupportsPageReuse;

            arParams[12]           = new FbParameter(":DeleteProvider", FbDbType.VarChar, 255);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = deleteProvider;

            arParams[13]           = new FbParameter(":PartialView", FbDbType.VarChar, 255);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = partialView;


            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_MODULEDEFINITIONS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            if (siteId > -1)
            {
                StringBuilder sqlCommand = new StringBuilder();
                // now add to  mp_SiteModuleDefinitions

                sqlCommand.Append("INSERT INTO mp_SiteModuleDefinitions (");
                sqlCommand.Append("SiteID, ");
                sqlCommand.Append("SiteGuid, ");
                sqlCommand.Append("FeatureGuid, ");
                sqlCommand.Append("AuthorizedRoles, ");
                sqlCommand.Append("ModuleDefID ) ");

                sqlCommand.Append(" VALUES (");
                sqlCommand.Append("@SiteID, ");
                sqlCommand.Append("(SELECT FIRST 1 SiteGuid FROM mp_Sites WHERE SiteID = @SiteID), ");
                sqlCommand.Append("(SELECT FIRST 1 Guid FROM mp_ModuleDefinitions WHERE ModuleDefID = @ModuleDefID), ");
                sqlCommand.Append("'All Users', ");
                sqlCommand.Append("@ModuleDefID ) ; ");

                arParams = new FbParameter[2];

                arParams[0]           = new FbParameter("@SiteID", FbDbType.Integer);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = siteId;

                arParams[1]           = new FbParameter("@ModuleDefID", FbDbType.Integer);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = newID;

                FBSqlHelper.ExecuteNonQuery(
                    GetConnectionString(),
                    sqlCommand.ToString(),
                    arParams);
            }

            return(newID);
        }
Ejemplo n.º 14
0
        //public static void SyncDefinitions()
        //{
        //    StringBuilder sqlCommand = new StringBuilder();
        //    sqlCommand.Append("UPDATE mp_ModuleSettings ");
        //    sqlCommand.Append("SET ControlSrc = (SELECT FIRST 1 mds.ControlSrc ");
        //    sqlCommand.Append("FROM mp_ModuleDefinitionSettings mds  ");
        //    sqlCommand.Append("WHERE mds.ModuleDefId IN (SELECT ModuleDefId  ");
        //    sqlCommand.Append("FROM mp_Modules m ");
        //    sqlCommand.Append("WHERE m.ModuleID = mp_ModuleSettings.ModuleID) ");
        //    sqlCommand.Append("AND mds.SettingName = mp_ModuleSettings.SettingName); ");
        //    sqlCommand.Append(" ");

        //    FBSqlHelper.ExecuteNonQuery(
        //        GetConnectionString(),
        //        sqlCommand.ToString(),
        //        null);

        //    sqlCommand = new StringBuilder();
        //    sqlCommand.Append("UPDATE mp_ModuleSettings ");
        //    sqlCommand.Append("SET ControlType = (SELECT FIRST 1 mds.ControlType ");
        //    sqlCommand.Append("FROM mp_ModuleDefinitionSettings mds  ");
        //    sqlCommand.Append("WHERE mds.ModuleDefId IN (SELECT ModuleDefId  ");
        //    sqlCommand.Append("FROM mp_Modules m ");
        //    sqlCommand.Append("WHERE m.ModuleID = mp_ModuleSettings.ModuleID) ");
        //    sqlCommand.Append("AND mds.SettingName = mp_ModuleSettings.SettingName); ");
        //    sqlCommand.Append(" ");

        //    FBSqlHelper.ExecuteNonQuery(
        //        GetConnectionString(),
        //        sqlCommand.ToString(),
        //        null);

        //    sqlCommand = new StringBuilder();
        //    sqlCommand.Append("UPDATE mp_ModuleSettings ");
        //    sqlCommand.Append("SET SortOrder = (SELECT FIRST 1 mds.SortOrder ");
        //    sqlCommand.Append("FROM mp_ModuleDefinitionSettings mds  ");
        //    sqlCommand.Append("WHERE mds.ModuleDefId IN (SELECT ModuleDefId  ");
        //    sqlCommand.Append("FROM mp_Modules m ");
        //    sqlCommand.Append("WHERE m.ModuleID = mp_ModuleSettings.ModuleID) ");
        //    sqlCommand.Append("AND mds.SettingName = mp_ModuleSettings.SettingName); ");
        //    sqlCommand.Append(" ");

        //    FBSqlHelper.ExecuteNonQuery(
        //        GetConnectionString(),
        //        sqlCommand.ToString(),
        //        null);

        //    sqlCommand = new StringBuilder();
        //    sqlCommand.Append("UPDATE mp_ModuleSettings ");
        //    sqlCommand.Append("SET HelpKey = (SELECT FIRST 1 mds.HelpKey ");
        //    sqlCommand.Append("FROM mp_ModuleDefinitionSettings mds  ");
        //    sqlCommand.Append("WHERE mds.ModuleDefId IN (SELECT ModuleDefId  ");
        //    sqlCommand.Append("FROM mp_Modules m ");
        //    sqlCommand.Append("WHERE m.ModuleID = mp_ModuleSettings.ModuleID) ");
        //    sqlCommand.Append("AND mds.SettingName = mp_ModuleSettings.SettingName); ");
        //    sqlCommand.Append(" ");

        //    FBSqlHelper.ExecuteNonQuery(
        //        GetConnectionString(),
        //        sqlCommand.ToString(),
        //        null);

        //    sqlCommand = new StringBuilder();
        //    sqlCommand.Append("UPDATE mp_ModuleSettings ");
        //    sqlCommand.Append("SET RegexValidationExpression = (SELECT FIRST 1 mds.RegexValidationExpression ");
        //    sqlCommand.Append("FROM mp_ModuleDefinitionSettings mds  ");
        //    sqlCommand.Append("WHERE mds.ModuleDefId IN (SELECT ModuleDefId  ");
        //    sqlCommand.Append("FROM mp_Modules m ");
        //    sqlCommand.Append("WHERE m.ModuleID = mp_ModuleSettings.ModuleID) ");
        //    sqlCommand.Append("AND mds.SettingName = mp_ModuleSettings.SettingName); ");
        //    sqlCommand.Append(" ");

        //    FBSqlHelper.ExecuteNonQuery(
        //        GetConnectionString(),
        //        sqlCommand.ToString(),
        //        null);



        //}


        public static bool UpdateModuleDefinitionSetting(
            Guid featureGuid,
            int moduleDefId,
            string resourceFile,
            string groupName,
            string settingName,
            string settingValue,
            string controlType,
            string regexValidationExpression,
            string controlSrc,
            string helpKey,
            int sortOrder)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("SELECT count(*) ");
            sqlCommand.Append("FROM	mp_ModuleDefinitionSettings ");

            sqlCommand.Append("WHERE (ModuleDefID = @ModuleDefID OR FeatureGuid = @FeatureGuid)  ");
            sqlCommand.Append("AND SettingName = @SettingName  ;");

            FbParameter[] arParams = new FbParameter[3];

            arParams[0]           = new FbParameter("@ModuleDefID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleDefId;

            arParams[1]           = new FbParameter("@SettingName", FbDbType.VarChar, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = settingName;

            arParams[2]           = new FbParameter("@FeatureGuid", FbDbType.VarChar, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = featureGuid;

            int count = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            sqlCommand.ToString(),
                                            arParams).ToString());

            sqlCommand = new StringBuilder();

            int rowsAffected = 0;

            if (count > 0)
            {
                sqlCommand.Append("UPDATE mp_ModuleDefinitionSettings ");
                sqlCommand.Append("SET SettingValue = @SettingValue,  ");
                sqlCommand.Append("FeatureGuid = @FeatureGuid,  ");
                sqlCommand.Append("ResourceFile = @ResourceFile,  ");
                sqlCommand.Append("ControlType = @ControlType,  ");
                sqlCommand.Append("ControlSrc = @ControlSrc,  ");
                sqlCommand.Append("HelpKey = @HelpKey,  ");
                sqlCommand.Append("SortOrder = @SortOrder,  ");
                sqlCommand.Append("GroupName = @GroupName,  ");
                sqlCommand.Append("RegexValidationExpression = @RegexValidationExpression  ");

                sqlCommand.Append("WHERE (ModuleDefID = @ModuleDefID OR FeatureGuid = @FeatureGuid)  ");
                sqlCommand.Append("AND SettingName = @SettingName  ; ");

                arParams = new FbParameter[11];

                arParams[0]           = new FbParameter("@ModuleDefID", FbDbType.Integer);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = moduleDefId;

                arParams[1]           = new FbParameter("@SettingName", FbDbType.VarChar, 50);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = settingName;

                arParams[2]           = new FbParameter("@SettingValue", FbDbType.VarChar, 255);
                arParams[2].Direction = ParameterDirection.Input;
                arParams[2].Value     = settingValue;

                arParams[3]           = new FbParameter("@ControlType", FbDbType.VarChar, 50);
                arParams[3].Direction = ParameterDirection.Input;
                arParams[3].Value     = controlType;

                arParams[4]           = new FbParameter("@RegexValidationExpression", FbDbType.VarChar);
                arParams[4].Direction = ParameterDirection.Input;
                arParams[4].Value     = regexValidationExpression;

                arParams[5]           = new FbParameter("@FeatureGuid", FbDbType.VarChar, 36);
                arParams[5].Direction = ParameterDirection.Input;
                arParams[5].Value     = featureGuid;

                arParams[6]           = new FbParameter("@ResourceFile", FbDbType.VarChar, 255);
                arParams[6].Direction = ParameterDirection.Input;
                arParams[6].Value     = resourceFile;

                arParams[7]           = new FbParameter("@ControlSrc", FbDbType.VarChar, 255);
                arParams[7].Direction = ParameterDirection.Input;
                arParams[7].Value     = controlSrc;

                arParams[8]           = new FbParameter("@HelpKey", FbDbType.VarChar, 255);
                arParams[8].Direction = ParameterDirection.Input;
                arParams[8].Value     = helpKey;

                arParams[9]           = new FbParameter("@SortOrder", FbDbType.Integer);
                arParams[9].Direction = ParameterDirection.Input;
                arParams[9].Value     = sortOrder;

                arParams[10]           = new FbParameter("@GroupName", FbDbType.VarChar, 255);
                arParams[10].Direction = ParameterDirection.Input;
                arParams[10].Value     = groupName;

                rowsAffected = FBSqlHelper.ExecuteNonQuery(
                    GetConnectionString(),
                    sqlCommand.ToString(),
                    arParams);

                return(rowsAffected > 0);
            }
            else
            {
                arParams = new FbParameter[11];

                arParams[0]           = new FbParameter(":ModuleDefID", FbDbType.Integer);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = moduleDefId;

                arParams[1]           = new FbParameter(":SettingName", FbDbType.VarChar, 50);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = settingName;

                arParams[2]           = new FbParameter(":SettingValue", FbDbType.VarChar, 255);
                arParams[2].Direction = ParameterDirection.Input;
                arParams[2].Value     = settingValue;

                arParams[3]           = new FbParameter(":ControlType", FbDbType.VarChar, 50);
                arParams[3].Direction = ParameterDirection.Input;
                arParams[3].Value     = controlType;

                arParams[4]           = new FbParameter(":RegexValidationExpression", FbDbType.VarChar);
                arParams[4].Direction = ParameterDirection.Input;
                arParams[4].Value     = regexValidationExpression;

                arParams[5]           = new FbParameter(":FeatureGuid", FbDbType.Char, 36);
                arParams[5].Direction = ParameterDirection.Input;
                arParams[5].Value     = featureGuid.ToString();

                arParams[6]           = new FbParameter(":ResourceFile", FbDbType.VarChar, 255);
                arParams[6].Direction = ParameterDirection.Input;
                arParams[6].Value     = resourceFile;

                arParams[7]           = new FbParameter(":ControlSrc", FbDbType.VarChar, 255);
                arParams[7].Direction = ParameterDirection.Input;
                arParams[7].Value     = controlSrc;

                arParams[8]           = new FbParameter(":HelpKey", FbDbType.VarChar, 255);
                arParams[8].Direction = ParameterDirection.Input;
                arParams[8].Value     = helpKey;

                arParams[9]           = new FbParameter(":SortOrder", FbDbType.Integer);
                arParams[9].Direction = ParameterDirection.Input;
                arParams[9].Value     = sortOrder;

                arParams[10]           = new FbParameter(":GroupName", FbDbType.VarChar, 255);
                arParams[10].Direction = ParameterDirection.Input;
                arParams[10].Value     = groupName;


                rowsAffected = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                                   GetConnectionString(),
                                                   CommandType.StoredProcedure,
                                                   "EXECUTE PROCEDURE MP_MODULEDEFINITIONSETTINGS_INS ("
                                                   + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                                   arParams));

                return(rowsAffected > 0);
            }
        }
Ejemplo n.º 15
0
        public static bool AddHistory(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            int itemId,
            int moduleId,
            string friendlyName,
            string originalFileName,
            string serverFileName,
            int sizeInKB,
            DateTime uploadDate,
            int uploadUserId,
            DateTime archiveDate)
        {
            FbParameter[] arParams = new FbParameter[12];

            arParams[0]           = new FbParameter(":ItemID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = itemId;

            arParams[1]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = moduleId;

            arParams[2]           = new FbParameter(":FriendlyName", FbDbType.VarChar, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = friendlyName;

            arParams[3]           = new FbParameter(":OriginalFileName", FbDbType.VarChar, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = originalFileName;

            arParams[4]           = new FbParameter(":ServerFileName", FbDbType.VarChar, 50);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = serverFileName;

            arParams[5]           = new FbParameter(":SizeInKB", FbDbType.Integer);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = sizeInKB;

            arParams[6]           = new FbParameter(":UploadDate", FbDbType.TimeStamp);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = uploadDate;

            arParams[7]           = new FbParameter(":ArchiveDate", FbDbType.TimeStamp);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = archiveDate;

            arParams[8]           = new FbParameter(":UploadUserID", FbDbType.Integer);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = uploadUserId;

            arParams[9]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = itemGuid.ToString();

            arParams[10]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = moduleGuid.ToString();

            arParams[11]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = userGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_SHAREDFILESHISTORY_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));


            return(newID > 0);
        }
Ejemplo n.º 16
0
        public static int AddHtmlContent(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            string title,
            string excerpt,
            string body,
            string moreLink,
            int sortOrder,
            DateTime beginDate,
            DateTime endDate,
            DateTime createdDate,
            int userId,
            Guid userGuid,
            bool excludeFromRecentContent)
        {
            FbParameter[] arParams = new FbParameter[14];

            int exclude = 0;

            if (excludeFromRecentContent)
            {
                exclude = 1;
            }

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":Title", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new FbParameter(":Excerpt", FbDbType.VarChar);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = excerpt;

            arParams[3]           = new FbParameter(":Body", FbDbType.VarChar);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = body;

            arParams[4]           = new FbParameter(":MoreLink", FbDbType.VarChar, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = moreLink;

            arParams[5]           = new FbParameter(":SortOrder", FbDbType.Integer);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = sortOrder;

            arParams[6]           = new FbParameter(":BeginDate", FbDbType.TimeStamp);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = beginDate;

            arParams[7]           = new FbParameter(":EndDate", FbDbType.TimeStamp);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = endDate;

            arParams[8]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = createdDate;

            arParams[9]           = new FbParameter(":UserID", FbDbType.Integer);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = userId;

            arParams[10]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = itemGuid.ToString();

            arParams[11]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = moduleGuid.ToString();

            arParams[12]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = userGuid.ToString();

            arParams[13]           = new FbParameter(":ExcludeFromRecentContent", FbDbType.Integer);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = exclude;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_HTMLCONTENT_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 17
0
        public static int AddGalleryImage(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            int displayOrder,
            string caption,
            string description,
            string metaDataXml,
            string imageFile,
            string webImageFile,
            string thumbnailFile,
            DateTime uploadDate,
            string uploadUser,
            Guid userGuid)
        {
            #region Bit Conversion

            #endregion

            FbParameter[] arParams = new FbParameter[13];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":DisplayOrder", FbDbType.Integer);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = displayOrder;

            arParams[2]           = new FbParameter(":Caption", FbDbType.VarChar, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = caption;

            arParams[3]           = new FbParameter(":Description", FbDbType.VarChar);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = description;

            arParams[4]           = new FbParameter(":MetaDataXml", FbDbType.VarChar);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = metaDataXml;

            arParams[5]           = new FbParameter(":ImageFile", FbDbType.VarChar, 100);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = imageFile;

            arParams[6]           = new FbParameter(":WebImageFile", FbDbType.VarChar, 100);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = webImageFile;

            arParams[7]           = new FbParameter(":ThumbnailFile", FbDbType.VarChar, 100);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = thumbnailFile;

            arParams[8]           = new FbParameter(":UploadDate", FbDbType.TimeStamp);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = uploadDate;

            arParams[9]           = new FbParameter(":UploadUser", FbDbType.VarChar, 100);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = uploadUser;

            arParams[10]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = itemGuid.ToString();

            arParams[11]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = moduleGuid.ToString();

            arParams[12]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = userGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_GALLERYIMAGES_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Inserts a row in the mp_CalendarEvents table. Returns new integer id.
        /// </summary>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="moduleID"> moduleID </param>
        /// <param name="title"> title </param>
        /// <param name="description"> description </param>
        /// <param name="imageName"> imageName </param>
        /// <param name="eventDate"> eventDate </param>
        /// <param name="startTime"> startTime </param>
        /// <param name="endTime"> endTime </param>
        /// <param name="userID"> userID </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="location"> location </param>
        /// <param name="requiresTicket"> requiresTicket </param>
        /// <param name="ticketPrice"> ticketPrice </param>
        /// <param name="createdDate"> createdDate </param>
        /// <returns>int</returns>
        public static int AddCalendarEvent(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            string title,
            string description,
            string imageName,
            DateTime eventDate,
            DateTime startTime,
            DateTime endTime,
            int userId,
            Guid userGuid,
            string location,
            bool requiresTicket,
            decimal ticketPrice,
            DateTime createdDate)
        {
            #region Bit Conversion

            int intRequiresTicket;
            if (requiresTicket)
            {
                intRequiresTicket = 1;
            }
            else
            {
                intRequiresTicket = 0;
            }


            #endregion


            FbParameter[] arParams = new FbParameter[15];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":Title", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new FbParameter(":Description", FbDbType.VarChar);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = description;

            arParams[3]           = new FbParameter(":ImageName", FbDbType.VarChar, 100);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = imageName;

            arParams[4]           = new FbParameter(":EventDate", FbDbType.TimeStamp);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = eventDate;

            arParams[5]           = new FbParameter(":StartTime", FbDbType.Time);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = startTime;

            arParams[6]           = new FbParameter(":EndTime", FbDbType.Time);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = endTime;

            arParams[7]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = DateTime.UtcNow;

            arParams[8]           = new FbParameter(":UserID", FbDbType.Integer);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = userId;

            arParams[9]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = itemGuid.ToString();

            arParams[10]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = moduleGuid.ToString();

            arParams[11]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = userGuid.ToString();

            arParams[12]           = new FbParameter(":Location", FbDbType.VarChar);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = location;

            arParams[13]           = new FbParameter(":TicketPrice", FbDbType.Decimal);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = ticketPrice;

            arParams[14]           = new FbParameter(":RequiresTicket", FbDbType.SmallInt);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = intRequiresTicket;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_CALENDAREVENTS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 19
0
        public static int AddLink(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            string title,
            string url,
            int viewOrder,
            string description,
            DateTime createdDate,
            int createdBy,
            string target,
            Guid userGuid)
        {
            FbParameter[] arParams = new FbParameter[11];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":Title", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new FbParameter(":Url", FbDbType.VarChar, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = url;

            arParams[3]           = new FbParameter(":Target", FbDbType.VarChar, 20);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = target;

            arParams[4]           = new FbParameter(":ViewOrder", FbDbType.Integer);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = viewOrder;

            arParams[5]           = new FbParameter(":Description", FbDbType.Text);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = description;

            arParams[6]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = createdDate;

            arParams[7]           = new FbParameter(":CreatedBy", FbDbType.Integer);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = createdBy;

            arParams[8]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = itemGuid.ToString();

            arParams[9]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = moduleGuid.ToString();

            arParams[10]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = userGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_LINKS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Inserts a row in the mp_LetterSendLog table. Returns new integer id.
        /// </summary>
        /// <param name="letterGuid"> letterGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="emailAddress"> emailAddress </param>
        /// <param name="uTC"> uTC </param>
        /// <param name="errorOccurred"> errorOccurred </param>
        /// <param name="errorMessage"> errorMessage </param>
        /// <returns>int</returns>
        public static int Create(
            Guid letterGuid,
            Guid userGuid,
            Guid subscribeGuid,
            string emailAddress,
            DateTime uTC,
            bool errorOccurred,
            string errorMessage)
        {
            #region Bit Conversion
            int intErrorOccurred;
            if (errorOccurred)
            {
                intErrorOccurred = 1;
            }
            else
            {
                intErrorOccurred = 0;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[7];

            arParams[0]           = new FbParameter(":LetterGuid", FbDbType.Char, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = letterGuid.ToString();

            arParams[1]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = userGuid.ToString();

            arParams[2]           = new FbParameter(":SubscribeGuid", FbDbType.Char, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = subscribeGuid.ToString();

            arParams[3]           = new FbParameter(":EmailAddress", FbDbType.VarChar, 100);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = emailAddress;

            arParams[4]           = new FbParameter(":UTC", FbDbType.TimeStamp);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = uTC;

            arParams[5]           = new FbParameter(":ErrorOccurred", FbDbType.SmallInt);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = intErrorOccurred;

            arParams[6]           = new FbParameter(":ErrorMessage", FbDbType.VarChar);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = errorMessage;

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_LETTERSENDLOG_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Inserts a row in the mp_FriendlyUrls table. Returns new integer id.
        /// </summary>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="pageGuid"> pageGuid </param>
        /// <param name="siteID"> siteID </param>
        /// <param name="friendlyUrl"> friendlyUrl </param>
        /// <param name="realUrl"> realUrl </param>
        /// <param name="isPattern"> isPattern </param>
        /// <returns>int</returns>
        public static int AddFriendlyUrl(
            Guid itemGuid,
            Guid siteGuid,
            Guid pageGuid,
            int siteId,
            string friendlyUrl,
            string realUrl,
            bool isPattern)
        {
            #region Bit Conversion
            int intIsPattern;
            if (isPattern)
            {
                intIsPattern = 1;
            }
            else
            {
                intIsPattern = 0;
            }


            #endregion

            FbParameter[] arParams = new FbParameter[7];

            arParams[0]           = new FbParameter(":SiteID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = siteId;

            arParams[1]           = new FbParameter(":FriendlyUrl", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = friendlyUrl;

            arParams[2]           = new FbParameter(":RealUrl", FbDbType.VarChar, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = realUrl;

            arParams[3]           = new FbParameter(":IsPattern", FbDbType.SmallInt);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = intIsPattern;

            arParams[4]           = new FbParameter(":PageGuid", FbDbType.Char, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = pageGuid.ToString();

            arParams[5]           = new FbParameter(":SiteGuid", FbDbType.Char, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = siteGuid.ToString();

            arParams[6]           = new FbParameter(":ItemGuid", FbDbType.Char, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = itemGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            GetConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_FRIENDLYURLS_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }