DAL/OrderDetailService.cs

(开头部分) 16KB

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

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;

namespace DAL
{
	/// <summary>
	/// 数据访问类:OrderDetailService
	/// </summary>
	public partial class OrderDetailService
	{
		public OrderDetailService()
		{}
		#region  BasicMethod
        /// <summary>
        /// 更新详情信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int UpdateRemark(Model.OrderDetail model) 
        {
            string sql = "update OrderDetail set total = " + model.total + " where id = " + model.id;
            return DBHelperSQL.ExecuteSql(sql);
        }
        /// <summary>
        /// 获取已购产品种类数量
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static int GetProductTypeCount(int userId)
        {
           // DataSet ds = ProductService.GetList("id in(select productId from OrderDetail where orderId in (select id from OrderInfo where addUser = " + user.id + " and status in(1,2,3,4)))");
            string sql = "select count(productId) as productCount from orderdetail where orderId in(select id from OrderInfo where status in(1,2,3,4) and addUser = " + userId + ")";
            object obj = DBHelperSQL.GetSingle(sql);
            if(obj != null)
            {
                return Convert.ToInt32(obj);
            }
            return 0;
        }
        /// <summary>
        /// 购买的产品信息
        /// </summary>
        /// <returns></returns>
        public static DataSet GetProduct(int addUser) 
        {
            string sql = "select max(productId) as productId from OrderDetail where orderId in(select id from OrderInfo where addUser = " + addUser + ")  group by productId";
            return DBHelperSQL.Query(sql);
        }
        /// <summary>
        /// 查询订单产品数量
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public static int GetProductCount(int orderId) 
        {
            string sql = "select sum(productCount) from OrderDetail where orderId = " + orderId;
            object obj = DBHelperSQL.GetSingle(sql);
            if(obj != null)
后面还有 451 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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