Hidistro.ControlPanel/Hidistro/ControlPanel/Store/StoreHelper.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.ControlPanel.Store
{
    using Hidistro.Core;
    using Hidistro.Entities.Promotions;
    using Hidistro.SqlDal;
    using Hidistro.SqlDal.Promotions;
    using Microsoft.Practices.EnterpriseLibrary.Data;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.Common;
    using System.IO;
    using System.Web;
    using System.Xml;

    public static class StoreHelper
    {
        public static string BackupData()
        {
            return new BackupRestoreDao().BackupData(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/data/Backup/"));
        }

        public static int CreateVote(VoteInfo vote)
        {
            int num = 0;
            VoteDao dao = new VoteDao();
            long num2 = dao.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 += dao.CreateVoteItem(info, null);
                }
            }
            return num;
        }

        public static bool DeleteBackupFile(string backupName)
        {
            string filename = HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/config/BackupFiles.config");
            try
            {
                XmlDocument document = new XmlDocument();
                document.Load(filename);
                XmlNodeList childNodes = document.SelectSingleNode("root").ChildNodes;
                foreach (XmlNode node in childNodes)
                {
                    XmlElement element = (XmlElement) node;
                    if (element.GetAttribute("BackupName") == backupName)
                    {
                        document.SelectSingleNode("root").RemoveChild(node);
                    }
                }
后面还有 193 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。