Song.ServiceImpls/ProductCom/ProductPicture.cs

(开头部分) 7KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;

using NBear.Common;
using Song.Entities;
using NBear.IoC.Service;
using NBear.Data;
using Song.ServiceInterfaces;
using System.Resources;
using System.Reflection;



namespace Song.ServiceImpls
{
    public partial class ProductCom : IProduct
    {

        #region 产品图片管理
        /// <summary>
        /// 添加产品图片
        /// </summary>
        /// <param name="entity"></param>
        public void PictureAdd(ProductPicture entity)
        {
            //创建时间
            entity.Pp_CrtTime = DateTime.Now;
            entity.Pp_IsUse = true;
            entity.Pp_IsCover = false;
            Song.Entities.Product pd = new ContentsCom().ProductSingle(entity.Pd_Uid);
            if (pd != null)
            {
                entity.Pd_Id = pd.Pd_Id;
                entity.Pd_Name = pd.Pd_Name;
            }
            object obj = Gateway.Default.Count<ProductPicture>(ProductPicture._.Pd_Uid == entity.Pd_Uid);
            //设置当前图片封面
            DbTransaction tran = Gateway.Default.BeginTransaction();
            try
            {
                if ((int)obj < 1)
                {
                    entity.Pp_IsCover = true;
                    pd.Pd_Logo = entity.Pp_File;
                    pd.Pd_LogoSmall = entity.Pp_FileSmall;
                    Gateway.Default.Save<Product>(pd, tran);
                }
                Gateway.Default.Save<ProductPicture>(entity,tran);
                tran.Commit();
            }
            catch(Exception e)
            {
                tran.Rollback();
                throw e;
            }
            finally
            {
后面还有 137 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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