Song.ServiceImpls/Contents/DownloadCom.cs

(开头部分) 20KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using WeiSha.Common;
using Song.Entities;

using WeiSha.Data;
using Song.ServiceInterfaces;
using System.Resources;
using System.Reflection;

namespace Song.ServiceImpls
{
    public partial class ContentsCom : IContents
    {
        public int DownloadAdd(Download entity)
        {
            Song.Entities.Columns nc = Business.Do<IColumns>().Single((int)entity.Col_Id);
            if (nc != null) entity.Col_Name = nc.Col_Name;
            //所在机构
            Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
            if (org != null)
            {
                entity.Org_ID = org.Org_ID;
                entity.Org_Name = org.Org_Name;
            }
            return Gateway.Default.Save<Download>(entity);
        }

        public void DownloadSave(Download entity)
        {
            if (entity.Col_Name == "")
            {
                Song.Entities.Columns nc = Business.Do<IColumns>().Single((int)entity.Col_Id);
                if (nc != null) entity.Col_Name = nc.Col_Name;
            }
            Gateway.Default.Save<Download>(entity);
        }

        public int DownloadNumber(int id, int addNum)
        {
            object obj = Gateway.Default.Max<Download>(Download._.Dl_LookNumber, Download._.Dl_Id == id);
            int i = obj is int ? (int)obj : 0;
            //如果不用增加,则直接返回当前浏览量
            if (addNum < 1) return i;
            //增加记数
            i += addNum;
            Gateway.Default.Update<Download>(new Field[] { Download._.Dl_LookNumber }, new object[] { i }, Download._.Dl_Id == id);
            return i;
        }

        public int DownloadNumber(string file, int addNum)
        {
            object obj = Gateway.Default.Max<Download>(Download._.Dl_DownNumber, Download._.Dl_FilePath == file);
            int i = obj is int ? (int)obj : 0;
            //如果不用增加,则直接返回当前浏览量
            if (addNum < 1) return i;
            //增加记数
后面还有 429 行代码,解锁后查看完整代码

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

AI 解读

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

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