order.cs

来自「某个公司需要维持良好的客户关系」· CS 代码 · 共 78 行

CS
78 行
字号
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using CRM.IDAL;
using CRM.Model;

namespace CRM.BLL
{
	/// <summary>
	/// Order 的摘要说明。
	/// </summary>
	public  class Order : Common
	{
		#region IOrder 成员

		public static DataTable GetAllOrder()
		{
			IOrder dal=CRM.DALFactory.Order.Create();
			return dal.GetAllOrder();
		}

		public static void Insert(OrderInfo order)
		{
			if(!Common.CheckStrIsNull(order.CustomerId))
			{
				IOrder dal=CRM.DALFactory.Order.Create();
				dal.Insert(order);
			}
		}

		public static DataTable GetOrderByCustomerId(string customerId)
		{
			if(Common.CheckStrIsNull(customerId))
				return null;
			IOrder dal=CRM.DALFactory.Order.Create();
			return dal.GetOrderByCustomerId(customerId);
		}

		public static OrderInfo GetOrderById(string orderId)
		{
			if(Common.CheckStrIsNull(orderId))
					return null;
			IOrder dal=CRM.DALFactory.Order.Create();
			return dal.GetOrderById(orderId);
			
		}

		public static void Delete(string orderId)
		{
			if(!Common.CheckStrIsNull(orderId))
			{
				IOrder dal=CRM.DALFactory.Order.Create();
				dal.Delete(orderId);
			}
		}

		public static void Update(OrderInfo order)
		{
			if(!Common.CheckStrIsNull(order.OrderId,order.CustomerId,order.Status))
			{
				IOrder dal=CRM.DALFactory.Order.Create();
				dal.Update(order);
			}
		}
		public static DataTable GetOrderByUserId(string userid)
		{
			if(!Common.CheckStrIsNull(userid))
			{
				IOrder dal=CRM.DALFactory.Order.Create();
				return dal.GetOrderByUserId(userid);
			}
			return null;
		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?