温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:MyShop网络商城源码(mvc开发)
当前文件路径:MyShop/BLL/Order.cs

1using System; 2
using System.Collections.Generic; 3
4
using System.Data; 5
6
7
using MyShop.DALFactory; 8
using MyShop.IDAL; 9
using MyShop.Model; 10
11
namespace MyShop.BLL 12
{ 13
public class Order 14
{ 15
private IOrder dal = DataAccess.CreateOrder(); 16
17
IOrder 87
88
common 134
135
public DataSet GetDataSet(int userId) 136
{ 137
string filter = ""; 138
if (userId == -1) 139
return null; 140
filter = " [clientId]= " + userId; 141
return dal.GetDataSet(filter); 142
} 143
public DataSet GetDataSetByOrderNum(string orderNum) 144
{ 145
if (orderNum == string.Empty) 146
return null; 147
string filter; 148
filter = " [orderNum]='" + orderNum + "'"; 149
return dal.GetDataSet(" orderNum='" + orderNum + "'"); 150
} 151
public OrderInfo GetModel(string orderNum) 152
{ 153
if ( string.IsNullOrEmpty( orderNum )) 154
return null; 155
if (GetDataSetByOrderNum(orderNum).Tables[0].Rows.Count == 0) 156
return null; 157
return GetModel(GetDataSetByOrderNum(orderNum).Tables[0].Rows[0]); 158
} 159
160
/// <summary> 161
/// 是否已付清 162
/// </summary> 163
/// <param name="orderId"></param> 164
/// <returns></returns> 165
public bool IsPaid(int orderId) 166
{ 167
OrderInfo model = new OrderInfo(); 168
Order order = new Order(); 169
model = order.GetModel(orderId); 170
if (model == null) 171
return true; //订单号码错误,直接返回true 172
if (model.status == 3 || model.moneyTotal == model.MoneyReceipt ) 173
return true; 174
else 175
return false; 176
} 177
178
/// <summary> 179
/// 是否已付清 180
/// </summary> 181
/// <param name="orderId"></param> 182
/// <returns></returns> 183
public bool IsPaid(string orderNum) 184
{ 185
OrderInfo model = new OrderInfo(); 186
Order order = new Order(); 187
model = order.GetModel(orderNum); 188
if (model == null) 189
return true; //订单号码错误,直接返回true 190
if (model.status == 3 || model.moneyTotal == model.MoneyReceipt) 191
return true; 192
else 193
return false; 194
} 195
196
SearchOrder 224
225
public DataSet GetDataSetByProductId(int productId) 226
{ 227
if(string.IsNullOrEmpty(productId.ToString())) 228
return null; 229
return GetDataSet(" productId =" + productId); 230
} 231
232
public DataSet GetDataSetByOrderId(int orderId) 233
{ 234
DataSet dataset = new DataSet(); 235
dataset = GetDataSet(" orderId=" + orderId); 236
return dataset; 237
} 238
239
... 261
262
263
/// <summary> 264
/// 获取今日订单 265
/// </summary> 266
/// <param name="userId"></param> 267
/// <returns></returns> 268
public DataSet GetTodayOrder(int userId) 269
{ 270
271
return dal.GetTodayOrder(userId); 272
} 273
274
} 275
} 276





}