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

📄 modify.aspx.cs.svn-base

📁 走吧旅游网站前后台源代码
💻 SVN-BASE
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LTP.Common;
namespace Maticsoft.Web.HotelRoomPrice
{
    public partial class Modify : System.Web.UI.Page
    {       

        		protected void Page_LoadComplete(object sender, EventArgs e)
		{
			(Master.FindControl("lblTitle") as Label).Text = "信息修改";
		}
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				if (Request.Params["id"] != null || Request.Params["id"].Trim() != "")
				{
					string id = Request.Params["id"];
					ShowInfo(int.Parse(id));
				}
			}
		}
			
private void ShowInfo(string RoomType)
{
	Maticsoft.BLL.HotelRoomPrice bll=new Maticsoft.BLL.HotelRoomPrice();
	Maticsoft.Model.HotelRoomPrice model=bll.GetModel(RoomType);
	this.lblHotelID.Text=model.HotelID;
	this.lblRoomType.Text=model.RoomType;
	this.txtPrice.Text=model.Price.ToString();
	this.txtCashPrice.Text=model.CashPrice.ToString();
	this.txtHasBreakfast.Text=model.HasBreakfast;
	this.txtBedType.Text=model.BedType;
	this.txtHasInternet.Text=model.HasInternet;
	this.txtLocalFloor.Text=model.LocalFloor;
	this.txtRoomTrait.Text=model.RoomTrait;
	this.txtBreakfastPrice1.Text=model.BreakfastPrice1.ToString();
	this.txtBreakfastPrice2.Text=model.BreakfastPrice2.ToString();
	this.txtArea.Text=model.Area.ToString();
	this.txtAddBedPrice.Text=model.AddBedPrice.ToString();
	this.txtRoomAmount.Text=model.RoomAmount.ToString();
	this.txtRemark.Text=model.Remark;

}
		protected void btnAdd_Click(object sender, EventArgs e)
		{
			
	string strErr="";
	if(!PageValidate.IsDecimal(txtPrice.Text))
	{
		strErr+="Price不是数字!\\n";	
	}
	if(!PageValidate.IsDecimal(txtCashPrice.Text))
	{
		strErr+="CashPrice不是数字!\\n";	
	}
	if(this.txtHasBreakfast.Text =="")
	{
		strErr+="HasBreakfast不能为空!\\n";	
	}
	if(this.txtBedType.Text =="")
	{
		strErr+="BedType不能为空!\\n";	
	}
	if(this.txtHasInternet.Text =="")
	{
		strErr+="HasInternet不能为空!\\n";	
	}
	if(this.txtLocalFloor.Text =="")
	{
		strErr+="LocalFloor不能为空!\\n";	
	}
	if(this.txtRoomTrait.Text =="")
	{
		strErr+="RoomTrait不能为空!\\n";	
	}
	if(!PageValidate.IsDecimal(txtBreakfastPrice1.Text))
	{
		strErr+="BreakfastPrice1不是数字!\\n";	
	}
	if(!PageValidate.IsDecimal(txtBreakfastPrice2.Text))
	{
		strErr+="BreakfastPrice2不是数字!\\n";	
	}
	if(!PageValidate.IsDecimal(txtArea.Text))
	{
		strErr+="Area不是数字!\\n";	
	}
	if(!PageValidate.IsDecimal(txtAddBedPrice.Text))
	{
		strErr+="AddBedPrice不是数字!\\n";	
	}
	if(!PageValidate.IsNumber(txtRoomAmount.Text))
	{
		strErr+="RoomAmount不是数字!\\n";	
	}
	if(this.txtRemark.Text =="")
	{
		strErr+="Remark不能为空!\\n";	
	}

	if(strErr!="")
	{
		MessageBox.Show(this,strErr);
		return;
	}
	decimal Price=decimal.Parse(this.txtPrice.Text);
	decimal CashPrice=decimal.Parse(this.txtCashPrice.Text);
	string HasBreakfast=this.txtHasBreakfast.Text;
	string BedType=this.txtBedType.Text;
	string HasInternet=this.txtHasInternet.Text;
	string LocalFloor=this.txtLocalFloor.Text;
	string RoomTrait=this.txtRoomTrait.Text;
	decimal BreakfastPrice1=decimal.Parse(this.txtBreakfastPrice1.Text);
	decimal BreakfastPrice2=decimal.Parse(this.txtBreakfastPrice2.Text);
	decimal Area=decimal.Parse(this.txtArea.Text);
	decimal AddBedPrice=decimal.Parse(this.txtAddBedPrice.Text);
	int RoomAmount=int.Parse(this.txtRoomAmount.Text);
	string Remark=this.txtRemark.Text;


	Maticsoft.Model.HotelRoomPrice model=new Maticsoft.Model.HotelRoomPrice();
	model.Price=Price;
	model.CashPrice=CashPrice;
	model.HasBreakfast=HasBreakfast;
	model.BedType=BedType;
	model.HasInternet=HasInternet;
	model.LocalFloor=LocalFloor;
	model.RoomTrait=RoomTrait;
	model.BreakfastPrice1=BreakfastPrice1;
	model.BreakfastPrice2=BreakfastPrice2;
	model.Area=Area;
	model.AddBedPrice=AddBedPrice;
	model.RoomAmount=RoomAmount;
	model.Remark=Remark;
	Maticsoft.BLL.HotelRoomPrice bll=new Maticsoft.BLL.HotelRoomPrice();
	bll.Update(model);
		}

    }
}

⌨️ 快捷键说明

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