⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customertype.cs

📁 某个公司需要维持良好的客户关系
💻 CS
字号:
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using CRM.IDAL;
using CRM.Model;

namespace CRM.SQLServerDAL
{
	/// <summary>
	/// CustomerType 的摘要说明。
	/// </summary>
	public class CustomerType : ICustomerType
	{
		#region ICustomerType 成员

		public void Insert(CustomerTypeInfo type)
		{
			object[] parms = {
								 Common.GetNextIdByTable("CustomerTypeInfo","TypeId","MulLayer",(type.TypeId != null) ? type.TypeId.Trim() : null ,2),
								 type.TypeName,
								 type.BZ
							 };
			DAI.RunProcNonQuery("CRM_CustomerType_Insert",parms);
		}
		public void Delete(string typeId)
		{
			DAI.RunProcNonQuery("CRM_CustomerType_Delete",typeId);
		}

		public void Update(CustomerTypeInfo type)
		{
			object[] parms = {
								type.TypeId,
								type.TypeName,
								type.BZ
							 };
			DAI.RunProcNonQuery("CRM_CustomerType_Update",parms);
		}

		public DataTable GetAllType()
		{
			return DAI.RunProcTable("CRM_CustomerType_GetAllType");
		}

		public CustomerTypeInfo GetTypeById(string typeId)
		{
			CustomerTypeInfo type = null;
			using (SqlDataReader rdr = DAI.RunProcReader("CRM_CustomerType_GetTypeById",typeId))
			{
				if (rdr.Read())
				{
					type = new CustomerTypeInfo();

					type.TypeId = rdr["TypeId"].ToString();
					type.TypeName = rdr["TypeName"].ToString();
					type.BZ = rdr["BZ"].ToString();
				}
			}
			return type;
		}

		#endregion
	}
}

⌨️ 快捷键说明

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