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

📄 hotelorder.cs.svn-base

📁 走吧旅游网站前后台源代码
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;//请先添加引用
namespace Maticsoft.DAL
{
	/// <summary>
	/// 数据访问类HotelOrder。
	/// </summary>
	public class HotelOrder
	{
		public HotelOrder()
		{}
		#region  成员方法

		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(string OrderNo)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from HotelOrder");
			strSql.Append(" where OrderNo=@OrderNo ");
			SqlParameter[] parameters = {
					new SqlParameter("@OrderNo", SqlDbType.NVarChar,50)};
			parameters[0].Value = OrderNo;

			return DbHelperSQL.Exists(strSql.ToString(),parameters);
		}


		/// <summary>
		/// 增加一条数据
		/// </summary>
		public void Add(Maticsoft.Model.HotelOrder model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into HotelOrder(");
			strSql.Append("OrderNo,HotelID,Indate,Outdate,PayMethods,RoomTrait,LocalFloor,BreakfastPrice1,BreakfastPrice2,AddBedPrice,Advance,InManAmount,InPaper,InManName,ArriveEarlyDate,ArriveLateDate,ArriveMethods,LinkMan,ConfirmedMethods,Phone1,Phone2,Fax,Email,Remark,RoomType,AveragePrice,OrderState,ConfirmID,ConfimDate,AccountConfirmID,AccountConfirmDate,PlanConfirmID,PlanConfirmDate,VenderID)");
			strSql.Append(" values (");
			strSql.Append("@OrderNo,@HotelID,@Indate,@Outdate,@PayMethods,@RoomTrait,@LocalFloor,@BreakfastPrice1,@BreakfastPrice2,@AddBedPrice,@Advance,@InManAmount,@InPaper,@InManName,@ArriveEarlyDate,@ArriveLateDate,@ArriveMethods,@LinkMan,@ConfirmedMethods,@Phone1,@Phone2,@Fax,@Email,@Remark,@RoomType,@AveragePrice,@OrderState,@ConfirmID,@ConfimDate,@AccountConfirmID,@AccountConfirmDate,@PlanConfirmID,@PlanConfirmDate,@VenderID)");
			SqlParameter[] parameters = {
					new SqlParameter("@OrderNo", SqlDbType.NVarChar,15),
					new SqlParameter("@HotelID", SqlDbType.NVarChar,12),
					new SqlParameter("@Indate", SqlDbType.NVarChar,20),
					new SqlParameter("@Outdate", SqlDbType.NVarChar,20),
					new SqlParameter("@PayMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@RoomTrait", SqlDbType.NVarChar,100),
					new SqlParameter("@LocalFloor", SqlDbType.NVarChar,20),
					new SqlParameter("@BreakfastPrice1", SqlDbType.Decimal,9),
					new SqlParameter("@BreakfastPrice2", SqlDbType.Decimal,9),
					new SqlParameter("@AddBedPrice", SqlDbType.Decimal,9),
					new SqlParameter("@Advance", SqlDbType.Int,4),
					new SqlParameter("@InManAmount", SqlDbType.Int,4),
					new SqlParameter("@InPaper", SqlDbType.NVarChar,20),
					new SqlParameter("@InManName", SqlDbType.NVarChar,12),
					new SqlParameter("@ArriveEarlyDate", SqlDbType.NVarChar,20),
					new SqlParameter("@ArriveLateDate", SqlDbType.NVarChar,20),
					new SqlParameter("@ArriveMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@LinkMan", SqlDbType.NVarChar,12),
					new SqlParameter("@ConfirmedMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@Phone1", SqlDbType.NVarChar,30),
					new SqlParameter("@Phone2", SqlDbType.NVarChar,20),
					new SqlParameter("@Fax", SqlDbType.NVarChar,20),
					new SqlParameter("@Email", SqlDbType.NVarChar,30),
					new SqlParameter("@Remark", SqlDbType.Text),
					new SqlParameter("@RoomType", SqlDbType.NVarChar,20),
					new SqlParameter("@AveragePrice", SqlDbType.Decimal,9),
					new SqlParameter("@OrderState", SqlDbType.Int,4),
					new SqlParameter("@ConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@ConfimDate", SqlDbType.DateTime),
					new SqlParameter("@AccountConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@AccountConfirmDate", SqlDbType.DateTime),
					new SqlParameter("@PlanConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@PlanConfirmDate", SqlDbType.DateTime),
					new SqlParameter("@VenderID", SqlDbType.NVarChar,12)};
			parameters[0].Value = model.OrderNo;
			parameters[1].Value = model.HotelID;
			parameters[2].Value = model.Indate;
			parameters[3].Value = model.Outdate;
			parameters[4].Value = model.PayMethods;
			parameters[5].Value = model.RoomTrait;
			parameters[6].Value = model.LocalFloor;
			parameters[7].Value = model.BreakfastPrice1;
			parameters[8].Value = model.BreakfastPrice2;
			parameters[9].Value = model.AddBedPrice;
			parameters[10].Value = model.Advance;
			parameters[11].Value = model.InManAmount;
			parameters[12].Value = model.InPaper;
			parameters[13].Value = model.InManName;
			parameters[14].Value = model.ArriveEarlyDate;
			parameters[15].Value = model.ArriveLateDate;
			parameters[16].Value = model.ArriveMethods;
			parameters[17].Value = model.LinkMan;
			parameters[18].Value = model.ConfirmedMethods;
			parameters[19].Value = model.Phone1;
			parameters[20].Value = model.Phone2;
			parameters[21].Value = model.Fax;
			parameters[22].Value = model.Email;
			parameters[23].Value = model.Remark;
			parameters[24].Value = model.RoomType;
			parameters[25].Value = model.AveragePrice;
			parameters[26].Value = model.OrderState;
			parameters[27].Value = model.ConfirmID;
			parameters[28].Value = model.ConfimDate;
			parameters[29].Value = model.AccountConfirmID;
			parameters[30].Value = model.AccountConfirmDate;
			parameters[31].Value = model.PlanConfirmID;
			parameters[32].Value = model.PlanConfirmDate;
			parameters[33].Value = model.VenderID;

			DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public void Update(Maticsoft.Model.HotelOrder model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update HotelOrder set ");
			strSql.Append("HotelID=@HotelID,");
			strSql.Append("Indate=@Indate,");
			strSql.Append("Outdate=@Outdate,");
			strSql.Append("PayMethods=@PayMethods,");
			strSql.Append("RoomTrait=@RoomTrait,");
			strSql.Append("LocalFloor=@LocalFloor,");
			strSql.Append("BreakfastPrice1=@BreakfastPrice1,");
			strSql.Append("BreakfastPrice2=@BreakfastPrice2,");
			strSql.Append("AddBedPrice=@AddBedPrice,");
			strSql.Append("Advance=@Advance,");
			strSql.Append("InManAmount=@InManAmount,");
			strSql.Append("InPaper=@InPaper,");
			strSql.Append("InManName=@InManName,");
			strSql.Append("ArriveEarlyDate=@ArriveEarlyDate,");
			strSql.Append("ArriveLateDate=@ArriveLateDate,");
			strSql.Append("ArriveMethods=@ArriveMethods,");
			strSql.Append("LinkMan=@LinkMan,");
			strSql.Append("ConfirmedMethods=@ConfirmedMethods,");
			strSql.Append("Phone1=@Phone1,");
			strSql.Append("Phone2=@Phone2,");
			strSql.Append("Fax=@Fax,");
			strSql.Append("Email=@Email,");
			strSql.Append("Remark=@Remark,");
			strSql.Append("RoomType=@RoomType,");
			strSql.Append("AveragePrice=@AveragePrice,");
			strSql.Append("OrderState=@OrderState,");
			strSql.Append("ConfirmID=@ConfirmID,");
			strSql.Append("ConfimDate=@ConfimDate,");
			strSql.Append("AccountConfirmID=@AccountConfirmID,");
			strSql.Append("AccountConfirmDate=@AccountConfirmDate,");
			strSql.Append("PlanConfirmID=@PlanConfirmID,");
			strSql.Append("PlanConfirmDate=@PlanConfirmDate,");
			strSql.Append("VenderID=@VenderID");
			strSql.Append(" where OrderNo=@OrderNo ");
			SqlParameter[] parameters = {
					new SqlParameter("@OrderNo", SqlDbType.NVarChar,15),
					new SqlParameter("@HotelID", SqlDbType.NVarChar,12),
					new SqlParameter("@Indate", SqlDbType.NVarChar,20),
					new SqlParameter("@Outdate", SqlDbType.NVarChar,20),
					new SqlParameter("@PayMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@RoomTrait", SqlDbType.NVarChar,100),
					new SqlParameter("@LocalFloor", SqlDbType.NVarChar,20),
					new SqlParameter("@BreakfastPrice1", SqlDbType.Decimal,9),
					new SqlParameter("@BreakfastPrice2", SqlDbType.Decimal,9),
					new SqlParameter("@AddBedPrice", SqlDbType.Decimal,9),
					new SqlParameter("@Advance", SqlDbType.Int,4),
					new SqlParameter("@InManAmount", SqlDbType.Int,4),
					new SqlParameter("@InPaper", SqlDbType.NVarChar,20),
					new SqlParameter("@InManName", SqlDbType.NVarChar,12),
					new SqlParameter("@ArriveEarlyDate", SqlDbType.NVarChar,20),
					new SqlParameter("@ArriveLateDate", SqlDbType.NVarChar,20),
					new SqlParameter("@ArriveMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@LinkMan", SqlDbType.NVarChar,12),
					new SqlParameter("@ConfirmedMethods", SqlDbType.NVarChar,10),
					new SqlParameter("@Phone1", SqlDbType.NVarChar,30),
					new SqlParameter("@Phone2", SqlDbType.NVarChar,20),
					new SqlParameter("@Fax", SqlDbType.NVarChar,20),
					new SqlParameter("@Email", SqlDbType.NVarChar,30),
					new SqlParameter("@Remark", SqlDbType.Text),
					new SqlParameter("@RoomType", SqlDbType.NVarChar,20),
					new SqlParameter("@AveragePrice", SqlDbType.Decimal,9),
					new SqlParameter("@OrderState", SqlDbType.Int,4),
					new SqlParameter("@ConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@ConfimDate", SqlDbType.DateTime),
					new SqlParameter("@AccountConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@AccountConfirmDate", SqlDbType.DateTime),
					new SqlParameter("@PlanConfirmID", SqlDbType.NVarChar,12),
					new SqlParameter("@PlanConfirmDate", SqlDbType.DateTime),

⌨️ 快捷键说明

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