コード例 #1
0
 /// <summary>
 /// 订单详情应答构造方法
 /// </summary>
 public OrderDetailResponse(Order_Detail_View detail, List <Colorinfo> tuples)
 {
     //Id
     this.Id = detail.Id;
     //订单id
     this.OrderId = detail.OrderId;
     //商品id
     this.CommodityId = detail.CommodityId;
     //定制数量
     this.Amount = detail.Amount.Value;
     //实付价格
     this.PayMoney = detail.PayMoney;
     //颜色
     if (detail.Color != null)
     {
         var tuple = tuples.Where(p => p.Id == detail.Color).FirstOrDefault();
         this.Color = tuple == null ? "暂时没有此颜色" : tuple.ChinaDescribe;
     }
     else
     {
         this.Color = "暂时未选择颜色";
     }
     //名称
     this.Name = detail.Name;
     //背面效果图
     this.Image         = detail.Image == null ? detail.Image : detail.Image;
     this.DesignerImage = detail.DesignerImage;
     this.UserSure      = detail.UserSure;
     this.DesignCommit  = detail.DesignCommit;
 }
コード例 #2
0
 /// <summary>
 /// 订单详情应答构造方法
 /// </summary>
 public OrderDetailResponse(Order_Detail_View detail, List <Colorinfo> tuples, string PrintFuncInfo)
 {
     //Id
     this.Id = detail.Id;
     //订单id
     this.OrderId = detail.OrderId;
     //商品id
     this.CommodityId = detail.CommodityId;
     //定制数量
     this.Amount = detail.Amount.Value;
     //实付价格
     this.PayMoney = detail.PayMoney;
     //颜色
     if (detail.Color != null)
     {
         var tuple = tuples.Where(p => p.Id == detail.Color).FirstOrDefault();
         this.Color = tuple == null ? "暂时没有此颜色" : tuple.ChinaDescribe;
     }
     else
     {
         this.Color = "暂时未选择颜色";
     }
     //名称
     this.Name = detail.Name;
     //背面效果图
     this.Image = detail.Image == null ? detail.Image : detail.Image;
     if (PrintFuncInfo != null)
     {
         var printInfoList = PrintFuncInfo.Split('|').Where(p => !string.IsNullOrEmpty(p)).ToList();
         foreach (var item in printInfoList)
         {
             if (item.ToLower().Contains($"{detail.PrintingMethod}:".ToLower()))
             {
                 var itemarray = item.Split(':').ToList();
                 this.PrintFuncInfo = itemarray[1];
             }
         }
     }
     this.UserSure     = detail.UserSure;
     this.DesignCommit = detail.DesignCommit;
     this.ProductNo    = detail.ProductNo;
 }
コード例 #3
0
 /// <summary>
 /// 订单详情应答构造方法
 /// </summary>
 public OrderDetailResponse(Order_Detail_View detail, List <Colorinfo> tuples)
 {
     //Id
     this.Id = detail.Id;
     //订单id
     this.OrderId = detail.OrderId;
     //商品id
     this.CommodityId = detail.CommodityId;
     //定制数量
     this.Amount = detail.Amount.Value;
     //实付价格
     this.PayMoney = detail.PayMoney;
     //颜色
     if (detail.Color != null)
     {
         var tuple = tuples.Where(p => p.Id == detail.Color).FirstOrDefault();
         this.Color   = tuple == null ? "暂时没有此颜色" : tuple.ChinaDescribe;
         this.ColorId = detail.Color == null ? 0 : detail.Color.Value;
     }
     else
     {
         this.Color = "暂时未选择颜色";
     }
     //名称
     this.Name      = detail.Name;
     this.ImageList = detail.comImageList;
     ////正面效果图
     //this.FrontImage = detail.FrontImage == null ? detail.FrontView : detail.FrontImage;
     ////正面图参数
     //this.FrontParams = detail.FrontParams;
     ////背面效果图
     //this.BackImage = detail.BackImage == null ? detail.BackView : detail.BackImage; ;
     ////背面图参数
     //this.BackParams = detail.BackParams;
     //背面效果图
     this.Image = detail.Image == null ? detail.Image : detail.Image;;
     ////商品属性
     //this.Attribute = detail.Attribute;
 }
コード例 #4
0
        /// <summary>
        /// 根据分页筛选数据
        /// </summary>
        /// <param name="Key">主键</param>
        /// <param name="start">开始数据</param>
        /// <param name="PageSize">页面长度</param>
        /// <param name="desc">排序</param>
        /// <param name="model">对象</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public List <Order_Detail_View> SelectByPage(string Key, int start, int PageSize, bool desc = true, Order_Detail_View model = null, string SelectFiled = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Order_Detail_View>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.OrderId.IsNullOrEmpty())
                {
                    query.Where(p => p.OrderId == model.OrderId);
                }
                if (!model.CommodityId.IsNullOrEmpty())
                {
                    query.Where(p => p.CommodityId == model.CommodityId);
                }
                if (!model.Color.IsNullOrEmpty())
                {
                    query.Where(p => p.Color == model.Color);
                }
                if (!model.Amount.IsNullOrEmpty())
                {
                    query.Where(p => p.Amount == model.Amount);
                }
                if (!model.PayMoney.IsNullOrEmpty())
                {
                    query.Where(p => p.PayMoney == model.PayMoney);
                }
                if (!model.ShopCartId.IsNullOrEmpty())
                {
                    query.Where(p => p.ShopCartId == model.ShopCartId);
                }
                if (!model.ImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.ImageList == model.ImageList);
                }
                if (!model.WordOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.WordOpertion == model.WordOpertion);
                }
                if (!model.CustomImageOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.CustomImageOpertion == model.CustomImageOpertion);
                }
                if (!model.OnLineImageOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.OnLineImageOpertion == model.OnLineImageOpertion);
                }
                if (!model.Opertion1.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion1 == model.Opertion1);
                }
                if (!model.Opertion2.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion2 == model.Opertion2);
                }
                if (!model.Opertion3.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion3 == model.Opertion3);
                }
                if (!model.DesignerImage.IsNullOrEmpty())
                {
                    query.Where(p => p.DesignerImage == model.DesignerImage);
                }
                if (!model.UserSure.IsNullOrEmpty())
                {
                    query.Where(p => p.UserSure == model.UserSure);
                }
                if (!model.DesignCommit.IsNullOrEmpty())
                {
                    query.Where(p => p.DesignCommit == model.DesignCommit);
                }
                if (!model.PrintingMethod.IsNullOrEmpty())
                {
                    query.Where(p => p.PrintingMethod == model.PrintingMethod);
                }
                if (!model.Name.IsNullOrEmpty())
                {
                    query.Where(p => p.Name == model.Name);
                }
                if (!model.Image.IsNullOrEmpty())
                {
                    query.Where(p => p.Image == model.Image);
                }
                if (!model.Introduce.IsNullOrEmpty())
                {
                    query.Where(p => p.Introduce == model.Introduce);
                }
                if (!model.BackView.IsNullOrEmpty())
                {
                    query.Where(p => p.BackView == model.BackView);
                }
                if (!model.FrontView.IsNullOrEmpty())
                {
                    query.Where(p => p.FrontView == model.FrontView);
                }
                if (!model.comImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.comImageList == model.comImageList);
                }
                if (!model.ProductNo.IsNullOrEmpty())
                {
                    query.Where(p => p.ProductNo == model.ProductNo);
                }
            }
            if (SelectFiled != null)
            {
                SelectFiled = SelectFiled.ToLowerInvariant();
                if (SelectFiled.Contains("id,"))
                {
                    query.Select(p => new { p.Id });
                }
                if (SelectFiled.Contains("orderid,"))
                {
                    query.Select(p => new { p.OrderId });
                }
                if (SelectFiled.Contains("commodityid,"))
                {
                    query.Select(p => new { p.CommodityId });
                }
                if (SelectFiled.Contains("color,"))
                {
                    query.Select(p => new { p.Color });
                }
                if (SelectFiled.Contains("amount,"))
                {
                    query.Select(p => new { p.Amount });
                }
                if (SelectFiled.Contains("paymoney,"))
                {
                    query.Select(p => new { p.PayMoney });
                }
                if (SelectFiled.Contains("shopcartid,"))
                {
                    query.Select(p => new { p.ShopCartId });
                }
                if (SelectFiled.Contains("imagelist,"))
                {
                    query.Select(p => new { p.ImageList });
                }
                if (SelectFiled.Contains("wordopertion,"))
                {
                    query.Select(p => new { p.WordOpertion });
                }
                if (SelectFiled.Contains("customimageopertion,"))
                {
                    query.Select(p => new { p.CustomImageOpertion });
                }
                if (SelectFiled.Contains("onlineimageopertion,"))
                {
                    query.Select(p => new { p.OnLineImageOpertion });
                }
                if (SelectFiled.Contains("opertion1,"))
                {
                    query.Select(p => new { p.Opertion1 });
                }
                if (SelectFiled.Contains("opertion2,"))
                {
                    query.Select(p => new { p.Opertion2 });
                }
                if (SelectFiled.Contains("opertion3,"))
                {
                    query.Select(p => new { p.Opertion3 });
                }
                if (SelectFiled.Contains("designerimage,"))
                {
                    query.Select(p => new { p.DesignerImage });
                }
                if (SelectFiled.Contains("usersure,"))
                {
                    query.Select(p => new { p.UserSure });
                }
                if (SelectFiled.Contains("designcommit,"))
                {
                    query.Select(p => new { p.DesignCommit });
                }
                if (SelectFiled.Contains("printingmethod,"))
                {
                    query.Select(p => new { p.PrintingMethod });
                }
                if (SelectFiled.Contains("name,"))
                {
                    query.Select(p => new { p.Name });
                }
                if (SelectFiled.Contains("image,"))
                {
                    query.Select(p => new { p.Image });
                }
                if (SelectFiled.Contains("introduce,"))
                {
                    query.Select(p => new { p.Introduce });
                }
                if (SelectFiled.Contains("backview,"))
                {
                    query.Select(p => new { p.BackView });
                }
                if (SelectFiled.Contains("frontview,"))
                {
                    query.Select(p => new { p.FrontView });
                }
                if (SelectFiled.Contains("comimagelist,"))
                {
                    query.Select(p => new { p.comImageList });
                }
                if (SelectFiled.Contains("productno,"))
                {
                    query.Select(p => new { p.ProductNo });
                }
            }
            if (Key != null)
            {
                query.OrderByKey(Key, desc);
            }
            return(query.GetQueryPageList(start, PageSize, connection, transaction));
        }
コード例 #5
0
        /// <summary>
        /// 数据条数
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public int SelectCount(Order_Detail_View model = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Order_Detail_View>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.OrderId.IsNullOrEmpty())
                {
                    query.Where(p => p.OrderId == model.OrderId);
                }
                if (!model.CommodityId.IsNullOrEmpty())
                {
                    query.Where(p => p.CommodityId == model.CommodityId);
                }
                if (!model.Color.IsNullOrEmpty())
                {
                    query.Where(p => p.Color == model.Color);
                }
                if (!model.Amount.IsNullOrEmpty())
                {
                    query.Where(p => p.Amount == model.Amount);
                }
                if (!model.PayMoney.IsNullOrEmpty())
                {
                    query.Where(p => p.PayMoney == model.PayMoney);
                }
                if (!model.ShopCartId.IsNullOrEmpty())
                {
                    query.Where(p => p.ShopCartId == model.ShopCartId);
                }
                if (!model.ImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.ImageList == model.ImageList);
                }
                if (!model.WordOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.WordOpertion == model.WordOpertion);
                }
                if (!model.CustomImageOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.CustomImageOpertion == model.CustomImageOpertion);
                }
                if (!model.OnLineImageOpertion.IsNullOrEmpty())
                {
                    query.Where(p => p.OnLineImageOpertion == model.OnLineImageOpertion);
                }
                if (!model.Opertion1.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion1 == model.Opertion1);
                }
                if (!model.Opertion2.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion2 == model.Opertion2);
                }
                if (!model.Opertion3.IsNullOrEmpty())
                {
                    query.Where(p => p.Opertion3 == model.Opertion3);
                }
                if (!model.DesignerImage.IsNullOrEmpty())
                {
                    query.Where(p => p.DesignerImage == model.DesignerImage);
                }
                if (!model.UserSure.IsNullOrEmpty())
                {
                    query.Where(p => p.UserSure == model.UserSure);
                }
                if (!model.DesignCommit.IsNullOrEmpty())
                {
                    query.Where(p => p.DesignCommit == model.DesignCommit);
                }
                if (!model.PrintingMethod.IsNullOrEmpty())
                {
                    query.Where(p => p.PrintingMethod == model.PrintingMethod);
                }
                if (!model.Name.IsNullOrEmpty())
                {
                    query.Where(p => p.Name == model.Name);
                }
                if (!model.Image.IsNullOrEmpty())
                {
                    query.Where(p => p.Image == model.Image);
                }
                if (!model.Introduce.IsNullOrEmpty())
                {
                    query.Where(p => p.Introduce == model.Introduce);
                }
                if (!model.BackView.IsNullOrEmpty())
                {
                    query.Where(p => p.BackView == model.BackView);
                }
                if (!model.FrontView.IsNullOrEmpty())
                {
                    query.Where(p => p.FrontView == model.FrontView);
                }
                if (!model.comImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.comImageList == model.comImageList);
                }
                if (!model.ProductNo.IsNullOrEmpty())
                {
                    query.Where(p => p.ProductNo == model.ProductNo);
                }
            }
            return(query.GetQueryCount(connection, transaction));
        }
コード例 #6
0
 /// <summary>
 /// 根据分页筛选数据
 /// </summary>
 /// <param name="Key">主键</param>
 /// <param name="start">开始数据</param>
 /// <param name="PageSize">页面长度</param>
 /// <param name="desc">排序</param>
 /// <param name="model">对象</param>
 /// <returns>对象列表</returns>
 public List <Order_Detail_View> SelectByPage(string Key, int start, int PageSize, bool desc, Order_Detail_View model, string SelectFiled)
 {
     return(Order_Detail_ViewOper.Instance.SelectByPage(Key, start, PageSize, desc, model));
 }
コード例 #7
0
 /// <summary>
 /// 数据条数
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public int SelectCount(Order_Detail_View model)
 {
     return(Order_Detail_ViewOper.Instance.SelectCount(model));
 }
コード例 #8
0
 /// <summary>
 /// 筛选全部数据
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public List <Order_Detail_View> SelectByModel(Order_Detail_View model)
 {
     return(Order_Detail_ViewOper.Instance.SelectAll(model));
 }