Esempio n. 1
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)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ModuleSettings (");
            sqlCommand.Append("ModuleID, ");
            sqlCommand.Append("SettingName, ");
            sqlCommand.Append("SettingValue, ");
            sqlCommand.Append("ControlType, ");
            sqlCommand.Append("ControlSrc, ");
            sqlCommand.Append("HelpKey, ");
            sqlCommand.Append("SortOrder, ");
            sqlCommand.Append("RegexValidationExpression, ");
            sqlCommand.Append("SettingGuid, ");
            sqlCommand.Append("ModuleGuid )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":ModuleID, ");
            sqlCommand.Append(":SettingName, ");
            sqlCommand.Append(":SettingValue, ");
            sqlCommand.Append(":ControlType, ");
            sqlCommand.Append(":ControlSrc, ");
            sqlCommand.Append(":HelpKey, ");
            sqlCommand.Append(":SortOrder, ");
            sqlCommand.Append(":RegexValidationExpression, ");
            sqlCommand.Append(":SettingGuid, ");
            sqlCommand.Append(":ModuleGuid )");
            sqlCommand.Append(";");


            SqliteParameter[] arParams = new SqliteParameter[10];

            arParams[0]           = new SqliteParameter(":ModuleID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = settingName;

            arParams[2]           = new SqliteParameter(":SettingValue", DbType.Object);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = settingValue;

            arParams[3]           = new SqliteParameter(":ControlType", DbType.String, 50);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = controlType;

            arParams[4]           = new SqliteParameter(":RegexValidationExpression", DbType.Object);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = regexValidationExpression;

            arParams[5]           = new SqliteParameter(":SettingGuid", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = settingGuid.ToString();

            arParams[6]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = moduleGuid.ToString();

            arParams[7]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = controlSrc;

            arParams[8]           = new SqliteParameter(":HelpKey", DbType.String, 255);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = helpKey;

            arParams[9]           = new SqliteParameter(":SortOrder", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = sortOrder;

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

            return(rowsAffected > 0);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates a row in the mp_AuthorizeNetLog table. Returns true if row updated.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="storeGuid"> storeGuid </param>
        /// <param name="cartGuid"> cartGuid </param>
        /// <param name="rawResponse"> rawResponse </param>
        /// <param name="responseCode"> responseCode </param>
        /// <param name="responseReasonCode"> responseReasonCode </param>
        /// <param name="reason"> reason </param>
        /// <param name="avsCode"> avsCode </param>
        /// <param name="ccvCode"> ccvCode </param>
        /// <param name="cavCode"> cavCode </param>
        /// <param name="transactionId"> transactionId </param>
        /// <param name="transactionType"> transactionType </param>
        /// <param name="method"> method </param>
        /// <param name="authCode"> authCode </param>
        /// <param name="amount"> amount </param>
        /// <param name="tax"> tax </param>
        /// <param name="duty"> duty </param>
        /// <param name="freight"> freight </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid rowGuid,
            Guid siteGuid,
            Guid userGuid,
            Guid storeGuid,
            Guid cartGuid,
            string rawResponse,
            string responseCode,
            string responseReasonCode,
            string reason,
            string avsCode,
            string ccvCode,
            string cavCode,
            string transactionId,
            string transactionType,
            string method,
            string authCode,
            decimal amount,
            decimal tax,
            decimal duty,
            decimal freight)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_AuthorizeNetLog ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("SiteGuid = :SiteGuid, ");
            sqlCommand.Append("UserGuid = :UserGuid, ");
            sqlCommand.Append("StoreGuid = :StoreGuid, ");
            sqlCommand.Append("CartGuid = :CartGuid, ");
            sqlCommand.Append("RawResponse = :RawResponse, ");
            sqlCommand.Append("ResponseCode = :ResponseCode, ");
            sqlCommand.Append("ResponseReasonCode = :ResponseReasonCode, ");
            sqlCommand.Append("Reason = :Reason, ");
            sqlCommand.Append("AvsCode = :AvsCode, ");
            sqlCommand.Append("CcvCode = :CcvCode, ");
            sqlCommand.Append("CavCode = :CavCode, ");
            sqlCommand.Append("TransactionId = :TransactionId, ");
            sqlCommand.Append("TransactionType = :TransactionType, ");
            sqlCommand.Append("Method = :Method, ");
            sqlCommand.Append("AuthCode = :AuthCode, ");
            sqlCommand.Append("Amount = :Amount, ");
            sqlCommand.Append("Tax = :Tax, ");
            sqlCommand.Append("Duty = :Duty, ");
            sqlCommand.Append("Freight = :Freight ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("RowGuid = :RowGuid ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[20];

            arParams[0]           = new SqliteParameter(":RowGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowGuid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = userGuid.ToString();

            arParams[3]           = new SqliteParameter(":StoreGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = storeGuid.ToString();

            arParams[4]           = new SqliteParameter(":CartGuid", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = cartGuid.ToString();

            arParams[5]           = new SqliteParameter(":RawResponse", DbType.Object);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = rawResponse;

            arParams[6]           = new SqliteParameter(":ResponseCode", DbType.String, 1);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = responseCode;

            arParams[7]           = new SqliteParameter(":ResponseReasonCode", DbType.String, 20);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = responseReasonCode;

            arParams[8]           = new SqliteParameter(":Reason", DbType.Object);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = reason;

            arParams[9]           = new SqliteParameter(":AvsCode", DbType.String, 50);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = avsCode;

            arParams[10]           = new SqliteParameter(":CcvCode", DbType.String, 1);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = ccvCode;

            arParams[11]           = new SqliteParameter(":CavCode", DbType.String, 1);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = cavCode;

            arParams[12]           = new SqliteParameter(":TransactionId", DbType.String, 50);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = transactionId;

            arParams[13]           = new SqliteParameter(":TransactionType", DbType.String, 50);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = transactionType;

            arParams[14]           = new SqliteParameter(":Method", DbType.String, 20);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = method;

            arParams[15]           = new SqliteParameter(":AuthCode", DbType.String, 50);
            arParams[15].Direction = ParameterDirection.Input;
            arParams[15].Value     = authCode;

            arParams[16]           = new SqliteParameter(":Amount", DbType.Decimal);
            arParams[16].Direction = ParameterDirection.Input;
            arParams[16].Value     = amount;

            arParams[17]           = new SqliteParameter(":Tax", DbType.Decimal);
            arParams[17].Direction = ParameterDirection.Input;
            arParams[17].Value     = tax;

            arParams[18]           = new SqliteParameter(":Duty", DbType.Decimal);
            arParams[18].Direction = ParameterDirection.Input;
            arParams[18].Value     = duty;

            arParams[19]           = new SqliteParameter(":Freight", DbType.Decimal);
            arParams[19].Direction = ParameterDirection.Input;
            arParams[19].Value     = freight;


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

            return(rowsAffected > -1);
        }
Esempio n. 3
0
        /// <summary>
        /// Updates a row in the mp_Comments table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="title"> title </param>
        /// <param name="userComment"> userComment </param>
        /// <param name="userName"> userName </param>
        /// <param name="userEmail"> userEmail </param>
        /// <param name="userUrl"> userUrl </param>
        /// <param name="userIp"> userIp </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="moderationStatus"> moderationStatus </param>
        /// <param name="moderatedBy"> moderatedBy </param>
        /// <param name="moderationReason"> moderationReason </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            Guid userGuid,
            string title,
            string userComment,
            string userName,
            string userEmail,
            string userUrl,
            string userIp,
            DateTime lastModUtc,
            byte moderationStatus,
            Guid moderatedBy,
            string moderationReason)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_Comments ");
            sqlCommand.Append("SET  ");

            sqlCommand.Append("UserGuid = :UserGuid, ");
            sqlCommand.Append("Title = :Title, ");
            sqlCommand.Append("UserComment = :UserComment, ");
            sqlCommand.Append("UserName = :UserName, ");
            sqlCommand.Append("UserEmail = :UserEmail, ");
            sqlCommand.Append("UserUrl = :UserUrl, ");
            sqlCommand.Append("UserIp = :UserIp, ");
            sqlCommand.Append("LastModUtc = :LastModUtc, ");
            sqlCommand.Append("ModerationStatus = :ModerationStatus, ");
            sqlCommand.Append("ModeratedBy = :ModeratedBy, ");
            sqlCommand.Append("ModerationReason = :ModerationReason ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("Guid = :Guid ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[12];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = userGuid.ToString();

            arParams[2]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = title;

            arParams[3]           = new SqliteParameter(":UserComment", DbType.Object);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = userComment;

            arParams[4]           = new SqliteParameter(":UserName", DbType.String, 50);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = userName;

            arParams[5]           = new SqliteParameter(":UserEmail", DbType.String, 100);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = userEmail;

            arParams[6]           = new SqliteParameter(":UserUrl", DbType.String, 255);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = userUrl;

            arParams[7]           = new SqliteParameter(":UserIp", DbType.String, 50);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = userIp;

            arParams[8]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = lastModUtc;

            arParams[9]           = new SqliteParameter(":ModerationStatus", DbType.UInt16);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = moderationStatus;

            arParams[10]           = new SqliteParameter(":ModeratedBy", DbType.String, 36);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = moderatedBy.ToString();

            arParams[11]           = new SqliteParameter(":ModerationReason", DbType.String, 255);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = moderationReason;

            int rowsAffected = SqliteHelper.ExecuteNonQuery(
                ConnectionString.GetConnectionString(),
                sqlCommand.ToString(),
                arParams);

            return(rowsAffected > -1);
        }
Esempio n. 4
0
        /// <summary>
        /// Inserts a row in the mp_ContentRating table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="contentGuid"> contentGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="emailAddress"> emailAddress </param>
        /// <param name="rating"> rating </param>
        /// <param name="comments"> comments </param>
        /// <param name="ipAddress"> ipAddress </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <returns>int</returns>
        public static int Create(
            Guid rowGuid,
            Guid siteGuid,
            Guid contentGuid,
            Guid userGuid,
            string emailAddress,
            int rating,
            string comments,
            string ipAddress,
            DateTime createdUtc)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ContentRating (");
            sqlCommand.Append("RowGuid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("ContentGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("EmailAddress, ");
            sqlCommand.Append("Rating, ");
            sqlCommand.Append("Comments, ");
            sqlCommand.Append("IpAddress, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("LastModUtc )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":RowGuid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":ContentGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":EmailAddress, ");
            sqlCommand.Append(":Rating, ");
            sqlCommand.Append(":Comments, ");
            sqlCommand.Append(":IpAddress, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":CreatedUtc )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[9];

            arParams[0]           = new SqliteParameter(":RowGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowGuid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":ContentGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = contentGuid.ToString();

            arParams[3]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = userGuid.ToString();

            arParams[4]           = new SqliteParameter(":EmailAddress", DbType.String, 100);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = emailAddress;

            arParams[5]           = new SqliteParameter(":Rating", DbType.Int32);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = rating;

            arParams[6]           = new SqliteParameter(":Comments", DbType.Object);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = comments;

            arParams[7]           = new SqliteParameter(":IpAddress", DbType.String, 50);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = ipAddress;

            arParams[8]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = createdUtc;


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

            return(rowsAffected);
        }
Esempio n. 5
0
        public static bool UpdateSharedFileFolder(
            int folderId,
            int moduleId,
            string folderName,
            int parentId,
            Guid parentGuid,
            string viewRoles
            )
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_SharedFileFolders ");
            sqlCommand.Append("SET ");
            sqlCommand.Append("ModuleID = :ModuleID, ");
            sqlCommand.Append("FolderName = :FolderName, ");
            sqlCommand.Append("ParentID = :ParentID, ");
            sqlCommand.Append("ParentGuid = :ParentGuid, ");
            sqlCommand.Append("ViewRoles = :ViewRoles ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("FolderID = :FolderID ;");

            SqliteParameter[] arParams = new SqliteParameter[6];

            arParams[0] = new SqliteParameter(":FolderID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = folderId
            };

            arParams[1] = new SqliteParameter(":ModuleID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = moduleId
            };

            arParams[2] = new SqliteParameter(":FolderName", DbType.String, 255)
            {
                Direction = ParameterDirection.Input,
                Value     = folderName
            };

            arParams[3] = new SqliteParameter(":ParentID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = parentId
            };

            arParams[4] = new SqliteParameter(":ParentGuid", DbType.String, 36)
            {
                Direction = ParameterDirection.Input,
                Value     = parentGuid.ToString()
            };

            arParams[5] = new SqliteParameter(":ViewRoles", DbType.Object)
            {
                Direction = ParameterDirection.Input,
                Value     = viewRoles
            };

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

            return(rowsAffected > -1);
        }
Esempio n. 6
0
        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,
            string attributes,
            string options)
        {
            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  ;");

            SqliteParameter[] arParams = new SqliteParameter[3];

            arParams[0]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleDefId;

            arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = settingName;

            arParams[2]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = featureGuid;


            int count = Convert.ToInt32(SqliteHelper.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("Attributes = :Attributes,  ");
                sqlCommand.Append("Options = :Options  ");

                sqlCommand.Append("WHERE ModuleDefID = :ModuleDefID  ");
                sqlCommand.Append("AND SettingName = :SettingName  ; ");

                arParams = new SqliteParameter[13];

                arParams[0]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = moduleDefId;

                arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = settingName;

                arParams[2]           = new SqliteParameter(":SettingValue", DbType.String, 255);
                arParams[2].Direction = ParameterDirection.Input;
                arParams[2].Value     = settingValue;

                arParams[3]           = new SqliteParameter(":ControlType", DbType.String, 50);
                arParams[3].Direction = ParameterDirection.Input;
                arParams[3].Value     = controlType;

                arParams[4]           = new SqliteParameter(":RegexValidationExpression", DbType.Object);
                arParams[4].Direction = ParameterDirection.Input;
                arParams[4].Value     = regexValidationExpression;

                arParams[5]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
                arParams[5].Direction = ParameterDirection.Input;
                arParams[5].Value     = featureGuid;

                arParams[6]           = new SqliteParameter(":ResourceFile", DbType.String, 255);
                arParams[6].Direction = ParameterDirection.Input;
                arParams[6].Value     = resourceFile;

                arParams[7]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
                arParams[7].Direction = ParameterDirection.Input;
                arParams[7].Value     = controlSrc;

                arParams[8]           = new SqliteParameter(":HelpKey", DbType.String, 255);
                arParams[8].Direction = ParameterDirection.Input;
                arParams[8].Value     = helpKey;

                arParams[9]           = new SqliteParameter(":SortOrder", DbType.Int32);
                arParams[9].Direction = ParameterDirection.Input;
                arParams[9].Value     = sortOrder;

                arParams[10]           = new SqliteParameter(":GroupName", DbType.String, 255);
                arParams[10].Direction = ParameterDirection.Input;
                arParams[10].Value     = groupName;

                arParams[11]           = new SqliteParameter(":Attributes", DbType.Object);
                arParams[11].Direction = ParameterDirection.Input;
                arParams[11].Value     = attributes;

                arParams[12]           = new SqliteParameter(":Options", DbType.Object);
                arParams[12].Direction = ParameterDirection.Input;
                arParams[12].Value     = options;

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

                return(rowsAffected > 0);
            }
            else
            {
                sqlCommand.Append("INSERT INTO mp_ModuleDefinitionSettings ");
                sqlCommand.Append("( ");
                sqlCommand.Append("FeatureGuid, ");
                sqlCommand.Append("ModuleDefID, ");
                sqlCommand.Append("ResourceFile, ");
                sqlCommand.Append("SettingName, ");
                sqlCommand.Append("SettingValue, ");
                sqlCommand.Append("ControlType, ");
                sqlCommand.Append("ControlSrc, ");
                sqlCommand.Append("HelpKey, ");
                sqlCommand.Append("SortOrder, ");
                sqlCommand.Append("GroupName, ");
                sqlCommand.Append("RegexValidationExpression, ");
                sqlCommand.Append("Attributes, ");
                sqlCommand.Append("Options");
                sqlCommand.Append(")");

                sqlCommand.Append("VALUES (  ");
                sqlCommand.Append(" :FeatureGuid  , ");
                sqlCommand.Append(" :ModuleDefID , ");
                sqlCommand.Append(" :ResourceFile  , ");
                sqlCommand.Append(" :SettingName  , ");
                sqlCommand.Append(" :SettingValue  ,");
                sqlCommand.Append(" :ControlType  ,");
                sqlCommand.Append(" :ControlSrc, ");
                sqlCommand.Append(" :HelpKey, ");
                sqlCommand.Append(" :SortOrder, ");
                sqlCommand.Append(" :GroupName, ");
                sqlCommand.Append(" :RegexValidationExpression,  ");
                sqlCommand.Append(" :Attributes,  ");
                sqlCommand.Append(" :Options  ");
                sqlCommand.Append(");");

                arParams = new SqliteParameter[13];

                arParams[0]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = moduleDefId;

                arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = settingName;

                arParams[2]           = new SqliteParameter(":SettingValue", DbType.String, 255);
                arParams[2].Direction = ParameterDirection.Input;
                arParams[2].Value     = settingValue;

                arParams[3]           = new SqliteParameter(":ControlType", DbType.String, 50);
                arParams[3].Direction = ParameterDirection.Input;
                arParams[3].Value     = controlType;

                arParams[4]           = new SqliteParameter(":RegexValidationExpression", DbType.Object);
                arParams[4].Direction = ParameterDirection.Input;
                arParams[4].Value     = regexValidationExpression;

                arParams[5]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
                arParams[5].Direction = ParameterDirection.Input;
                arParams[5].Value     = featureGuid;

                arParams[6]           = new SqliteParameter(":ResourceFile", DbType.String, 255);
                arParams[6].Direction = ParameterDirection.Input;
                arParams[6].Value     = resourceFile;

                arParams[7]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
                arParams[7].Direction = ParameterDirection.Input;
                arParams[7].Value     = controlSrc;

                arParams[8]           = new SqliteParameter(":HelpKey", DbType.String, 255);
                arParams[8].Direction = ParameterDirection.Input;
                arParams[8].Value     = helpKey;

                arParams[9]           = new SqliteParameter(":SortOrder", DbType.Int32);
                arParams[9].Direction = ParameterDirection.Input;
                arParams[9].Value     = sortOrder;

                arParams[10]           = new SqliteParameter(":GroupName", DbType.String, 255);
                arParams[10].Direction = ParameterDirection.Input;
                arParams[10].Value     = groupName;

                arParams[11]           = new SqliteParameter(":Attributes", DbType.Object);
                arParams[11].Direction = ParameterDirection.Input;
                arParams[11].Value     = attributes;

                arParams[12]           = new SqliteParameter(":Options", DbType.Object);
                arParams[12].Direction = ParameterDirection.Input;
                arParams[12].Value     = options;

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

                return(rowsAffected > 0);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Updates a row in the mp_ContentMetaLink table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="rel"> rel </param>
        /// <param name="href"> href </param>
        /// <param name="hrefLang"> hrefLang </param>
        /// <param name="rev"> rev </param>
        /// <param name="type"> type </param>
        /// <param name="media"> media </param>
        /// <param name="sortRank"> sortRank </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string rel,
            string href,
            string hrefLang,
            string rev,
            string type,
            string media,
            int sortRank,
            DateTime lastModUtc,
            Guid lastModBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_ContentMetaLink ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("Rel = :Rel, ");
            sqlCommand.Append("Href = :Href, ");
            sqlCommand.Append("HrefLang = :HrefLang, ");
            sqlCommand.Append("Rev = :Rev, ");
            sqlCommand.Append("Type = :Type, ");
            sqlCommand.Append("Media = :Media, ");
            sqlCommand.Append("SortRank = :SortRank, ");
            sqlCommand.Append("LastModUtc = :LastModUtc, ");
            sqlCommand.Append("LastModBy = :LastModBy ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("Guid = :Guid ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[10];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":Rel", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = rel;

            arParams[2]           = new SqliteParameter(":Href", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = href;

            arParams[3]           = new SqliteParameter(":HrefLang", DbType.String, 10);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = hrefLang;

            arParams[4]           = new SqliteParameter(":Rev", DbType.String, 50);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = rev;

            arParams[5]           = new SqliteParameter(":Type", DbType.String, 50);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = type;

            arParams[6]           = new SqliteParameter(":Media", DbType.String, 50);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = media;

            arParams[7]           = new SqliteParameter(":SortRank", DbType.Int32);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = sortRank;

            arParams[8]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = lastModUtc;

            arParams[9]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = lastModBy.ToString();


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

            return(rowsAffected > -1);
        }
Esempio n. 8
0
        /// <summary>
        /// Updates a row in the mp_RssFeedEntries table. Returns true if row updated.
        /// </summary>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="title"> title </param>
        /// <param name="author"> author </param>
        /// <param name="blogUrl"> blogUrl </param>
        /// <param name="description"> description </param>
        /// <param name="link"> link </param>
        /// <param name="entryHash"> entryHash </param>
        /// <param name="cachedTimeUtc"> cachedTimeUtc </param>
        /// <returns>bool</returns>
        public static bool UpdateEnry(
            Guid moduleGuid,
            string title,
            string author,
            string blogUrl,
            string description,
            string link,
            int entryHash,
            DateTime cachedTimeUtc)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_RssFeedEntries ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("Title = :Title, ");
            sqlCommand.Append("Author = :Author, ");
            sqlCommand.Append("BlogUrl = :BlogUrl, ");
            sqlCommand.Append("Description = :Description, ");
            sqlCommand.Append("Link = :Link, ");
            sqlCommand.Append("CachedTimeUtc = :CachedTimeUtc ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("ModuleGuid = :ModuleGuid ");
            sqlCommand.Append(" AND EntryHash = :EntryHash ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[8];

            arParams[0]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleGuid.ToString();

            arParams[1]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new SqliteParameter(":Author", DbType.String, 100);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = author;

            arParams[3]           = new SqliteParameter(":BlogUrl", DbType.String, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = blogUrl;

            arParams[4]           = new SqliteParameter(":Description", DbType.Object);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = description;

            arParams[5]           = new SqliteParameter(":Link", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = link;

            arParams[6]           = new SqliteParameter(":EntryHash", DbType.Int32);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = entryHash;

            arParams[7]           = new SqliteParameter(":CachedTimeUtc", DbType.DateTime);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = cachedTimeUtc;

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

            return(rowsAffected > -1);
        }
Esempio n. 9
0
        /// <summary>
        /// Inserts a row in the mp_FileAttachment table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="specialGuid1"> specialGuid1 </param>
        /// <param name="specialGuid2"> specialGuid2 </param>
        /// <param name="serverFileName"> serverFileName </param>
        /// <param name="fileName"> fileName </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="createdBy"> createdBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid rowGuid,
            Guid siteGuid,
            Guid moduleGuid,
            Guid itemGuid,
            Guid specialGuid1,
            Guid specialGuid2,
            string serverFileName,
            string fileName,
            string contentTitle,
            long contentLength,
            string contentType,
            DateTime createdUtc,
            Guid createdBy)
        {
            #region Bit Conversion


            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_FileAttachment (");
            sqlCommand.Append("RowGuid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("ItemGuid, ");
            sqlCommand.Append("SpecialGuid1, ");
            sqlCommand.Append("SpecialGuid2, ");
            sqlCommand.Append("ServerFileName, ");
            sqlCommand.Append("FileName, ");
            sqlCommand.Append("ContentTitle, ");
            sqlCommand.Append("ContentLength, ");
            sqlCommand.Append("ContentType, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("CreatedBy )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":RowGuid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":ItemGuid, ");
            sqlCommand.Append(":SpecialGuid1, ");
            sqlCommand.Append(":SpecialGuid2, ");
            sqlCommand.Append(":ServerFileName, ");
            sqlCommand.Append(":FileName, ");
            sqlCommand.Append(":ContentTitle, ");
            sqlCommand.Append(":ContentLength, ");
            sqlCommand.Append(":ContentType, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":CreatedBy )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[13];

            arParams[0]           = new SqliteParameter(":RowGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowGuid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = moduleGuid.ToString();

            arParams[3]           = new SqliteParameter(":ItemGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = itemGuid.ToString();

            arParams[4]           = new SqliteParameter(":SpecialGuid1", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = specialGuid1.ToString();

            arParams[5]           = new SqliteParameter(":SpecialGuid2", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = specialGuid2.ToString();

            arParams[6]           = new SqliteParameter(":ServerFileName", DbType.String, 255);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = serverFileName;

            arParams[7]           = new SqliteParameter(":FileName", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = fileName;

            arParams[8]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = createdUtc;

            arParams[9]           = new SqliteParameter(":CreatedBy", DbType.String, 36);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = createdBy.ToString();

            arParams[10]           = new SqliteParameter(":ContentLength", DbType.Int64);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = contentLength;

            arParams[11]           = new SqliteParameter(":ContentType", DbType.String, 50);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = contentType;

            arParams[12]           = new SqliteParameter(":ContentTitle", DbType.String, 255);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = contentTitle;


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

            return(rowsAffected);
        }
Esempio n. 10
0
        public static bool UpdateRssFeed(
            int itemId,
            int moduleId,
            string author,
            string url,
            string rssUrl,
            Guid lastModUserGuid,
            DateTime lastModUtc,
            string imageUrl,
            string feedType,
            bool publishByDefault,
            int sortRank)
        {
            #region Bit Conversion

            int intPublishByDefault;
            if (publishByDefault)
            {
                intPublishByDefault = 1;
            }
            else
            {
                intPublishByDefault = 0;
            }


            #endregion

            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_RssFeeds ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("ModuleID = :ModuleID, ");
            sqlCommand.Append("Author = :Author, ");
            sqlCommand.Append("Url = :Url, ");
            sqlCommand.Append("RssUrl = :RssUrl,");
            sqlCommand.Append("LastModUserGuid = :LastModUserGuid, ");
            sqlCommand.Append("LastModUtc = :LastModUtc, ");
            sqlCommand.Append("ImageUrl = :ImageUrl, ");
            sqlCommand.Append("FeedType = :FeedType, ");
            sqlCommand.Append("SortRank = :SortRank, ");
            sqlCommand.Append("PublishByDefault = :PublishByDefault ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("ItemID = :ItemID ;");

            SqliteParameter[] arParams = new SqliteParameter[11];

            arParams[0]           = new SqliteParameter(":ItemID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = itemId;

            arParams[1]           = new SqliteParameter(":ModuleID", DbType.Int32);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = moduleId;

            arParams[2]           = new SqliteParameter(":Author", DbType.String, 100);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = author;

            arParams[3]           = new SqliteParameter(":Url", DbType.String, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = url;

            arParams[4]           = new SqliteParameter(":RssUrl", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = rssUrl;

            arParams[5]           = new SqliteParameter(":LastModUserGuid", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = lastModUserGuid.ToString();

            arParams[6]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = lastModUtc;

            arParams[7]           = new SqliteParameter(":ImageUrl", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = imageUrl;

            arParams[8]           = new SqliteParameter(":FeedType", DbType.String, 20);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = feedType;

            arParams[9]           = new SqliteParameter(":PublishByDefault", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = intPublishByDefault;

            arParams[10]           = new SqliteParameter(":SortRank", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = sortRank;

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

            return(rowsAffected > -1);
        }
Esempio n. 11
0
        /// <summary>
        /// Inserts a row in the mp_RssFeedEntries table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="feedGuid"> feedGuid </param>
        /// <param name="pubDate"> pubDate </param>
        /// <param name="title"> title </param>
        /// <param name="author"> author </param>
        /// <param name="blogUrl"> blogUrl </param>
        /// <param name="description"> description </param>
        /// <param name="link"> link </param>
        /// <param name="confirmed"> confirmed </param>
        /// <param name="entryHash"> entryHash </param>
        /// <param name="cachedTimeUtc"> cachedTimeUtc </param>
        /// <returns>int</returns>
        public static int CreateEntry(
            Guid rowGuid,
            Guid moduleGuid,
            Guid feedGuid,
            int feedId,
            DateTime pubDate,
            string title,
            string author,
            string blogUrl,
            string description,
            string link,
            bool confirmed,
            int entryHash,
            DateTime cachedTimeUtc)
        {
            #region Bit Conversion

            int intConfirmed;
            if (confirmed)
            {
                intConfirmed = 1;
            }
            else
            {
                intConfirmed = 0;
            }


            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_RssFeedEntries (");
            sqlCommand.Append("RowGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("FeedGuid, ");
            sqlCommand.Append("FeedId, ");
            sqlCommand.Append("PubDate, ");
            sqlCommand.Append("Title, ");
            sqlCommand.Append("Author, ");
            sqlCommand.Append("BlogUrl, ");
            sqlCommand.Append("Description, ");
            sqlCommand.Append("Link, ");
            sqlCommand.Append("Confirmed, ");
            sqlCommand.Append("EntryHash, ");
            sqlCommand.Append("CachedTimeUtc )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":RowGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":FeedGuid, ");
            sqlCommand.Append(":FeedId, ");
            sqlCommand.Append(":PubDate, ");
            sqlCommand.Append(":Title, ");
            sqlCommand.Append(":Author, ");
            sqlCommand.Append(":BlogUrl, ");
            sqlCommand.Append(":Description, ");
            sqlCommand.Append(":Link, ");
            sqlCommand.Append(":Confirmed, ");
            sqlCommand.Append(":EntryHash, ");
            sqlCommand.Append(":CachedTimeUtc )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[13];

            arParams[0]           = new SqliteParameter(":RowGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowGuid.ToString();

            arParams[1]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = moduleGuid.ToString();

            arParams[2]           = new SqliteParameter(":FeedGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = feedGuid.ToString();

            arParams[3]           = new SqliteParameter(":FeedId", DbType.Int32);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = feedId;

            arParams[4]           = new SqliteParameter(":PubDate", DbType.DateTime);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = pubDate;

            arParams[5]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = title;

            arParams[6]           = new SqliteParameter(":Author", DbType.String, 100);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = author;

            arParams[7]           = new SqliteParameter(":BlogUrl", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = blogUrl;

            arParams[8]           = new SqliteParameter(":Description", DbType.Object);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = description;

            arParams[9]           = new SqliteParameter(":Link", DbType.String, 255);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = link;

            arParams[10]           = new SqliteParameter(":Confirmed", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = intConfirmed;

            arParams[11]           = new SqliteParameter(":EntryHash", DbType.Int32);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = entryHash;

            arParams[12]           = new SqliteParameter(":CachedTimeUtc", DbType.DateTime);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = cachedTimeUtc;


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

            return(rowsAffected);
        }
Esempio n. 12
0
        public static bool UpdateHtmlContent(
            int itemId,
            int moduleId,
            string title,
            string excerpt,
            string body,
            string moreLink,
            int sortOrder,
            DateTime beginDate,
            DateTime endDate,
            DateTime lastModUtc,
            Guid lastModUserGuid,
            bool excludeFromRecentContent)
        {
            int exclude = 0;

            if (excludeFromRecentContent)
            {
                exclude = 1;
            }

            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_HtmlContent ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("BeginDate = :BeginDate  , ");
            sqlCommand.Append("EndDate = :EndDate  , ");
            sqlCommand.Append("Title = :Title  , ");
            sqlCommand.Append("Excerpt = :Excerpt  , ");
            sqlCommand.Append("Body = :Body , ");
            sqlCommand.Append("MoreLink = :MoreLink, ");
            sqlCommand.Append("ExcludeFromRecentContent = :ExcludeFromRecentContent, ");
            sqlCommand.Append("LastModUserGuid = :LastModUserGuid, ");
            sqlCommand.Append("LastModUtc = :LastModUtc ");

            sqlCommand.Append("WHERE ItemID = :ItemID ;");

            SqliteParameter[] arParams = new SqliteParameter[11];

            arParams[0]           = new SqliteParameter(":ItemID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = itemId;

            arParams[1]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new SqliteParameter(":Excerpt", DbType.Object);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = excerpt;

            arParams[3]           = new SqliteParameter(":Body", DbType.Object);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = body;

            arParams[4]           = new SqliteParameter(":MoreLink", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = moreLink;

            arParams[5]           = new SqliteParameter(":BeginDate", DbType.DateTime);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = beginDate;

            arParams[6]           = new SqliteParameter(":EndDate", DbType.DateTime);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = endDate;

            arParams[7]           = new SqliteParameter(":SortOrder", DbType.Int32);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = sortOrder;

            arParams[8]           = new SqliteParameter(":LastModUserGuid", DbType.String, 36);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = lastModUserGuid.ToString();

            arParams[9]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = lastModUtc;

            arParams[10]           = new SqliteParameter(":ExcludeFromRecentContent", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = exclude;

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

            return(rowsAffected > -1);
        }
Esempio n. 13
0
        public static bool UpdateLink(
            int itemId,
            int moduleId,
            string title,
            string url,
            int viewOrder,
            string description,
            DateTime createdDate,
            string target,
            int createdBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_Links ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("ModuleID = :ModuleID, ");
            sqlCommand.Append("Title = :Title, ");
            sqlCommand.Append("Url = :Url, ");
            sqlCommand.Append("ViewOrder = :ViewOrder, ");
            sqlCommand.Append("Description = :Description, ");
            sqlCommand.Append("CreatedDate = :CreatedDate, ");
            sqlCommand.Append("Target = :Target,");
            sqlCommand.Append("CreatedBy = :CreatedBy ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("ItemID = :ItemID ;");

            SqliteParameter[] arParams = new SqliteParameter[9];

            arParams[0]           = new SqliteParameter(":ItemID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = itemId;

            arParams[1]           = new SqliteParameter(":ModuleID", DbType.Int32);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = moduleId;

            arParams[2]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = title;

            arParams[3]           = new SqliteParameter(":Url", DbType.String, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = url;

            arParams[4]           = new SqliteParameter(":ViewOrder", DbType.Int32);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = viewOrder;

            arParams[5]           = new SqliteParameter(":Description", DbType.Object);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = description;

            arParams[6]           = new SqliteParameter(":CreatedDate", DbType.DateTime);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = createdDate;

            arParams[7]           = new SqliteParameter(":Target", DbType.String, 20);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = target;

            arParams[8]           = new SqliteParameter(":CreatedBy", DbType.Int32);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = createdBy;

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

            return(rowsAffected > -1);
        }
Esempio n. 14
0
        public static bool UpdateModuleSetting(
            Guid moduleGuid,
            int moduleId,
            string settingName,
            string settingValue)
        {
            StringBuilder sqlCommand = new StringBuilder();

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

            sqlCommand.Append("WHERE ModuleID = :ModuleID  ");
            sqlCommand.Append("AND SettingName = :SettingName  ;");

            SqliteParameter[] arParams = new SqliteParameter[2];

            arParams[0]           = new SqliteParameter(":ModuleID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = settingName;



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

            sqlCommand = new StringBuilder();

            int rowsAffected = 0;

            if (count > 0)
            {
                sqlCommand.Append("UPDATE mp_ModuleSettings ");
                sqlCommand.Append("SET SettingValue = :SettingValue  ");

                sqlCommand.Append("WHERE ModuleID = :ModuleID  ");
                sqlCommand.Append("AND SettingName = :SettingName  ");

                arParams = new SqliteParameter[3];

                arParams[0]           = new SqliteParameter(":ModuleID", DbType.Int32);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = moduleId;

                arParams[1]           = new SqliteParameter(":SettingName", DbType.String, 50);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = settingName;

                arParams[2]           = new SqliteParameter(":SettingValue", DbType.Object);
                arParams[2].Direction = ParameterDirection.Input;
                arParams[2].Value     = settingValue;

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

                return(rowsAffected > 0);
            }
            else
            {
                return(false);

                //return CreateModuleSetting(
                //    Guid.NewGuid(),
                //    moduleGuid,
                //    moduleId,
                //    settingName,
                //    settingValue,
                //    "TextBox",
                //    string.Empty);
            }
        }
Esempio n. 15
0
        public static bool UpdateModuleDefinition(
            int moduleDefId,
            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,
            string skinFileName)
        {
            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;
            }


            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_ModuleDefinitions ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("FeatureName = :FeatureName, ");
            sqlCommand.Append("ControlSrc = :ControlSrc, ");
            sqlCommand.Append("SortOrder = :SortOrder, ");
            sqlCommand.Append("DefaultCacheTime = :DefaultCacheTime, ");
            sqlCommand.Append("Icon = :Icon, ");
            sqlCommand.Append("IsAdmin = :IsAdmin, ");
            sqlCommand.Append("IsCacheable = :IsCacheable, ");
            sqlCommand.Append("IsSearchable = :IsSearchable, ");
            sqlCommand.Append("SearchListName = :SearchListName, ");
            sqlCommand.Append("SupportsPageReuse = :SupportsPageReuse, ");
            sqlCommand.Append("DeleteProvider = :DeleteProvider, ");
            sqlCommand.Append("PartialView = :PartialView, ");
            sqlCommand.Append("ResourceFile = :ResourceFile, ");
            sqlCommand.Append("SkinFileName = :SkinFileName ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("ModuleDefID = :ModuleDefID ;");

            SqliteParameter[] arParams = new SqliteParameter[15];

            arParams[0]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleDefId;

            arParams[1]           = new SqliteParameter(":FeatureName", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = featureName;

            arParams[2]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = controlSrc;

            arParams[3]           = new SqliteParameter(":SortOrder", DbType.Int32);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = sortOrder;

            arParams[4]           = new SqliteParameter(":IsAdmin", DbType.Int32);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = intIsAdmin;

            arParams[5]           = new SqliteParameter(":Icon", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = icon;

            arParams[6]           = new SqliteParameter(":DefaultCacheTime", DbType.Int32);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = defaultCacheTime;

            arParams[7]           = new SqliteParameter(":ResourceFile", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = resourceFile;

            arParams[8]           = new SqliteParameter(":IsCacheable", DbType.Int32);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = intIsCacheable;

            arParams[9]           = new SqliteParameter(":IsSearchable", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = intIsSearchable;

            arParams[10]           = new SqliteParameter(":SearchListName", DbType.String, 255);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = searchListName;

            arParams[11]           = new SqliteParameter(":SupportsPageReuse", DbType.Int32);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = intSupportsPageReuse;

            arParams[12]           = new SqliteParameter(":DeleteProvider", DbType.String, 255);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = deleteProvider;

            arParams[13]           = new SqliteParameter(":PartialView", DbType.String, 255);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = partialView;

            arParams[14]           = new SqliteParameter(":SkinFileName", DbType.String, 255);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = skinFileName;

            int rowsAffected = -1;

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

            return(rowsAffected > -1);
        }
Esempio n. 16
0
        /// <summary>
        /// Updates a row in the mp_ContentMeta table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="name"> name </param>
        /// <param name="scheme"> scheme </param>
        /// <param name="langCode"> langCode </param>
        /// <param name="dir"> dir </param>
        /// <param name="metaContent"> metaContent </param>
        /// <param name="sortRank"> sortRank </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string name,
            string scheme,
            string langCode,
            string dir,
            string metaContent,
            int sortRank,
            DateTime lastModUtc,
            Guid lastModBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_ContentMeta ");
            sqlCommand.Append("SET  ");

            sqlCommand.Append("Name = :Name, ");
            sqlCommand.Append("Scheme = :Scheme, ");
            sqlCommand.Append("LangCode = :LangCode, ");
            sqlCommand.Append("Dir = :Dir, ");
            sqlCommand.Append("MetaContent = :MetaContent, ");
            sqlCommand.Append("SortRank = :SortRank, ");
            sqlCommand.Append("LastModUtc = :LastModUtc, ");
            sqlCommand.Append("LastModBy = :LastModBy ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("Guid = :Guid ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[9];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":Name", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = name;

            arParams[2]           = new SqliteParameter(":Scheme", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = scheme;

            arParams[3]           = new SqliteParameter(":LangCode", DbType.String, 10);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = langCode;

            arParams[4]           = new SqliteParameter(":Dir", DbType.String, 3);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = dir;

            arParams[5]           = new SqliteParameter(":MetaContent", DbType.Object);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = metaContent;

            arParams[6]           = new SqliteParameter(":SortRank", DbType.Int32);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = sortRank;

            arParams[7]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = lastModUtc;

            arParams[8]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = lastModBy.ToString();


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

            return(rowsAffected > -1);
        }
Esempio n. 17
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,
            string skinFileName)
        {
            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;
            }


            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ModuleDefinitions (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("FeatureName, ");
            sqlCommand.Append("ControlSrc, ");
            sqlCommand.Append("SortOrder, ");
            sqlCommand.Append("DefaultCacheTime, ");
            sqlCommand.Append("Icon, ");
            sqlCommand.Append("IsAdmin, ");
            sqlCommand.Append("IsCacheable, ");
            sqlCommand.Append("IsSearchable, ");
            sqlCommand.Append("SearchListName, ");
            sqlCommand.Append("SupportsPageReuse, ");
            sqlCommand.Append("DeleteProvider, ");
            sqlCommand.Append("PartialView, ");
            sqlCommand.Append("ResourceFile, ");
            sqlCommand.Append("SkinFileName ");
            sqlCommand.Append(" )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":FeatureGuid, ");
            sqlCommand.Append(":FeatureName, ");
            sqlCommand.Append(":ControlSrc, ");
            sqlCommand.Append(":SortOrder, ");
            sqlCommand.Append(":DefaultCacheTime, ");
            sqlCommand.Append(":Icon, ");
            sqlCommand.Append(":IsAdmin, ");
            sqlCommand.Append(":IsCacheable, ");
            sqlCommand.Append(":IsSearchable, ");
            sqlCommand.Append(":SearchListName, ");
            sqlCommand.Append(":SupportsPageReuse, ");
            sqlCommand.Append(":DeleteProvider, ");
            sqlCommand.Append(":PartialView, ");
            sqlCommand.Append(":ResourceFile, ");
            sqlCommand.Append(":SkinFileName ");
            sqlCommand.Append(" );");

            sqlCommand.Append("SELECT LAST_INSERT_ROWID();");

            SqliteParameter[] arParams = new SqliteParameter[16];

            arParams[0]           = new SqliteParameter(":SiteID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = siteId;

            arParams[1]           = new SqliteParameter(":FeatureName", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = featureName;

            arParams[2]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = controlSrc;

            arParams[3]           = new SqliteParameter(":SortOrder", DbType.Int32);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = sortOrder;

            arParams[4]           = new SqliteParameter(":IsAdmin", DbType.Int32);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = intIsAdmin;

            arParams[5]           = new SqliteParameter(":Icon", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = icon;

            arParams[6]           = new SqliteParameter(":DefaultCacheTime", DbType.Int32);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = defaultCacheTime;

            arParams[7]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = featureGuid;

            arParams[8]           = new SqliteParameter(":ResourceFile", DbType.String, 255);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = resourceFile;

            arParams[9]           = new SqliteParameter(":IsCacheable", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = intIsCacheable;

            arParams[10]           = new SqliteParameter(":IsSearchable", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = intIsSearchable;

            arParams[11]           = new SqliteParameter(":SearchListName", DbType.String, 255);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = searchListName;

            arParams[12]           = new SqliteParameter(":SupportsPageReuse", DbType.Int32);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = intSupportsPageReuse;

            arParams[13]           = new SqliteParameter(":DeleteProvider", DbType.String, 255);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = deleteProvider;

            arParams[14]           = new SqliteParameter(":PartialView", DbType.String, 255);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = partialView;

            arParams[15]           = new SqliteParameter(":SkinFileName", DbType.String, 255);
            arParams[15].Direction = ParameterDirection.Input;
            arParams[15].Value     = skinFileName;

            int newID = Convert.ToInt32(
                SqliteHelper.ExecuteScalar(
                    GetConnectionString(),
                    sqlCommand.ToString(),
                    arParams).ToString());

            if (siteId > -1)
            {
                // now add to  mp_SiteModuleDefinitions
                sqlCommand = new StringBuilder();
                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 SiteGuid FROM mp_Sites WHERE SiteID = :SiteID LIMIT 1), ");
                sqlCommand.Append("(SELECT Guid FROM mp_ModuleDefinitions WHERE ModuleDefID = :ModuleDefID LIMIT 1), ");
                sqlCommand.Append("'All Users', ");
                sqlCommand.Append(":ModuleDefID ) ; ");

                arParams = new SqliteParameter[2];

                arParams[0]           = new SqliteParameter(":SiteID", DbType.Int32);
                arParams[0].Direction = ParameterDirection.Input;
                arParams[0].Value     = siteId;

                arParams[1]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
                arParams[1].Direction = ParameterDirection.Input;
                arParams[1].Value     = newID;

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

            return(newID);
        }
Esempio n. 18
0
        /// <summary>
        /// Inserts a row in the mp_ContentMeta table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="contentGuid"> contentGuid </param>
        /// <param name="name"> name </param>
        /// <param name="scheme"> scheme </param>
        /// <param name="langCode"> langCode </param>
        /// <param name="dir"> dir </param>
        /// <param name="metaContent"> metaContent </param>
        /// <param name="sortRank"> sortRank </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="createdBy"> createdBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid moduleGuid,
            Guid contentGuid,
            string name,
            string scheme,
            string langCode,
            string dir,
            string metaContent,
            int sortRank,
            DateTime createdUtc,
            Guid createdBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ContentMeta (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("ContentGuid, ");
            sqlCommand.Append("Name, ");
            sqlCommand.Append("Scheme, ");
            sqlCommand.Append("LangCode, ");
            sqlCommand.Append("Dir, ");
            sqlCommand.Append("MetaContent, ");
            sqlCommand.Append("SortRank, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("CreatedBy, ");
            sqlCommand.Append("LastModUtc, ");
            sqlCommand.Append("LastModBy )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":ContentGuid, ");
            sqlCommand.Append(":Name, ");
            sqlCommand.Append(":Scheme, ");
            sqlCommand.Append(":LangCode, ");
            sqlCommand.Append(":Dir, ");
            sqlCommand.Append(":MetaContent, ");
            sqlCommand.Append(":SortRank, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":CreatedBy, ");
            sqlCommand.Append(":LastModUtc, ");
            sqlCommand.Append(":LastModBy )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[14];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = moduleGuid.ToString();

            arParams[3]           = new SqliteParameter(":ContentGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = contentGuid.ToString();

            arParams[4]           = new SqliteParameter(":Name", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = name;

            arParams[5]           = new SqliteParameter(":Scheme", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = scheme;

            arParams[6]           = new SqliteParameter(":LangCode", DbType.String, 10);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = langCode;

            arParams[7]           = new SqliteParameter(":Dir", DbType.String, 3);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = dir;

            arParams[8]           = new SqliteParameter(":MetaContent", DbType.Object);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = metaContent;

            arParams[9]           = new SqliteParameter(":SortRank", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = sortRank;

            arParams[10]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = createdUtc;

            arParams[11]           = new SqliteParameter(":CreatedBy", DbType.String, 36);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = createdBy.ToString();

            arParams[12]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = createdUtc;

            arParams[13]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = createdBy.ToString();


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

            return(rowsAffected);
        }
Esempio n. 19
0
        public static bool UpdateModuleDefinitionSettingById(
            int id,
            int moduleDefId,
            string resourceFile,
            string groupName,
            string settingName,
            string settingValue,
            string controlType,
            string regexValidationExpression,
            string controlSrc,
            string helpKey,
            int sortOrder,
            string attributes,
            string options)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_ModuleDefinitionSettings ");
            sqlCommand.Append("SET SettingName = :SettingName,  ");
            sqlCommand.Append("ResourceFile = :ResourceFile,  ");
            sqlCommand.Append("SettingValue = :SettingValue,  ");
            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("Attributes = :Attributes,  ");
            sqlCommand.Append("Options = :Options  ");

            sqlCommand.Append("WHERE ID = :ID  ");
            sqlCommand.Append("AND ModuleDefID = :ModuleDefID  ; ");

            SqliteParameter[] arParams = new SqliteParameter[13];

            arParams[0]           = new SqliteParameter(":ID", DbType.Int32);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = id;

            arParams[1]           = new SqliteParameter(":ModuleDefID", DbType.Int32);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = moduleDefId;

            arParams[2]           = new SqliteParameter(":SettingName", DbType.String, 50);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = settingName;

            arParams[3]           = new SqliteParameter(":SettingValue", DbType.String, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = settingValue;

            arParams[4]           = new SqliteParameter(":ControlType", DbType.String, 50);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = controlType;

            arParams[5]           = new SqliteParameter(":RegexValidationExpression", DbType.Object);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = regexValidationExpression;

            arParams[6]           = new SqliteParameter(":ResourceFile", DbType.String, 255);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = resourceFile;

            arParams[7]           = new SqliteParameter(":ControlSrc", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = controlSrc;

            arParams[8]           = new SqliteParameter(":HelpKey", DbType.String, 255);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = helpKey;

            arParams[9]           = new SqliteParameter(":SortOrder", DbType.Int32);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = sortOrder;

            arParams[10]           = new SqliteParameter(":GroupName", DbType.String, 255);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = groupName;

            arParams[11]           = new SqliteParameter(":Attributes", DbType.Object);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = attributes;

            arParams[12]           = new SqliteParameter(":Options", DbType.Object);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = options;

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

            return(rowsAffected > 0);
        }
Esempio n. 20
0
        /// <summary>
        /// Inserts a row in the mp_TagItem table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="tagGuid"> tagGuid </param>
        /// <param name="extraGuid"> extraGuid </param>
        /// <param name="taggedBy"> taggedBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            Guid itemGuid,
            Guid tagGuid,
            Guid extraGuid,
            Guid taggedBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_TagItem (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("FeatureGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("ItemGuid, ");
            sqlCommand.Append("TagGuid, ");
            sqlCommand.Append("ExtraGuid, ");
            sqlCommand.Append("TaggedBy )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":FeatureGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":ItemGuid, ");
            sqlCommand.Append(":TagGuid, ");
            sqlCommand.Append(":ExtraGuid, ");
            sqlCommand.Append(":TaggedBy )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[8];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = featureGuid.ToString();

            arParams[3]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = moduleGuid.ToString();

            arParams[4]           = new SqliteParameter(":ItemGuid", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = itemGuid.ToString();

            arParams[5]           = new SqliteParameter(":TagGuid", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = tagGuid.ToString();

            arParams[6]           = new SqliteParameter(":ExtraGuid", DbType.String, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = extraGuid.ToString();

            arParams[7]           = new SqliteParameter(":TaggedBy", DbType.String, 36);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = taggedBy.ToString();


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

            return(rowsAffected);
        }
Esempio n. 21
0
        /// <summary>
        /// Inserts a row in the mp_ContentMetaLink table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="contentGuid"> contentGuid </param>
        /// <param name="rel"> rel </param>
        /// <param name="href"> href </param>
        /// <param name="hrefLang"> hrefLang </param>
        /// <param name="rev"> rev </param>
        /// <param name="type"> type </param>
        /// <param name="media"> media </param>
        /// <param name="sortRank"> sortRank </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="createdBy"> createdBy </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid moduleGuid,
            Guid contentGuid,
            string rel,
            string href,
            string hrefLang,
            string rev,
            string type,
            string media,
            int sortRank,
            DateTime createdUtc,
            Guid createdBy)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ContentMetaLink (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("ContentGuid, ");
            sqlCommand.Append("Rel, ");
            sqlCommand.Append("Href, ");
            sqlCommand.Append("HrefLang, ");
            sqlCommand.Append("Rev, ");
            sqlCommand.Append("Type, ");
            sqlCommand.Append("Media, ");
            sqlCommand.Append("SortRank, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("CreatedBy, ");
            sqlCommand.Append("LastModUtc, ");
            sqlCommand.Append("LastModBy )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":ContentGuid, ");
            sqlCommand.Append(":Rel, ");
            sqlCommand.Append(":Href, ");
            sqlCommand.Append(":HrefLang, ");
            sqlCommand.Append(":Rev, ");
            sqlCommand.Append(":Type, ");
            sqlCommand.Append(":Media, ");
            sqlCommand.Append(":SortRank, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":CreatedBy, ");
            sqlCommand.Append(":LastModUtc, ");
            sqlCommand.Append(":LastModBy )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[15];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = moduleGuid.ToString();

            arParams[3]           = new SqliteParameter(":ContentGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = contentGuid.ToString();

            arParams[4]           = new SqliteParameter(":Rel", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = rel;

            arParams[5]           = new SqliteParameter(":Href", DbType.String, 255);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = href;

            arParams[6]           = new SqliteParameter(":HrefLang", DbType.String, 10);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = hrefLang;

            arParams[7]           = new SqliteParameter(":Rev", DbType.String, 50);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = rev;

            arParams[8]           = new SqliteParameter(":Type", DbType.String, 50);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = type;

            arParams[9]           = new SqliteParameter(":Media", DbType.String, 50);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = media;

            arParams[10]           = new SqliteParameter(":SortRank", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = sortRank;

            arParams[11]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = createdUtc;

            arParams[12]           = new SqliteParameter(":CreatedBy", DbType.String, 36);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = createdBy.ToString();

            arParams[13]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = createdUtc;

            arParams[14]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = createdBy.ToString();


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

            return(rowsAffected);
        }
Esempio n. 22
0
        /// <summary>
        /// Inserts a row in the mp_Currency table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="title"> title </param>
        /// <param name="code"> code </param>
        /// <param name="symbolLeft"> symbolLeft </param>
        /// <param name="symbolRight"> symbolRight </param>
        /// <param name="decimalPointChar"> decimalPointChar </param>
        /// <param name="thousandsPointChar"> thousandsPointChar </param>
        /// <param name="decimalPlaces"> decimalPlaces </param>
        /// <param name="value"> value </param>
        /// <param name="lastModified"> lastModified </param>
        /// <param name="created"> created </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            string title,
            string code,
            string symbolLeft,
            string symbolRight,
            string decimalPointChar,
            string thousandsPointChar,
            string decimalPlaces,
            decimal value,
            DateTime lastModified,
            DateTime created)
        {
            #region Bit Conversion


            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_Currency (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("Title, ");
            sqlCommand.Append("Code, ");
            sqlCommand.Append("SymbolLeft, ");
            sqlCommand.Append("SymbolRight, ");
            sqlCommand.Append("DecimalPointChar, ");
            sqlCommand.Append("ThousandsPointChar, ");
            sqlCommand.Append("DecimalPlaces, ");
            sqlCommand.Append("Value, ");
            sqlCommand.Append("LastModified, ");
            sqlCommand.Append("Created )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":Title, ");
            sqlCommand.Append(":Code, ");
            sqlCommand.Append(":SymbolLeft, ");
            sqlCommand.Append(":SymbolRight, ");
            sqlCommand.Append(":DecimalPointChar, ");
            sqlCommand.Append(":ThousandsPointChar, ");
            sqlCommand.Append(":DecimalPlaces, ");
            sqlCommand.Append(":Value, ");
            sqlCommand.Append(":LastModified, ");
            sqlCommand.Append(":Created )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[11];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":Title", DbType.String, 50);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = title;

            arParams[2]           = new SqliteParameter(":Code", DbType.String, 3);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = code;

            arParams[3]           = new SqliteParameter(":SymbolLeft", DbType.String, 15);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = symbolLeft;

            arParams[4]           = new SqliteParameter(":SymbolRight", DbType.String, 15);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = symbolRight;

            arParams[5]           = new SqliteParameter(":DecimalPointChar", DbType.String, 1);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = decimalPointChar;

            arParams[6]           = new SqliteParameter(":ThousandsPointChar", DbType.String, 1);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = thousandsPointChar;

            arParams[7]           = new SqliteParameter(":DecimalPlaces", DbType.String, 1);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = decimalPlaces;

            arParams[8]           = new SqliteParameter(":Value", DbType.Decimal);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = value;

            arParams[9]           = new SqliteParameter(":LastModified", DbType.DateTime);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = lastModified;

            arParams[10]           = new SqliteParameter(":Created", DbType.DateTime);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = created;


            int rowsAffected = 0;
            rowsAffected = SqliteHelper.ExecuteNonQuery(GetConnectionString(), sqlCommand.ToString(), arParams);
            return(rowsAffected);
        }
Esempio n. 23
0
        public static int AddUserPage(
            Guid userPageId,
            Guid siteGuid,
            int siteId,
            Guid userGuid,
            string pageName,
            string pagePath,
            int pageOrder)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_UserPages ");
            sqlCommand.Append("( ");
            sqlCommand.Append("UserPageID, ");
            sqlCommand.Append("SiteID, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("PageName, ");
            sqlCommand.Append("PagePath, ");
            sqlCommand.Append("PageOrder ");
            sqlCommand.Append(")");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":UserPageID, ");
            sqlCommand.Append(":SiteID, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":PageName, ");
            sqlCommand.Append(":PagePath, ");
            sqlCommand.Append(":PageOrder ");

            sqlCommand.Append(");");


            SqliteParameter[] arParams = new SqliteParameter[7];

            arParams[0]           = new SqliteParameter(":UserPageID", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = userPageId.ToString();

            arParams[1]           = new SqliteParameter(":SiteID", DbType.Int32);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteId;

            arParams[2]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = userGuid.ToString();

            arParams[3]           = new SqliteParameter(":PageName", DbType.String, 255);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = pageName;

            arParams[4]           = new SqliteParameter(":PagePath", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = pagePath;

            arParams[5]           = new SqliteParameter(":PageOrder", DbType.Int32);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = pageOrder;

            arParams[6]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = siteGuid.ToString();

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

            return(rowsAffected);
        }
Esempio n. 24
0
        /// <summary>
        /// Updates a row in the mp_EmailTemplate table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="name"> name </param>
        /// <param name="subject"> subject </param>
        /// <param name="textBody"> textBody </param>
        /// <param name="htmlBody"> htmlBody </param>
        /// <param name="hasHtml"> hasHtml </param>
        /// <param name="isEditable"> isEditable </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string name,
            string subject,
            string textBody,
            string htmlBody,
            bool hasHtml,
            bool isEditable,
            DateTime lastModUtc,
            Guid lastModBy)
        {
            #region Bit Conversion

            int intHasHtml = 0;
            if (hasHtml)
            {
                intHasHtml = 1;
            }

            int intIsEditable = 0;
            if (isEditable)
            {
                intIsEditable = 1;
            }


            #endregion

            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_EmailTemplate ");
            sqlCommand.Append("SET  ");
            sqlCommand.Append("Name = :Name, ");
            sqlCommand.Append("Subject = :Subject, ");
            sqlCommand.Append("TextBody = :TextBody, ");
            sqlCommand.Append("HtmlBody = :HtmlBody, ");
            sqlCommand.Append("HasHtml = :HasHtml, ");
            sqlCommand.Append("IsEditable = :IsEditable, ");
            sqlCommand.Append("LastModUtc = :LastModUtc, ");
            sqlCommand.Append("LastModBy = :LastModBy ");

            sqlCommand.Append("WHERE  ");
            sqlCommand.Append("Guid = :Guid ");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[9];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":Name", DbType.String, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = name;

            arParams[2]           = new SqliteParameter(":Subject", DbType.String, 255);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = subject;

            arParams[3]           = new SqliteParameter(":TextBody", DbType.Object);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = textBody;

            arParams[4]           = new SqliteParameter(":HtmlBody", DbType.Object);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = htmlBody;

            arParams[5]           = new SqliteParameter(":HasHtml", DbType.Int32);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = intHasHtml;

            arParams[6]           = new SqliteParameter(":IsEditable", DbType.Int32);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = intIsEditable;

            arParams[7]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = lastModUtc;

            arParams[8]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = lastModBy.ToString();

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

            return(rowsAffected > -1);
        }
Esempio n. 25
0
        public static bool UpdateSharedFile(
            int itemId,
            int moduleId,
            int uploadUserId,
            string friendlyName,
            string originalFileName,
            string serverFileName,
            int sizeInKB,
            DateTime uploadDate,
            int folderId,
            Guid folderGuid,
            Guid userGuid,
            string description,
            string viewRoles
            )
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("UPDATE mp_SharedFiles ");
            sqlCommand.Append("SET ");
            sqlCommand.Append("ModuleID = :ModuleID, ");
            sqlCommand.Append("UploadUserID = :UploadUserID, ");
            sqlCommand.Append("FriendlyName = :FriendlyName, ");
            sqlCommand.Append("OriginalFileName = :OriginalFileName, ");
            sqlCommand.Append("ServerFileName = :ServerFileName, ");
            sqlCommand.Append("SizeInKB = :SizeInKB, ");
            sqlCommand.Append("UploadDate = :UploadDate, ");
            sqlCommand.Append("FolderID = :FolderID, ");
            sqlCommand.Append("UserGuid = :UserGuid, ");
            sqlCommand.Append("Description = :Description, ");
            sqlCommand.Append("FolderGuid = :FolderGuid, ");
            sqlCommand.Append("ViewRoles = :ViewRoles ");

            sqlCommand.Append("WHERE ");
            sqlCommand.Append("ItemID = :ItemID ;");

            SqliteParameter[] arParams = new SqliteParameter[13];

            arParams[0] = new SqliteParameter(":ItemID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = itemId
            };

            arParams[1] = new SqliteParameter(":ModuleID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = moduleId
            };

            arParams[2] = new SqliteParameter(":UploadUserID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = uploadUserId
            };

            arParams[3] = new SqliteParameter(":FriendlyName", DbType.String, 255)
            {
                Direction = ParameterDirection.Input,
                Value     = friendlyName
            };

            arParams[4] = new SqliteParameter(":OriginalFileName", DbType.String, 255)
            {
                Direction = ParameterDirection.Input,
                Value     = originalFileName
            };

            arParams[5] = new SqliteParameter(":ServerFileName", DbType.String, 255)
            {
                Direction = ParameterDirection.Input,
                Value     = serverFileName
            };

            arParams[6] = new SqliteParameter(":SizeInKB", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = sizeInKB
            };

            arParams[7] = new SqliteParameter(":UploadDate", DbType.DateTime)
            {
                Direction = ParameterDirection.Input,
                Value     = uploadDate
            };

            arParams[8] = new SqliteParameter(":FolderID", DbType.Int32)
            {
                Direction = ParameterDirection.Input,
                Value     = folderId
            };

            arParams[9] = new SqliteParameter(":UserGuid", DbType.String, 36)
            {
                Direction = ParameterDirection.Input,
                Value     = userGuid.ToString()
            };

            arParams[10] = new SqliteParameter(":FolderGuid", DbType.String, 36)
            {
                Direction = ParameterDirection.Input,
                Value     = folderGuid.ToString()
            };

            arParams[11] = new SqliteParameter(":Description", DbType.Object)
            {
                Direction = ParameterDirection.Input,
                Value     = description
            };

            arParams[12] = new SqliteParameter(":ViewRoles", DbType.Object)
            {
                Direction = ParameterDirection.Input,
                Value     = viewRoles
            };

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

            return(rowsAffected > -1);
        }
Esempio n. 26
0
        /// <summary>
        /// Inserts a row in the mp_EmailTemplate table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="specialGuid1"> specialGuid1 </param>
        /// <param name="specialGuid2"> specialGuid2 </param>
        /// <param name="name"> name </param>
        /// <param name="subject"> subject </param>
        /// <param name="textBody"> textBody </param>
        /// <param name="htmlBody"> htmlBody </param>
        /// <param name="hasHtml"> hasHtml </param>
        /// <param name="isEditable"> isEditable </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            Guid specialGuid1,
            Guid specialGuid2,
            string name,
            string subject,
            string textBody,
            string htmlBody,
            bool hasHtml,
            bool isEditable,
            DateTime createdUtc,
            Guid lastModBy)
        {
            #region Bit Conversion

            int intHasHtml = 0;
            if (hasHtml)
            {
                intHasHtml = 1;
            }

            int intIsEditable = 0;
            if (isEditable)
            {
                intIsEditable = 1;
            }


            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_EmailTemplate (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("FeatureGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("SpecialGuid1, ");
            sqlCommand.Append("SpecialGuid2, ");
            sqlCommand.Append("Name, ");
            sqlCommand.Append("Subject, ");
            sqlCommand.Append("TextBody, ");
            sqlCommand.Append("HtmlBody, ");
            sqlCommand.Append("HasHtml, ");
            sqlCommand.Append("IsEditable, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("LastModUtc, ");
            sqlCommand.Append("LastModBy )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":FeatureGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":SpecialGuid1, ");
            sqlCommand.Append(":SpecialGuid2, ");
            sqlCommand.Append(":Name, ");
            sqlCommand.Append(":Subject, ");
            sqlCommand.Append(":TextBody, ");
            sqlCommand.Append(":HtmlBody, ");
            sqlCommand.Append(":HasHtml, ");
            sqlCommand.Append(":IsEditable, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":LastModUtc, ");
            sqlCommand.Append(":LastModBy )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[15];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = featureGuid.ToString();

            arParams[3]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = moduleGuid.ToString();

            arParams[4]           = new SqliteParameter(":SpecialGuid1", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = specialGuid1.ToString();

            arParams[5]           = new SqliteParameter(":SpecialGuid2", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = specialGuid2.ToString();

            arParams[6]           = new SqliteParameter(":Name", DbType.String, 255);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = name;

            arParams[7]           = new SqliteParameter(":Subject", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = subject;

            arParams[8]           = new SqliteParameter(":TextBody", DbType.Object);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = textBody;

            arParams[9]           = new SqliteParameter(":HtmlBody", DbType.Object);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = htmlBody;

            arParams[10]           = new SqliteParameter(":HasHtml", DbType.Int32);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = intHasHtml;

            arParams[11]           = new SqliteParameter(":IsEditable", DbType.Int32);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = intIsEditable;

            arParams[12]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = createdUtc;

            arParams[13]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = createdUtc;

            arParams[14]           = new SqliteParameter(":LastModBy", DbType.String, 36);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = lastModBy.ToString();

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

            return(rowsAffected);
        }
Esempio n. 27
0
        /// <summary>
        /// Inserts a row in the mp_AuthorizeNetLog table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="storeGuid"> storeGuid </param>
        /// <param name="cartGuid"> cartGuid </param>
        /// <param name="rawResponse"> rawResponse </param>
        /// <param name="responseCode"> responseCode </param>
        /// <param name="responseReasonCode"> responseReasonCode </param>
        /// <param name="reason"> reason </param>
        /// <param name="avsCode"> avsCode </param>
        /// <param name="ccvCode"> ccvCode </param>
        /// <param name="cavCode"> cavCode </param>
        /// <param name="transactionId"> transactionId </param>
        /// <param name="transactionType"> transactionType </param>
        /// <param name="method"> method </param>
        /// <param name="authCode"> authCode </param>
        /// <param name="amount"> amount </param>
        /// <param name="tax"> tax </param>
        /// <param name="duty"> duty </param>
        /// <param name="freight"> freight </param>
        /// <returns>int</returns>
        public static int Create(
            Guid rowGuid,
            DateTime createdUtc,
            Guid siteGuid,
            Guid userGuid,
            Guid storeGuid,
            Guid cartGuid,
            string rawResponse,
            string responseCode,
            string responseReasonCode,
            string reason,
            string avsCode,
            string ccvCode,
            string cavCode,
            string transactionId,
            string transactionType,
            string method,
            string authCode,
            decimal amount,
            decimal tax,
            decimal duty,
            decimal freight)
        {
            #region Bit Conversion


            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_AuthorizeNetLog (");
            sqlCommand.Append("RowGuid, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("StoreGuid, ");
            sqlCommand.Append("CartGuid, ");
            sqlCommand.Append("RawResponse, ");
            sqlCommand.Append("ResponseCode, ");
            sqlCommand.Append("ResponseReasonCode, ");
            sqlCommand.Append("Reason, ");
            sqlCommand.Append("AvsCode, ");
            sqlCommand.Append("CcvCode, ");
            sqlCommand.Append("CavCode, ");
            sqlCommand.Append("TransactionId, ");
            sqlCommand.Append("TransactionType, ");
            sqlCommand.Append("Method, ");
            sqlCommand.Append("AuthCode, ");
            sqlCommand.Append("Amount, ");
            sqlCommand.Append("Tax, ");
            sqlCommand.Append("Duty, ");
            sqlCommand.Append("Freight )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":RowGuid, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":StoreGuid, ");
            sqlCommand.Append(":CartGuid, ");
            sqlCommand.Append(":RawResponse, ");
            sqlCommand.Append(":ResponseCode, ");
            sqlCommand.Append(":ResponseReasonCode, ");
            sqlCommand.Append(":Reason, ");
            sqlCommand.Append(":AvsCode, ");
            sqlCommand.Append(":CcvCode, ");
            sqlCommand.Append(":CavCode, ");
            sqlCommand.Append(":TransactionId, ");
            sqlCommand.Append(":TransactionType, ");
            sqlCommand.Append(":Method, ");
            sqlCommand.Append(":AuthCode, ");
            sqlCommand.Append(":Amount, ");
            sqlCommand.Append(":Tax, ");
            sqlCommand.Append(":Duty, ");
            sqlCommand.Append(":Freight )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[21];

            arParams[0]           = new SqliteParameter(":RowGuid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = rowGuid.ToString();

            arParams[1]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = createdUtc;

            arParams[2]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = siteGuid.ToString();

            arParams[3]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = userGuid.ToString();

            arParams[4]           = new SqliteParameter(":StoreGuid", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = storeGuid.ToString();

            arParams[5]           = new SqliteParameter(":CartGuid", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = cartGuid.ToString();

            arParams[6]           = new SqliteParameter(":RawResponse", DbType.Object);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = rawResponse;

            arParams[7]           = new SqliteParameter(":ResponseCode", DbType.String, 1);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = responseCode;

            arParams[8]           = new SqliteParameter(":ResponseReasonCode", DbType.String, 20);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = responseReasonCode;

            arParams[9]           = new SqliteParameter(":Reason", DbType.Object);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = reason;

            arParams[10]           = new SqliteParameter(":AvsCode", DbType.String, 50);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = avsCode;

            arParams[11]           = new SqliteParameter(":CcvCode", DbType.String, 1);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = ccvCode;

            arParams[12]           = new SqliteParameter(":CavCode", DbType.String, 1);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = cavCode;

            arParams[13]           = new SqliteParameter(":TransactionId", DbType.String, 50);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = transactionId;

            arParams[14]           = new SqliteParameter(":TransactionType", DbType.String, 50);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = transactionType;

            arParams[15]           = new SqliteParameter(":Method", DbType.String, 20);
            arParams[15].Direction = ParameterDirection.Input;
            arParams[15].Value     = method;

            arParams[16]           = new SqliteParameter(":AuthCode", DbType.String, 50);
            arParams[16].Direction = ParameterDirection.Input;
            arParams[16].Value     = authCode;

            arParams[17]           = new SqliteParameter(":Amount", DbType.Decimal);
            arParams[17].Direction = ParameterDirection.Input;
            arParams[17].Value     = amount;

            arParams[18]           = new SqliteParameter(":Tax", DbType.Decimal);
            arParams[18].Direction = ParameterDirection.Input;
            arParams[18].Value     = tax;

            arParams[19]           = new SqliteParameter(":Duty", DbType.Decimal);
            arParams[19].Direction = ParameterDirection.Input;
            arParams[19].Value     = duty;

            arParams[20]           = new SqliteParameter(":Freight", DbType.Decimal);
            arParams[20].Direction = ParameterDirection.Input;
            arParams[20].Value     = freight;


            int rowsAffected = 0;
            rowsAffected = SqliteHelper.ExecuteNonQuery(GetConnectionString(), sqlCommand.ToString(), arParams);
            return(rowsAffected);
        }
Esempio n. 28
0
        /// <summary>
        /// Inserts a row in the mp_ContentHistory table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="contentGuid"> contentGuid </param>
        /// <param name="title"> title </param>
        /// <param name="contentText"> contentText </param>
        /// <param name="customData"> customData </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="historyUtc"> historyUtc </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid userGuid,
            Guid contentGuid,
            string title,
            string contentText,
            string customData,
            DateTime createdUtc,
            DateTime historyUtc)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_ContentHistory (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("ContentGuid, ");
            sqlCommand.Append("Title, ");
            sqlCommand.Append("ContentText, ");
            sqlCommand.Append("CustomData, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("HistoryUtc )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":ContentGuid, ");
            sqlCommand.Append(":Title, ");
            sqlCommand.Append(":ContentText, ");
            sqlCommand.Append(":CustomData, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":HistoryUtc )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[9];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = siteGuid.ToString();

            arParams[2]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = userGuid.ToString();

            arParams[3]           = new SqliteParameter(":ContentGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = contentGuid.ToString();

            arParams[4]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = title;

            arParams[5]           = new SqliteParameter(":ContentText", DbType.Object);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = contentText;

            arParams[6]           = new SqliteParameter(":CustomData", DbType.Object);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = customData;

            arParams[7]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = createdUtc;

            arParams[8]           = new SqliteParameter(":HistoryUtc", DbType.DateTime);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = historyUtc;


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

            return(rowsAffected);
        }
Esempio n. 29
0
        /// <summary>
        /// Inserts a row in the mp_Comments table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="parentGuid"> parentGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="contentGuid"> contentGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="title"> title </param>
        /// <param name="userComment"> userComment </param>
        /// <param name="userName"> userName </param>
        /// <param name="userEmail"> userEmail </param>
        /// <param name="userUrl"> userUrl </param>
        /// <param name="userIp"> userIp </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="moderationStatus"> moderationStatus </param>
        /// <param name="moderatedBy"> moderatedBy </param>
        /// <param name="moderationReason"> moderationReason </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid parentGuid,
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            Guid contentGuid,
            Guid userGuid,
            string title,
            string userComment,
            string userName,
            string userEmail,
            string userUrl,
            string userIp,
            DateTime createdUtc,
            byte moderationStatus,
            Guid moderatedBy,
            string moderationReason)
        {
            StringBuilder sqlCommand = new StringBuilder();

            sqlCommand.Append("INSERT INTO mp_Comments (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("ParentGuid, ");
            sqlCommand.Append("SiteGuid, ");
            sqlCommand.Append("FeatureGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("ContentGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("Title, ");
            sqlCommand.Append("UserComment, ");
            sqlCommand.Append("UserName, ");
            sqlCommand.Append("UserEmail, ");
            sqlCommand.Append("UserUrl, ");
            sqlCommand.Append("UserIp, ");
            sqlCommand.Append("CreatedUtc, ");
            sqlCommand.Append("LastModUtc, ");
            sqlCommand.Append("ModerationStatus, ");
            sqlCommand.Append("ModeratedBy, ");
            sqlCommand.Append("ModerationReason )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":ParentGuid, ");
            sqlCommand.Append(":SiteGuid, ");
            sqlCommand.Append(":FeatureGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":ContentGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":Title, ");
            sqlCommand.Append(":UserComment, ");
            sqlCommand.Append(":UserName, ");
            sqlCommand.Append(":UserEmail, ");
            sqlCommand.Append(":UserUrl, ");
            sqlCommand.Append(":UserIp, ");
            sqlCommand.Append(":CreatedUtc, ");
            sqlCommand.Append(":LastModUtc, ");
            sqlCommand.Append(":ModerationStatus, ");
            sqlCommand.Append(":ModeratedBy, ");
            sqlCommand.Append(":ModerationReason )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[18];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":ParentGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = parentGuid.ToString();

            arParams[2]           = new SqliteParameter(":SiteGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = siteGuid.ToString();

            arParams[3]           = new SqliteParameter(":FeatureGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = featureGuid.ToString();

            arParams[4]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = moduleGuid.ToString();

            arParams[5]           = new SqliteParameter(":ContentGuid", DbType.String, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = contentGuid.ToString();

            arParams[6]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = userGuid.ToString();

            arParams[7]           = new SqliteParameter(":Title", DbType.String, 255);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = title;

            arParams[8]           = new SqliteParameter(":UserComment", DbType.Object);
            arParams[8].Direction = ParameterDirection.Input;
            arParams[8].Value     = userComment;

            arParams[9]           = new SqliteParameter(":UserName", DbType.String, 50);
            arParams[9].Direction = ParameterDirection.Input;
            arParams[9].Value     = userName;

            arParams[10]           = new SqliteParameter(":UserEmail", DbType.String, 100);
            arParams[10].Direction = ParameterDirection.Input;
            arParams[10].Value     = userEmail;

            arParams[11]           = new SqliteParameter(":UserUrl", DbType.String, 255);
            arParams[11].Direction = ParameterDirection.Input;
            arParams[11].Value     = userUrl;

            arParams[12]           = new SqliteParameter(":UserIp", DbType.String, 50);
            arParams[12].Direction = ParameterDirection.Input;
            arParams[12].Value     = userIp;

            arParams[13]           = new SqliteParameter(":CreatedUtc", DbType.DateTime);
            arParams[13].Direction = ParameterDirection.Input;
            arParams[13].Value     = createdUtc;

            arParams[14]           = new SqliteParameter(":LastModUtc", DbType.DateTime);
            arParams[14].Direction = ParameterDirection.Input;
            arParams[14].Value     = createdUtc;

            arParams[15]           = new SqliteParameter(":ModerationStatus", DbType.UInt16);
            arParams[15].Direction = ParameterDirection.Input;
            arParams[15].Value     = moderationStatus;

            arParams[16]           = new SqliteParameter(":ModeratedBy", DbType.String, 36);
            arParams[16].Direction = ParameterDirection.Input;
            arParams[16].Value     = moderatedBy.ToString();

            arParams[17]           = new SqliteParameter(":ModerationReason", DbType.String, 255);
            arParams[17].Direction = ParameterDirection.Input;
            arParams[17].Value     = moderationReason;

            int rowsAffected = SqliteHelper.ExecuteNonQuery(
                ConnectionString.GetConnectionString(),
                sqlCommand.ToString(),
                arParams);

            return(rowsAffected);
        }
Esempio n. 30
0
        public static int CreateAuditHistory(
            Guid guid,
            Guid workflowGuid,
            Guid moduleGuid,
            Guid userGuid,
            DateTime createdDateUtc,
            string status,
            string notes,
            bool active)
        {
            #region Bit Conversion

            int intActive = 0;
            if (active)
            {
                intActive = 1;
            }

            #endregion

            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("INSERT INTO mp_ContentWorkflowAuditHistory (");
            sqlCommand.Append("Guid, ");
            sqlCommand.Append("ContentWorkflowGuid, ");
            sqlCommand.Append("ModuleGuid, ");
            sqlCommand.Append("UserGuid, ");
            sqlCommand.Append("CreatedDateUtc, ");
            sqlCommand.Append("NewStatus, ");
            sqlCommand.Append("Notes, ");
            sqlCommand.Append("Active )");

            sqlCommand.Append(" VALUES (");
            sqlCommand.Append(":Guid, ");
            sqlCommand.Append(":ContentWorkflowGuid, ");
            sqlCommand.Append(":ModuleGuid, ");
            sqlCommand.Append(":UserGuid, ");
            sqlCommand.Append(":CreatedDateUtc, ");
            sqlCommand.Append(":NewStatus, ");
            sqlCommand.Append(":Notes, ");
            sqlCommand.Append(":Active )");
            sqlCommand.Append(";");

            SqliteParameter[] arParams = new SqliteParameter[8];

            arParams[0]           = new SqliteParameter(":Guid", DbType.String, 36);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = guid.ToString();

            arParams[1]           = new SqliteParameter(":ContentWorkflowGuid", DbType.String, 36);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = workflowGuid.ToString();

            arParams[2]           = new SqliteParameter(":ModuleGuid", DbType.String, 36);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = moduleGuid.ToString();

            arParams[3]           = new SqliteParameter(":UserGuid", DbType.String, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = userGuid.ToString();

            arParams[4]           = new SqliteParameter(":CreatedDateUtc", DbType.DateTime);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = createdDateUtc;

            arParams[5]           = new SqliteParameter(":NewStatus", DbType.String, 20);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = status;

            arParams[6]           = new SqliteParameter(":Notes", DbType.Object);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = notes;

            arParams[7]           = new SqliteParameter(":Active", DbType.Int32);
            arParams[7].Direction = ParameterDirection.Input;
            arParams[7].Value     = intActive;


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

            return(rowsAffected);
        }