Song.ServiceImpls/Contents/PictureCom.cs

(开头部分) 8KB

这里只显示每个文件的开头 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
    {
        //图片信息的排序规则
        private OrderByClip piOrder = Picture._.Pic_IsCover.Asc && Picture._.Pic_Tax.Asc;

        public int PictureAdd(Picture entity)
        {
            //设置新对象的排序号
            object obj = Gateway.Default.Max<Picture>( Picture._.Pic_Tax,Picture._.Col_Id == entity.Col_Id);
            entity.Pic_Tax = obj is int ? (int)obj + 1 : 1;
            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<Picture>(entity);
        }

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

        public void PictureDelete(int identify)
        {
            Song.Entities.Picture entity = this.PictureSingle(identify);
            if (entity == null) return;
            PictureDelete(entity); 
        }
        public void PictureDelete(Picture entity)
        {
            //删除图片
            WeiSha.WebControl.FileUpload.Delete(entity.Pic_Type, entity.Pic_FilePath);
            //删除自身            
            Gateway.Default.Delete<Picture>(entity);
        }
        /// <summary>
        /// 删除所有图片
        /// </summary>
后面还有 137 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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