customer.cs

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

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

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

		public static DataTable GetAllCustomer()
		{
			ICustomer dal=CRM.DALFactory.Customer.Create();
			return dal.GetAllCustomer();
		}

		public static void Insert(SysUserInfo user,CustomerInfo customer)
		{
			if(!Common.CheckStrIsNull(user.UserId,customer.CustomerName,customer.Leader,customer.TypeId,customer.DeputyId,customer.LevelId))
			{
				ICustomer dal=CRM.DALFactory.Customer.Create();
				dal.Insert(user,customer);
			}
		}

		public static CustomerInfo GetCustomerById(string customerId)
		{
			if(Common.CheckStrIsNull(customerId))
				return null;
			ICustomer dal=CRM.DALFactory.Customer.Create();
			return dal.GetCustomerById(customerId);
		}

		public static void Delete(string customerId)
		{
			if(!Common.CheckStrIsNull(customerId))
			{
				ICustomer dal=CRM.DALFactory.Customer.Create();
				dal.Delete(customerId);
			}
		}

		public static void Update(CustomerInfo customer)
		{
			if(!Common.CheckStrIsNull(customer.CustomerId,customer.CustomerName,customer.Leader,customer.TypeId,customer.DeputyId,customer.LevelId))
			{
				ICustomer dal=CRM.DALFactory.Customer.Create();
				dal.Update(customer);
			}
		}

		public static DataTable GetCustomerByTypeId(string typeId)
		{
			if(Common.CheckStrIsNull(typeId))
				return null;
			ICustomer dal=CRM.DALFactory.Customer.Create();
			return dal.GetCustomerByTypeId(typeId);
		}
		public static SysUserInfo GetSysUserByCustomerId(string customerId)
		{
			if(Common.CheckStrIsNull(customerId))
				return null;
			ICustomer dal=CRM.DALFactory.Customer.Create();
			return dal.GetSysUserByCustomerId(customerId);
		}
		#endregion
	}
}

⌨️ 快捷键说明

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