Beispiel #1
0
        public int?AddEdit(int?pageId, string languageCode, string menuName, string metaTagTitle, string metaTagKeywords, string metaTagDescription, string robots, string htmlCode)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var    returnValue    = db.CreateParamReturnValue("returnValue");
                string lastInsertedId = db.ExecScalarProc("sp_cms_pages_languages_insert_update",
                                                          "@PageId", pageId,
                                                          "@LanguageCode", languageCode,
                                                          "@MenuName", menuName,
                                                          "@MetaTagTitle", metaTagTitle,
                                                          "@MetaTagKeywords", metaTagKeywords,
                                                          "@MetaTagDescription", metaTagDescription,
                                                          "@Robots", robots,
                                                          "@HtmlCode", htmlCode,
                                                          returnValue).ConvertTo <string>(string.Empty, true);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }

                return(result);
            }
        }
Beispiel #2
0
        public int?AddEdit(string Sys_Id,
                           string Sys_Var,
                           string Sys_Type,
                           decimal?Sys_Value,
                           string Sys_Name,
                           bool?IsEditable,
                           string username)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_SysVar_insert_update",
                                    "@Sys_Id", Sys_Id,
                                    "@Sys_Var", Sys_Var,
                                    "@Sys_Type", Sys_Type,
                                    "@Sys_Name", Sys_Name,
                                    "@Sys_Value", Sys_Value,
                                    "@IsEditable", IsEditable,
                                    "@UserName", username,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                return(result);
            }
        }
Beispiel #3
0
        public int?ResetPassword(string passwordResetKey, string newPassword)
        {
            int?result = 2;

            Subscription subscription = GetSubscriptionByPasswordResetKey(passwordResetKey);

            if (subscription.IsNotNull())
            {
                string NewEncryptedPassword = SecurityHelper.EncryptPassword(newPassword, subscription.Salt);

                using (AdoHelper db = new AdoHelper())
                {
                    var returnValue = db.CreateParamReturnValue("returnValue");
                    db.ExecNonQueryProc("sp_cms_subscriptions_pw_change_with_resetkey_update",
                                        "@PasswordResetKey", passwordResetKey,
                                        "@NewPassword", NewEncryptedPassword,
                                        returnValue);
                    result = db.GetParamReturnValue(returnValue);
                    if (result == 0)
                    {
                        _AllItems = GetAllItems(true);
                    }
                }
            }

            return(result);
        }
Beispiel #4
0
        public int?Edit(int pageId, int?pageParentId, string pageName, string target, string url, bool showInMenu, bool isActive, string cssClass, string groupsPermissions)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_pages_update",
                                    "@PageId", pageId,
                                    "@PageParentId", pageParentId,
                                    "@PageName", pageName,
                                    "@Target", target,
                                    "@Url", url,
                                    "@ShowInMenu", showInMenu,
                                    "@IsActive", isActive,
                                    "@CssClass", cssClass,
                                    "@GroupsPermissions", groupsPermissions,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #5
0
        public int?EditProfile(string subscriptionEmail, string firstName, string lastName, DateTime?birthDate, string phoneNumber, string address, string city, string postCode, string countryCode, bool wantsNewsletter)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_subscriptions_profile_update",
                                    "@Email", subscriptionEmail,
                                    "@FirstName", firstName,
                                    "@LastName", lastName,
                                    "@BirthDate", birthDate,
                                    "@PhoneNumber", phoneNumber,
                                    "@Address", address,
                                    "@City", city,
                                    "@PostCode", postCode,
                                    "@CountryCode", countryCode,
                                    "@WantsNewsletter", wantsNewsletter,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #6
0
        public int?AddEdit(string curremtMediaGalleryCode, string newMediaGalleryCode, string languageCode, bool isActive, DateTime?publishDate, string userName, string mediaGalleryTitle)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_media_galleries_insert_update",
                                    "@CurrentMediaGalleryCode", curremtMediaGalleryCode,
                                    "@NewMediaGalleryCode", newMediaGalleryCode,
                                    "@LanguageCode", languageCode,
                                    "@IsActive", isActive,
                                    "@PublishDate", publishDate,
                                    "@UserName", userName,
                                    "@MediaGalleryTitle", mediaGalleryTitle,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #7
0
        public int?Edit(string username, string password, string fullName, string email, int?groupId)
        {
            int?result;

            string salt = null;
            string encryptedPassword = null;

            if (password.IsNotEmptyOrWhiteSpace())
            {
                encryptedPassword = SecurityHelper.EncryptPassword(password, out salt);
            }

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_users_update", "@UserName", username, "@Password", encryptedPassword, "@Salt", salt, "@FullName", fullName, "@Email", email, "@GroupId", groupId, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #8
0
        public int?AddEdit(int?newsId, DateTime?newsDate, string userName, bool?isActive, int?categoryId, string mainImageFilePath, string languageCode, string newsTitle, string newsContent, out int?lastInsertedId)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                lastInsertedId = db.ExecScalarProc("sp_cms_news_insert_update",
                                                   "@NewsId", newsId,
                                                   "@NewsDate", newsDate,
                                                   "@UserName", userName,
                                                   "@IsActive", isActive,
                                                   "@CategoryId", categoryId,
                                                   "@MainImageFilePath", mainImageFilePath,
                                                   "@LanguageCode", languageCode,
                                                   "@NewsTitle", newsTitle,
                                                   "@NewsContent", newsContent,
                                                   returnValue).ConvertTo <int?>(null, true);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }

                return(result);
            }
        }
Beispiel #9
0
        public int?Edit(int pageId, int?pageParentId, string segment, string pageName, string target, int?PageTemplateId, string url, bool showInMainMenu, bool showInBottomMenu, bool showInSitemap, bool isActive, bool isAccessRestricted, bool isHomePage)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_pages_update",
                                    "@PageId", pageId,
                                    "@PageParentId", pageParentId,
                                    "@Segment", segment,
                                    "@PageName", pageName,
                                    "@Target", target,
                                    "@PageTemplateId", PageTemplateId,
                                    "@Url", url,
                                    "@ShowInMainMenu", showInMainMenu,
                                    "@ShowInBottomMenu", showInBottomMenu,
                                    "@ShowInSitemap", showInSitemap,
                                    "@IsActive", isActive,
                                    "@IsAccessRestricted", isAccessRestricted,
                                    "@IsHomePage", isHomePage,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #10
0
        public int?AddEdit(
            int?id,
            int?user_id,
            string username,
            int?type,
            string description,
            DateTime?created_at,
            DateTime?updated_at,
            DateTime?deleted_at
            )
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_LogSystem_insert_update",
                                    "@id", id,
                                    "@user_id", user_id,
                                    "@username", username,
                                    "@type", type,
                                    "@description", description,
                                    "@created_at", created_at,
                                    "@updated_at", updated_at,
                                    "@deleted_at", deleted_at,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                return(result);
            }
        }
Beispiel #11
0
        public int?Edit(
            string SiteName,
            string MetaTitle,
            string MetaKeywords,
            string MetaDescription,
            string Robots,
            string NotificationEmail,
            bool IsCanonicalizeActive,
            string HostNameLabel,
            string DomainName,
            string BingVerificationCode,
            string GoogleVerificationCode,
            string GoogleAnalyticsTrackingCode,
            string GoogleSearchCode,
            bool IsOffline,
            string OfflineCode,
            string ServerTimeZone,
            string DateFormat,
            string TimeFormat,
            string DefaultLanguageCode,
            int DefaultErrorPageTemplateId)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_global_configuration_update",
                                    "@SiteName", SiteName,
                                    "@MetaTitle", MetaTitle,
                                    "@MetaKeywords", MetaKeywords,
                                    "@MetaDescription", MetaDescription,
                                    "@Robots", Robots,
                                    "@NotificationEmail", NotificationEmail,
                                    "@IsCanonicalizeActive", IsCanonicalizeActive,
                                    "@HostNameLabel", HostNameLabel,
                                    "@DomainName", DomainName,
                                    "@BingVerificationCode", BingVerificationCode,
                                    "@GoogleVerificationCode", GoogleVerificationCode,
                                    "@GoogleAnalyticsTrackingCode", GoogleAnalyticsTrackingCode,
                                    "@GoogleSearchCode", GoogleSearchCode,
                                    "@IsOffline", IsOffline,
                                    "@OfflineCode", OfflineCode,
                                    "@ServerTimeZone", ServerTimeZone,
                                    "@DateFormat", DateFormat,
                                    "@TimeFormat", TimeFormat,
                                    "@DefaultLanguageCode", DefaultLanguageCode,
                                    "@DefaultErrorPageTemplateId", DefaultErrorPageTemplateId,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                    RegisterEmailHelper();
                }
            }

            return(result);
        }
Beispiel #12
0
        public int?Delete(long?id, string username)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_TransactionLog_delete", "@Id", id, "@UserName", username, returnValue);
                result = db.GetParamReturnValue(returnValue);
            }

            return(result);
        }
Beispiel #13
0
        public int?Delete(int?id)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_LogSystem_delete", "@Id", id, returnValue);
                result = db.GetParamReturnValue(returnValue);
            }

            return(result);
        }
Beispiel #14
0
        public int?AddEdit(int?id,
                           string mst,
                           string dvcs,
                           string name,
                           string nameEn,
                           string email,
                           string phone,
                           string representative,
                           string domain,
                           string address,
                           string serverName,
                           string dbName,
                           string dbUserName,
                           string dbPassword,
                           string dbPort,
                           DateTime?dateIssue,
                           DateTime?dateActive,
                           string username)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_tenant_insert_update",
                                    "@Id", id,
                                    "@MST", mst,
                                    "@Dvcs", dvcs,
                                    "@Name", name,
                                    "@NameEn", nameEn,
                                    "@Email", email,
                                    "@Phone", phone,
                                    "@Representative", representative,
                                    "@Domain", domain,
                                    "@Address", address,
                                    "@ServerName", serverName,
                                    "@DbName", dbName,
                                    "@DbUserName", dbUserName,
                                    "@DbPassword", dbPassword,
                                    "@DbPort", dbPort,
                                    "@DateIssue", dateIssue,
                                    "@DateActive", dateActive,
                                    "@UserName", username,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                return(result);
            }
        }
Beispiel #15
0
        public int?Add(string title, string description, string content, bool isActive)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var    returnValue    = db.CreateParamReturnValue("returnValue");
                string lastInsertedId = db.ExecScalarProc("sp_cms_content_templates_insert", "@Title", title.Trim(), "@Description", description.Trim(), "@Content", content, "@IsActive", isActive, returnValue).ConvertTo <string>(string.Empty, true);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #16
0
        public int?Add(string languageCode, string languageName, string languageNameOriginal, bool isActive)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_languages_insert", "@LanguageCode", languageCode, "@LanguageName", languageName, "@LanguageNameOriginal", languageNameOriginal, "@IsActive", isActive, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #17
0
        public int?Add(int newsId, bool isActive, string comment, DateTime commentDate, string subscriptionEmail)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_news_comments_insert", "@NewsId", newsId, "@IsActive", isActive, "@Comment", comment, "@CommentDate", commentDate, "@SubscriptionEmail", subscriptionEmail, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #18
0
        public int?Delete(int newsId)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_news_delete", "@NewsId", newsId, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #19
0
        public int?Delete(string sharedContentCode)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_shared_content_delete", "@SharedContentCode", sharedContentCode, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #20
0
        public int?Edit(int pageTemplateId, string title, string htmlCode, bool isActive)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var    returnValue    = db.CreateParamReturnValue("returnValue");
                string lastInsertedId = db.ExecScalarProc("sp_cms_page_templates_update", "@PageTemplateId", pageTemplateId, "@Title", title, "@HtmlCode", htmlCode, "@IsActive", isActive, returnValue).ConvertTo <string>(string.Empty, true);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #21
0
        public int?Edit(int groupId, string groupName)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_groups_update", "@GroupId", groupId, "@GroupName", groupName, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #22
0
        public int?Delete(string mediaGalleryCode)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_media_galleries_delete", "@MediaGalleryCode", mediaGalleryCode, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #23
0
        public int?Delete(string userName)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_users_delete", "@UserName", userName, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #24
0
        public int?ActivativateSubscription(string activationKey)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_subscriptions_activation", "@ActivationKey", activationKey, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #25
0
        public int?Edit(int commentId, bool isActive, string comment)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_news_comments_update", "@CommentId", commentId, "@IsActive", isActive, "@Comment", comment, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #26
0
        public int?MoveDown(int pageId)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_pages_move_down", "@PageId", pageId, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #27
0
        public int?Delete(string subscriptionEmail)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_subscriptions_delete", "@Email", subscriptionEmail, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    _AllItems = GetAllItems(true);
                }
            }

            return(result);
        }
Beispiel #28
0
        public int?AddEdit(int?id, string eventName, DateTime?startDate, DateTime?endDate, int status, string username)
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_config_event_insert_update",
                                    "@Id", id,
                                    "@EventName", eventName,
                                    "@StartDate", startDate,
                                    "@EndDate", endDate,
                                    "@Status", status,
                                    "@UserName", username,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                return(result);
            }
        }
Beispiel #29
0
        public int?AddEdit(
            long?Id,
            Guid ID_Fighting,
            DateTime?TransationDate,
            string ReceiveAccount,
            int?TransationType,
            decimal?Amount,
            string UserId,
            string Nick,
            string Reason,
            bool?Status,
            string ErrorMessage,
            DateTime?Created_At,
            DateTime?Updated_At,
            string UserName
            )
        {
            int?result;

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_cms_TransactionLog_insert_update",
                                    "@Id", Id,
                                    "@ID_Fighting", ID_Fighting,
                                    "@TransationDate", TransationDate,
                                    "@ReceiveAccount", ReceiveAccount,
                                    "@TransationType", TransationType,
                                    "@Amount", Amount,
                                    "@UserId", UserId,
                                    "@Nick", Nick,
                                    "@Reason", Reason,
                                    "@Status", Status,
                                    "@ErrorMessage", ErrorMessage,
                                    "@Created_At", Created_At,
                                    "@Updated_At", Updated_At,
                                    "@UserName", UserName,
                                    returnValue);
                result = db.GetParamReturnValue(returnValue);
                return(result);
            }
        }
Beispiel #30
0
        public int?ChangePassword(string userName, string salt, string currentPassword, string newPassword)
        {
            int?result;

            string CurrentEncryptedPassword = SecurityHelper.EncryptPassword(currentPassword, salt);
            string NewEncryptedPassword     = SecurityHelper.EncryptPassword(newPassword, salt);

            using (AdoHelper db = new AdoHelper())
            {
                var returnValue = db.CreateParamReturnValue("returnValue");
                db.ExecNonQueryProc("sp_admin_users_change_password", "@UserName", userName, "@CurrentPassword", CurrentEncryptedPassword, "@NewPassword", NewEncryptedPassword, returnValue);
                result = db.GetParamReturnValue(returnValue);
                if (result == 0)
                {
                    BackEndSessions.CurrentUser.Password = NewEncryptedPassword;
                }
            }

            return(result);
        }