Beispiel #1
0
        public static bool RestoreData(string bakFullName)
        {
            bool flag = StoreProvider.Instance().RestoreData(bakFullName);

            StoreProvider.Instance().Restor();
            return(flag);
        }
Beispiel #2
0
 public static bool CreateFriendlyLink(FriendlyLinksInfo friendlyLink)
 {
     if (null == friendlyLink)
     {
         return(false);
     }
     return(StoreProvider.Instance().CreateUpdateDeleteFriendlyLink(friendlyLink, DataProviderAction.Create));
 }
Beispiel #3
0
		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;
		}
Beispiel #4
0
        public static bool Delete(int userId)
        {
            SiteManager user = HiContext.Current.User as SiteManager;

            if (user.UserId == userId)
            {
                return(false);
            }
            return(StoreProvider.Instance().DeleteManager(userId));
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
		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;
		}
Beispiel #9
0
        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);
        }
Beispiel #10
0
 public static void ClearRolePrivilege(Guid roleId)
 {
     StoreProvider.Instance().ClearRolePrivilege(roleId);
 }
Beispiel #11
0
		public static string BackupData()
		{
			return StoreProvider.Instance().BackupData(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/data/Backup/"));
		}
Beispiel #12
0
		public static int FriendlyLinkDelete(int linkId)
		{
			return StoreProvider.Instance().FriendlyLinkDelete(linkId);
		}
Beispiel #13
0
 public static IList <string> GetOperationUseNames()
 {
     return(StoreProvider.Instance().GetOperationUserNames());
 }
Beispiel #14
0
 public static int DeleteLogs(string strIds)
 {
     return(StoreProvider.Instance().DeleteLogs(strIds));
 }
Beispiel #15
0
 public static bool DeleteAllLogs()
 {
     return(StoreProvider.Instance().DeleteAllLogs());
 }
Beispiel #16
0
		public static void AddHotkeywords(int categoryId, string keywords)
		{
			StoreProvider.Instance().AddHotkeywords(categoryId, keywords);
		}
Beispiel #17
0
		public static void UpdateHotWords(int int_0, int categoryId, string hotKeyWords)
		{
			StoreProvider.Instance().UpdateHotWords(int_0, categoryId, hotKeyWords);
		}
Beispiel #18
0
		public static void SwapHotWordsSequence(int int_0, int replaceHid, int displaySequence, int replaceDisplaySequence)
		{
			StoreProvider.Instance().SwapHotWordsSequence(int_0, replaceHid, displaySequence, replaceDisplaySequence);
		}
Beispiel #19
0
		public static void DeleteHotKeywords(int int_0)
		{
			StoreProvider.Instance().DeleteHotKeywords(int_0);
		}
Beispiel #20
0
		public static void SwapFriendlyLinkSequence(int linkId, int replaceLinkId, int displaySequence, int replaceDisplaySequence)
		{
			StoreProvider.Instance().SwapFriendlyLinkSequence(linkId, replaceLinkId, displaySequence, replaceDisplaySequence);
		}
Beispiel #21
0
		public static bool CreateFriendlyLink(FriendlyLinksInfo friendlyLink)
		{
			return null != friendlyLink && StoreProvider.Instance().CreateUpdateDeleteFriendlyLink(friendlyLink, DataProviderAction.Create);
		}
Beispiel #22
0
		public static FriendlyLinksInfo GetFriendlyLink(int linkId)
		{
			return StoreProvider.Instance().GetFriendlyLink(linkId);
		}
Beispiel #23
0
 public static DbQueryResult GetManagers(ManagerQuery query)
 {
     return(StoreProvider.Instance().GetManagers(query));
 }
Beispiel #24
0
		public static System.Data.DataTable GetHotKeywords()
		{
			return StoreProvider.Instance().GetHotKeywords();
		}
Beispiel #25
0
 public static bool DeleteLog(long logId)
 {
     return(StoreProvider.Instance().DeleteLog(logId));
 }
Beispiel #26
0
		public static System.Data.DataSet GetVotes()
		{
			return StoreProvider.Instance().GetVotes();
		}
Beispiel #27
0
 public static DbQueryResult GetLogs(OperationLogQuery query)
 {
     return(StoreProvider.Instance().GetLogs(query));
 }
Beispiel #28
0
		public static int SetVoteIsBackup(long voteId)
		{
			return StoreProvider.Instance().SetVoteIsBackup(voteId);
		}
Beispiel #29
0
		public static string GetHotkeyword(int int_0)
		{
			return StoreProvider.Instance().GetHotkeyword(int_0);
		}
Beispiel #30
0
		public static bool RestoreData(string bakFullName)
		{
			bool result = StoreProvider.Instance().RestoreData(bakFullName);
			StoreProvider.Instance().Restor();
			return result;
		}