public static bool RestoreData(string bakFullName) { bool flag = StoreProvider.Instance().RestoreData(bakFullName); StoreProvider.Instance().Restor(); return(flag); }
public static bool CreateFriendlyLink(FriendlyLinksInfo friendlyLink) { if (null == friendlyLink) { return(false); } return(StoreProvider.Instance().CreateUpdateDeleteFriendlyLink(friendlyLink, DataProviderAction.Create)); }
public static bool UpdateVote(VoteInfo vote) { Database database = DatabaseFactory.CreateDatabase(); bool result; using (System.Data.Common.DbConnection dbConnection = database.CreateConnection()) { dbConnection.Open(); System.Data.Common.DbTransaction dbTransaction = dbConnection.BeginTransaction(); try { if (!StoreProvider.Instance().UpdateVote(vote, dbTransaction)) { dbTransaction.Rollback(); result = false; } else { if (!StoreProvider.Instance().DeleteVoteItem(vote.VoteId, dbTransaction)) { dbTransaction.Rollback(); result = false; } else { int num = 0; if (vote.VoteItems != null) { foreach (VoteItemInfo current in vote.VoteItems) { current.VoteId = vote.VoteId; current.ItemCount = 0; num += StoreProvider.Instance().CreateVoteItem(current, dbTransaction); } if (num < vote.VoteItems.Count) { dbTransaction.Rollback(); result = false; return result; } } dbTransaction.Commit(); result = true; } } } catch { dbTransaction.Rollback(); result = false; } finally { dbConnection.Close(); } } return result; }
public static bool Delete(int userId) { SiteManager user = HiContext.Current.User as SiteManager; if (user.UserId == userId) { return(false); } return(StoreProvider.Instance().DeleteManager(userId)); }
public static bool UpdateVote(VoteInfo vote) { bool flag; using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection()) { connection.Open(); DbTransaction dbTran = connection.BeginTransaction(); try { if (!StoreProvider.Instance().UpdateVote(vote, dbTran)) { dbTran.Rollback(); return(false); } if (!StoreProvider.Instance().DeleteVoteItem(vote.VoteId, dbTran)) { dbTran.Rollback(); return(false); } int num = 0; if (vote.VoteItems != null) { foreach (VoteItemInfo info in vote.VoteItems) { info.VoteId = vote.VoteId; info.ItemCount = 0; num += StoreProvider.Instance().CreateVoteItem(info, dbTran); } if (num < vote.VoteItems.Count) { dbTran.Rollback(); return(false); } } dbTran.Commit(); flag = true; } catch { dbTran.Rollback(); flag = false; } finally { connection.Close(); } } return(flag); }
public static void WriteOperationLog(Privilege privilege, string description) { OperationLogEntry entry2 = new OperationLogEntry(); entry2.AddedTime = DateTime.Now; entry2.Privilege = privilege; entry2.Description = description; entry2.IpAddress = Globals.IPAddress; entry2.PageUrl = HiContext.Current.Context.Request.RawUrl; entry2.UserName = HiContext.Current.Context.User.Identity.Name; OperationLogEntry entry = entry2; StoreProvider.Instance().WriteOperationLogEntry(entry); }
public static void WriteOperationLog(Privilege privilege, string description) { OperationLogEntry entry = new OperationLogEntry { AddedTime = DateTime.Now, Privilege = privilege, Description = description, IpAddress = Globals.IPAddress, PageUrl = HiContext.Current.Context.Request.RawUrl, UserName = HiContext.Current.Context.User.Identity.Name }; StoreProvider.Instance().WriteOperationLogEntry(entry); }
public static int CreateVote(VoteInfo vote) { int num = 0; long num2 = StoreProvider.Instance().CreateVote(vote); if (num2 > 0L) { num = 1; if (vote.VoteItems != null) { foreach (VoteItemInfo current in vote.VoteItems) { current.VoteId = num2; current.ItemCount = 0; num += StoreProvider.Instance().CreateVoteItem(current, null); } } } return num; }
public static int CreateVote(VoteInfo vote) { int num = 0; long num2 = StoreProvider.Instance().CreateVote(vote); if (num2 > 0L) { num = 1; if (vote.VoteItems == null) { return(num); } foreach (VoteItemInfo info in vote.VoteItems) { info.VoteId = num2; info.ItemCount = 0; num += StoreProvider.Instance().CreateVoteItem(info, null); } } return(num); }
public static void ClearRolePrivilege(Guid roleId) { StoreProvider.Instance().ClearRolePrivilege(roleId); }
public static string BackupData() { return StoreProvider.Instance().BackupData(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/data/Backup/")); }
public static int FriendlyLinkDelete(int linkId) { return StoreProvider.Instance().FriendlyLinkDelete(linkId); }
public static IList <string> GetOperationUseNames() { return(StoreProvider.Instance().GetOperationUserNames()); }
public static int DeleteLogs(string strIds) { return(StoreProvider.Instance().DeleteLogs(strIds)); }
public static bool DeleteAllLogs() { return(StoreProvider.Instance().DeleteAllLogs()); }
public static void AddHotkeywords(int categoryId, string keywords) { StoreProvider.Instance().AddHotkeywords(categoryId, keywords); }
public static void UpdateHotWords(int int_0, int categoryId, string hotKeyWords) { StoreProvider.Instance().UpdateHotWords(int_0, categoryId, hotKeyWords); }
public static void SwapHotWordsSequence(int int_0, int replaceHid, int displaySequence, int replaceDisplaySequence) { StoreProvider.Instance().SwapHotWordsSequence(int_0, replaceHid, displaySequence, replaceDisplaySequence); }
public static void DeleteHotKeywords(int int_0) { StoreProvider.Instance().DeleteHotKeywords(int_0); }
public static void SwapFriendlyLinkSequence(int linkId, int replaceLinkId, int displaySequence, int replaceDisplaySequence) { StoreProvider.Instance().SwapFriendlyLinkSequence(linkId, replaceLinkId, displaySequence, replaceDisplaySequence); }
public static bool CreateFriendlyLink(FriendlyLinksInfo friendlyLink) { return null != friendlyLink && StoreProvider.Instance().CreateUpdateDeleteFriendlyLink(friendlyLink, DataProviderAction.Create); }
public static FriendlyLinksInfo GetFriendlyLink(int linkId) { return StoreProvider.Instance().GetFriendlyLink(linkId); }
public static DbQueryResult GetManagers(ManagerQuery query) { return(StoreProvider.Instance().GetManagers(query)); }
public static System.Data.DataTable GetHotKeywords() { return StoreProvider.Instance().GetHotKeywords(); }
public static bool DeleteLog(long logId) { return(StoreProvider.Instance().DeleteLog(logId)); }
public static System.Data.DataSet GetVotes() { return StoreProvider.Instance().GetVotes(); }
public static DbQueryResult GetLogs(OperationLogQuery query) { return(StoreProvider.Instance().GetLogs(query)); }
public static int SetVoteIsBackup(long voteId) { return StoreProvider.Instance().SetVoteIsBackup(voteId); }
public static string GetHotkeyword(int int_0) { return StoreProvider.Instance().GetHotkeyword(int_0); }
public static bool RestoreData(string bakFullName) { bool result = StoreProvider.Instance().RestoreData(bakFullName); StoreProvider.Instance().Restor(); return result; }