protected void btnCreate_Click(object sender, EventArgs e) { try { QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room Mroom = Broom.GetModel(roomid); if (this.fulImg.FileName == "") { //this.lblMessage.Text = "<font color=#FF0000>请选择上传的图片!</font>"; this.fulImg.Focus(); return; } if (txfName.Value == string.Empty) { Response.Write("<script>alert('用户名不能为空,请重新输入')</script>"); return; } if (txfRoomPrice.Value == string.Empty) { Response.Write("<script>alert('请重新输入房间价格')</script>"); return; } if (txfAddress.Value == string.Empty) { Response.Write("<script>alert('地址不能为空,请重新输入')</script>"); return; } if (txfArea.Value == string.Empty) { Response.Write("<script>alert('地区不能为空,请重新输入')</script>"); return; } if (txfContent.Value == string.Empty) { Response.Write("<script>alert('内容不能为空,请重新输入')</script>"); return; } if (txfRoomType.Value == string.Empty) { Response.Write("<script>alert('房间类型不能为空,请重新输入')</script>"); return; } Mroom.OwnerID = ownerid; Mroom.Address = txfAddress.Value; Mroom.Are = txfArea.Value; Mroom.Content = txfContent.Value.Length > 100 ? txfContent.Value.Substring(0, 100) : txfContent.Value; Mroom.Name = txfName.Value; Mroom.RoomPrice = Convert.ToDecimal(txfRoomPrice.Value); Mroom.RoomState = Convert.ToInt32(txfRoomType.Value); Mroom.ImagePath = Upload(fulImg); Broom.Update(Mroom); Response.Write("<script>alert('修改棋牌室成功!')</script>"); Response.Write("<script>window.close()</script>"); } catch (Exception ex) { Response.Write("<script>alert('修改棋牌室失败!')</script>"); return; } }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { string name = this.txtName.Text; string Type = this.txtType.Text; QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); ds = rm.GetList(" Name='" + name + "' or RoomType='" + Type + "'"); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
//查询(价格 地域) protected void Button3_Click(object sender, EventArgs e) { string Price = this.TextPrice.Text; string Are = this.TextAre.Text; QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); ds = rm.GetList(" RoomPrice='" + Price + "' or Are='" + Are + "'"); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
public DataTable databind() { DataTable dt = new DataTable(); QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Room BRoom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List <QPS.NEW.Model.Room> roomList = new List <QPS.NEW.Model.Room>(); List <QPS.NEW.Model.Orderform> orderList = new List <QPS.NEW.Model.Orderform>(); List <QPS.NEW.Model.Users> userList = new List <QPS.NEW.Model.Users>(); DataColumn dc0 = dt.Columns.Add("订单编号", typeof(int)); DataColumn dc1 = dt.Columns.Add("棋牌室名称", typeof(string)); DataColumn dc2 = dt.Columns.Add("用户", typeof(string)); DataColumn dc3 = dt.Columns.Add("酒水费", typeof(float)); DataColumn dc4 = dt.Columns.Add("是否有效", typeof(string)); dc0.ReadOnly = true; dc1.ReadOnly = true; dc2.ReadOnly = true; DataSet dsUser = user.GetList("Username='******'"); uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); //获取RoomID DataSet dsRoom = BRoom.GetList("OwnerID='" + uid + "' "); for (int i = 0; i < dsRoom.Tables[0].Rows.Count; i++) { int roomid = Convert.ToInt32(dsRoom.Tables[0].Rows[i]["Id"]); QPS.NEW.Model.Room r = BRoom.GetModel(roomid); DataSet dsOrder = Border.GetList("Roomid='" + roomid + "' and IsDelete=0"); if (dsOrder.Tables[0].Rows.Count == 0) { continue; } for (int j = 0; j < dsOrder.Tables[0].Rows.Count; j++) { DataRow dr = dt.NewRow(); dr[1] = r.Name; //订单ID int orderid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Id"]); dr[0] = orderid; int userid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Userid"]); string username = u.GetModel(userid).Username; dr[2] = username; dr[3] = dsOrder.Tables[0].Rows[j]["Beveragecost"]; dr[4] = dsOrder.Tables[0].Rows[j]["RoomType"]; dt.Rows.Add(dr); } } return(dt); }
private void GetRecommendRoom() { string tempstr = string.Empty; QPS.NEW.BLL.Room room = new QPS.NEW.BLL.Room(); DataTable dt = room.GetDataTableList("select top 50 * from Room where IfRecommend=1 order by id desc"); if (dt!=null) { for (int i = 0; i < dt.Rows.Count;i++ ) { tempstr += "<li><span><a href=\"RoomDetail.aspx?id=" + dt.Rows[i]["id"].ToString() + "\"><img src=\"/" + dt.Rows[i]["ImagePath"].ToString() + "\" alt=\"" + dt.Rows[i]["Name"].ToString() + "\"></a></span><p><a href=\"RoomDetail.aspx?id=" + dt.Rows[i]["id"].ToString() + "\">" + dt.Rows[i]["Name"].ToString() + "</a></p></li>\r\n"; } } this.RecommendRoom.Text = tempstr; }
protected void Page_Load(object sender, EventArgs e) { orderid =Convert.ToInt32(Request.QueryString["id"]); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform Morder = Border.GetModel(orderid); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Room r = new QPS.NEW.BLL.Room(); int roomid=(int) Morder.Roomid; int userid =(int) Morder.Userid; txfRoomName.Value = r.GetModel(roomid).Name; txfUserName.Value = u.GetModel(userid).Username; //txfBeverageCost.Text =Border.GetModel(orderid).Beveragecost.ToString(); txfOrderId.Value = orderid.ToString(); }
public DataTable databind() { DataTable dt = new DataTable(); QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Room BRoom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>(); List<QPS.NEW.Model.Orderform> orderList = new List<QPS.NEW.Model.Orderform>(); List<QPS.NEW.Model.Users> userList = new List<QPS.NEW.Model.Users>(); DataColumn dc0 = dt.Columns.Add("订单编号", typeof(int)); DataColumn dc1 = dt.Columns.Add("棋牌室名称", typeof(string)); DataColumn dc2 = dt.Columns.Add("用户", typeof(string)); DataColumn dc3 = dt.Columns.Add("酒水费", typeof(float)); DataColumn dc4 = dt.Columns.Add("是否有效",typeof(string)); dc0.ReadOnly = true; dc1.ReadOnly = true; dc2.ReadOnly = true; DataSet dsUser = user.GetList("Username='******'"); uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); //获取RoomID DataSet dsRoom = BRoom.GetList("OwnerID='"+uid+"' "); for (int i = 0; i < dsRoom.Tables[0].Rows.Count; i++) { int roomid =Convert.ToInt32(dsRoom.Tables[0].Rows[i]["Id"]); QPS.NEW.Model.Room r = BRoom.GetModel(roomid); DataSet dsOrder = Border.GetList("Roomid='" + roomid + "' and IsDelete=0"); if (dsOrder.Tables[0].Rows.Count == 0) continue; for (int j = 0; j < dsOrder.Tables[0].Rows.Count; j++) { DataRow dr = dt.NewRow(); dr[1] = r.Name; //订单ID int orderid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Id"]); dr[0] = orderid; int userid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Userid"]); string username= u.GetModel(userid).Username; dr[2]=username; dr[3] = dsOrder.Tables[0].Rows[j]["Beveragecost"]; dr[4]=dsOrder.Tables[0].Rows[j]["RoomType"]; dt.Rows.Add(dr); } } return dt; }
protected void Page_Load(object sender, EventArgs e) { orderid = Convert.ToInt32(Request.QueryString["id"]); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform Morder = Border.GetModel(orderid); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Room r = new QPS.NEW.BLL.Room(); int roomid = (int)Morder.Roomid; int userid = (int)Morder.Userid; txfRoomName.Value = r.GetModel(roomid).Name; txfUserName.Value = u.GetModel(userid).Username; //txfBeverageCost.Text =Border.GetModel(orderid).Beveragecost.ToString(); txfOrderId.Value = orderid.ToString(); }
//绑定 public void Bind() { int currentpage = Convert.ToInt32(Request["CurrentPage"]); int check = 1; currentpage = (currentpage < 1) ? 1 : currentpage; if (this.Pager1.CurrentIndex > 0) { currentpage = this.Pager1.CurrentIndex; } int pageSize = this.Pager1.PageSize; QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); ds = rm.Select(pageSize, currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = rm.GetCount(); dgExamProj.DataBind(); }
private void GetRecommendRoom() { string tempstr = string.Empty; QPS.NEW.BLL.Room room = new QPS.NEW.BLL.Room(); DataTable dt = room.GetDataTableList("select top 50 * from Room where IfRecommend=1 order by id desc"); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { tempstr += "<li><span><a href=\"RoomDetail.aspx?id=" + dt.Rows[i]["id"].ToString() + "\"><img src=\"/" + dt.Rows[i]["ImagePath"].ToString() + "\" alt=\"" + dt.Rows[i]["Name"].ToString() + "\"></a></span><p><a href=\"RoomDetail.aspx?id=" + dt.Rows[i]["id"].ToString() + "\">" + dt.Rows[i]["Name"].ToString() + "</a></p></li>\r\n"; } } this.RecommendRoom.Text = tempstr; }
protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = gdvPersonnalOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID=Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); DataSet dsorder= Border.GetList("Roomid ='" + ID + "'"); int Oid = Convert.ToInt32(dsorder.Tables[0].Rows[0]["Id"]); Border.Delete(Oid); QPS.NEW.Model.Room r = Broom.GetModel(ID); r.RoomState = 0; Broom.Update(r); databind(gdvPersonnalOrder); }
protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = this.gdvRoom.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); if (Broom.GetModel(ID).RoomState == 1)//说明此房间被预定需要从订单中删除 { DataSet dsOrder = Border.GetList("Roomid='" + ID + "'"); int Oid = Convert.ToInt32(dsOrder.Tables[0].Rows[0]["Id"]); Border.Delete(Oid); } Broom.Delete(ID); databind(gdvRoom); }
public void databind(GridView gdv) { QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>(); if (Session["username"] != null) { string uname = Session["username"].ToString(); DataSet dsUser = user.GetList("Username='******'"); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); roomList = Broom.GetModelList("OwnerID='" + uid + "'"); } gdv.DataSource = Gettable(roomList); gdv.DataBind(); }
public void databind(GridView gdv) { QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List <QPS.NEW.Model.Room> roomList = new List <QPS.NEW.Model.Room>(); if (Session["username"] != null) { string uname = Session["username"].ToString(); DataSet dsUser = user.GetList("Username='******'"); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); roomList = Broom.GetModelList("OwnerID='" + uid + "'"); } gdv.DataSource = Gettable(roomList); gdv.DataBind(); }
public void BindShow() { DataSet dse = new DataSet(); QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); dse = rm.GetList(" id =" + tempID + " "); this.txName.Text = dse.Tables[0].Rows[0]["Name"].ToString(); this.ddlCat.SelectedValue = dse.Tables[0].Rows[0]["roomType"].ToString(); this.Textprice.Text = dse.Tables[0].Rows[0]["roomPrice"].ToString(); this.TextAre.Text = dse.Tables[0].Rows[0]["Are"].ToString(); this.TextAddress.Text = dse.Tables[0].Rows[0]["Address"].ToString(); //图片 //this.upfile.Text = dse.Tables[0].Rows[0]["imagePath"].ToString(); this.Photo.Text = dse.Tables[0].Rows[0]["imagePath"].ToString(); this.Rec.Checked = Convert.ToInt32(dse.Tables[0].Rows[0]["IfRecommend"]) == 0 ? true : false; this.FileContent.Value = dse.Tables[0].Rows[0]["Content"].ToString(); }
/// <summary> /// 生成事件时激发 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { //两个参数 1.当前订单ID,2.当前订单状态 string strArgument = e.CommandArgument.ToString(); if (e.CommandName == "delete") { string id = e.CommandArgument.ToString(); QPS.NEW.BLL.Room pt = new QPS.NEW.BLL.Room(); try { pt.Delete(Convert.ToInt32(id)); Bind(); } catch (Exception ex) { } } if (e.CommandName == "LinkTo") { //Label lab = ((Label)e.Item.FindControl("lblPack")); Response.Redirect("RoomUpdate.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "changStart") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); rm.UpdateRecommend(id, type, DateTime.Now); Bind(); } if (e.CommandName == "Examine") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string examine = Argument[1].ToString(); NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); rm.UpdateExamine(id, examine, DateTime.Now); Bind(); } }
protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = gdvPersonnalOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); DataSet dsorder = Border.GetList("Roomid ='" + ID + "'"); int Oid = Convert.ToInt32(dsorder.Tables[0].Rows[0]["Id"]); Border.Delete(Oid); QPS.NEW.Model.Room r = Broom.GetModel(ID); r.RoomState = 0; Broom.Update(r); databind(gdvPersonnalOrder); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["username"] != null) { roomid = Convert.ToInt32(Request.QueryString["roomid"]); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room Mroom = Broom.GetModel(roomid); ownerid = Mroom.OwnerID; txfAddress.Value = Mroom.Address; txfArea.Value = Mroom.Are; txfContent.Value = Mroom.Content; txfName.Value = Mroom.Name; txfRoomPrice.Value = Mroom.RoomPrice.ToString(); txfRoomType.Value = Mroom.RoomState.ToString(); } } }
/// <summary> /// 生成事件时激发 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { //两个参数 1.当前订单ID,2.当前订单状态 string strArgument = e.CommandArgument.ToString(); if (e.CommandName == "delete") { string id = e.CommandArgument.ToString(); QPS.NEW.BLL.Room pt = new QPS.NEW.BLL.Room(); try { pt.Delete(Convert.ToInt32(id)); Bind(); } catch (Exception ex) { } } if (e.CommandName == "LinkTo") { //Label lab = ((Label)e.Item.FindControl("lblPack")); Response.Redirect("RoomUpdate.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "changStart") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); rm.UpdateRecommend(id, type,DateTime.Now); Bind(); } if (e.CommandName == "Examine") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string examine = Argument[1].ToString(); NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); rm.UpdateExamine(id, examine, DateTime.Now); Bind(); } }
protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "LinkTo")//修改 { Response.Redirect("PosterUpdate.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "delete") { string id = e.CommandArgument.ToString(); QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); try { rm.Delete(Convert.ToInt32(id)); Bind(); } catch (Exception ex) { } } }
public DataTable Gettable() { DataTable dt = new DataTable(); QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral(); List <QPS.NEW.Model.Room> roomList = new List <QPS.NEW.Model.Room>(); List <QPS.NEW.Model.Orderform> orderlist = new List <QPS.NEW.Model.Orderform>(); //创建新列 //DataColumn dc0 = dt.Columns.Add("积分编号", typeof(int)); DataColumn dc1 = dt.Columns.Add("用户名称", typeof(string)); //DataColumn dc2 = dt.Columns.Add("棋牌室名称", typeof(string)); DataColumn dc3 = dt.Columns.Add("积分", typeof(string)); //DataColumn dc4 = dt.Columns.Add("消费时间", typeof(string)); if (Session["username"] != null) { //获取Uid string uname = Session["username"].ToString(); DataSet dsUser = user.GetList("Username='******'"); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); QPS.NEW.Model.Integral mInt = new NEW.Model.Integral(); mInt = Bint.GetModel(uid); if (mInt != null) { DataRow dr = dt.NewRow(); dr[0] = uname; dr[1] = mInt.TotalMoney.ToString(); dt.Rows.Add(dr); } } return(dt); }
public DataTable Gettable() { DataTable dt = new DataTable(); QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise(); QPS.NEW.BLL.Users u = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral(); List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>(); List<QPS.NEW.Model.Orderform> orderlist = new List<QPS.NEW.Model.Orderform>(); //创建新列 //DataColumn dc0 = dt.Columns.Add("积分编号", typeof(int)); DataColumn dc1 = dt.Columns.Add("用户名称", typeof(string)); //DataColumn dc2 = dt.Columns.Add("棋牌室名称", typeof(string)); DataColumn dc3 = dt.Columns.Add("积分", typeof(string)); //DataColumn dc4 = dt.Columns.Add("消费时间", typeof(string)); if (Session["username"] != null) { //获取Uid string uname = Session["username"].ToString(); DataSet dsUser = user.GetList("Username='******'"); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]); QPS.NEW.Model.Integral mInt = new NEW.Model.Integral(); mInt = Bint.GetModel(uid); if (mInt != null) { DataRow dr = dt.NewRow(); dr[0] = uname; dr[1] = mInt.TotalMoney.ToString(); dt.Rows.Add(dr); } } return dt; }
//修改 protected void btnupdate_Click(object sender, EventArgs e) { // string ID = this.RoomID.Text.ToString().Trim(); string id = Request["ID"].ToString(); string name = this.txName.Text; //棋牌室名称 string type = this.ddlCat.SelectedValue.ToString(); //棋牌室类型 //string type = this.ddlCat.Text; string Price = this.Textprice.Text; //棋牌室价格 string are = this.TextAre.Text; //棋牌室地域 string address = this.TextAddress.Text; //祥细地址 string imagePath = this.Photo.Text; //图片地址 string content = this.FileContent.Value; //祥细介绍 QPS.NEW.Model.Room Mro = new QPS.NEW.Model.Room(); Mro.Id = Convert.ToInt32(id); Mro.Name = name; Mro.RoomType = type; Mro.RoomPrice = Convert.ToDecimal(Price); Mro.Are = are; Mro.Address = address; Mro.ImagePath = imagePath; Mro.IfRecommend = this.Rec.Checked ? 0 : 1; Mro.Content = content; Mro.RecommendTime = DateTime.Now.ToString(); QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); //rm.Add(Mro); if (rm.Update(Mro)) { Response.Write("<script>alert('修改成功!!');</script>"); } else { Response.Write("<script>alert('修改失败!!');</script>"); } }
//确定 protected void btnsure_Click(object sender, EventArgs e) { string name = this.txName.Text; //棋牌室名称 string type = this.ddlCat.Text; //棋牌室类型 string Price = this.Textprice.Text; //棋牌室价格 string are = this.Textprice.Text; //棋牌室地域 string address = this.Textprice.Text; //祥细地址 string imagePath = this.Textprice.Text; //图片地址 string content = this.Textprice.Text; //祥细介绍 string IfR = ""; if (this.Rec.Checked) { IfR = "0"; } QPS.NEW.Model.Room Mro = new QPS.NEW.Model.Room(); Mro.Name = name; Mro.RoomType = type; Mro.RoomPrice = Convert.ToDecimal(Price); Mro.Are = are; Mro.Address = address; Mro.ImagePath = imagePath; Mro.Content = content; Mro.IfRecommend = Convert.ToInt32(IfR); QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); //rm.Add(Mro); int i = rm.Add(Mro); if (i > 0) { Response.Write("<script>alert('添加成功!!');</script>"); } else { Response.Write("<script>alert('添加失败!!');</script>"); } }
public void databind(GridView gdv) { QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>(); if (Session["username"] != null) { string uname = Session["username"].ToString(); DataSet dsUser = user.GetList(uname); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]); List<QPS.NEW.Model.Orderform> orderlist = Border.GetModelList("Userid='" + uid + "'"); foreach (QPS.NEW.Model.Orderform o in orderlist) { int roomid = (int)o.Roomid; roomList.Add(Broom.GetModel(roomid)); } } gdv.DataSource = Gettable(roomList); gdv.DataBind(); }
//确定 protected void btnsure_Click(object sender, EventArgs e) { string name = this.txName.Text; //棋牌室名称 string type = this.ddlCat.Text; //棋牌室类型 string Price = this.Textprice.Text; //棋牌室价格 string are = this.Textprice.Text; //棋牌室地域 string address = this.Textprice.Text; //祥细地址 string imagePath = this.Textprice.Text; //图片地址 string content = this.Textprice.Text;//祥细介绍 string IfR = ""; if(this.Rec.Checked) { IfR = "0"; } QPS.NEW.Model.Room Mro = new QPS.NEW.Model.Room(); Mro.Name = name; Mro.RoomType = type; Mro.RoomPrice = Convert.ToDecimal(Price); Mro.Are = are; Mro.Address = address; Mro.ImagePath = imagePath; Mro.Content = content; Mro.IfRecommend =Convert.ToInt32(IfR); QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room(); //rm.Add(Mro); int i = rm.Add(Mro); if (i > 0) { Response.Write("<script>alert('添加成功!!');</script>"); } else { Response.Write("<script>alert('添加失败!!');</script>"); } }
public void databind(GridView gdv) { QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); List <QPS.NEW.Model.Room> roomList = new List <QPS.NEW.Model.Room>(); if (Session["username"] != null) { string uname = Session["username"].ToString(); DataSet dsUser = user.GetList(uname); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]); List <QPS.NEW.Model.Orderform> orderlist = Border.GetModelList("Userid='" + uid + "'"); foreach (QPS.NEW.Model.Orderform o in orderlist) { int roomid = (int)o.Roomid; roomList.Add(Broom.GetModel(roomid)); } } gdv.DataSource = Gettable(roomList); gdv.DataBind(); }
protected void gdvOrder_RowCommand(object sender, GridViewCommandEventArgs e) { ////得到单位编号 //string rowUpdate = this.gdvOrder.DataKeys[].Values[0].ToString(); ////转换为整数 //int ID = Convert.ToInt32(rowUpdate); //QPS.BLL.Orderform Border = new QPS.BLL.Orderform(); //QPS.Model.Orderform Morder = new QPS.Model.Orderform(); //Morder.Id = ID; //Morder.Beveragecost = (decimal)this.gdvOrder.DataKeys[e.RowIndex].Values[3]; //Border.Update(Morder); //gdvOrder.DataSource = databind(); //gdvOrder.DataBind(); string strArgument = e.CommandArgument.ToString(); if (e.CommandName == "IsValidate") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); int ok; if (type == "0") { ok = 1; } else { ok = 0; } QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform order = Border.GetModel(Convert.ToInt32(id)); Border.UpdateType(id,type); //订单有效 则加上积分 否则 如果存在积分 则删除 QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral(); QPS.NEW.Model.Integral Mint = new QPS.NEW.Model.Integral(); if (Bint.GetList("OrderId='" + id + "'").Tables[0].Rows.Count > 0)//删除已有积分 { Bint.Delete(Convert.ToInt32(Bint.GetList("OrderId='" + id + "'").Tables[0].Rows[0]["Id"])); } if (ok == 1)//有效 { QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room r = Broom.GetModel(order.Roomid); //Mint.OrderId = Convert.ToInt32(id); //Mint.RoomId = order.Roomid; Mint.UserID = order.Userid; //Mint.CreateTime = order.StartTime; TimeSpan ts = (TimeSpan)(order.endTime - order.StartTime); Mint.BankMoney = Convert.ToInt32((ts.Hours * (double)r.RoomPrice)); if (order.Beveragecost != null) { Mint.BankMoney += (int)order.Beveragecost; } Bint.Add(Mint); } } gdvOrder.DataSource = databind(); gdvOrder.DataBind(); }
protected void gdvOrder_RowCommand(object sender, GridViewCommandEventArgs e) { ////得到单位编号 //string rowUpdate = this.gdvOrder.DataKeys[].Values[0].ToString(); ////转换为整数 //int ID = Convert.ToInt32(rowUpdate); //QPS.BLL.Orderform Border = new QPS.BLL.Orderform(); //QPS.Model.Orderform Morder = new QPS.Model.Orderform(); //Morder.Id = ID; //Morder.Beveragecost = (decimal)this.gdvOrder.DataKeys[e.RowIndex].Values[3]; //Border.Update(Morder); //gdvOrder.DataSource = databind(); //gdvOrder.DataBind(); string strArgument = e.CommandArgument.ToString(); if (e.CommandName == "IsValidate") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); int ok; if (type == "0") { ok = 1; } else { ok = 0; } QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform order = Border.GetModel(Convert.ToInt32(id)); Border.UpdateType(id, type); //订单有效 则加上积分 否则 如果存在积分 则删除 QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral(); QPS.NEW.Model.Integral Mint = new QPS.NEW.Model.Integral(); if (Bint.GetList("OrderId='" + id + "'").Tables[0].Rows.Count > 0) //删除已有积分 { Bint.Delete(Convert.ToInt32(Bint.GetList("OrderId='" + id + "'").Tables[0].Rows[0]["Id"])); } if (ok == 1)//有效 { QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room r = Broom.GetModel(order.Roomid); //Mint.OrderId = Convert.ToInt32(id); //Mint.RoomId = order.Roomid; Mint.UserID = order.Userid; //Mint.CreateTime = order.StartTime; TimeSpan ts = (TimeSpan)(order.endTime - order.StartTime); Mint.BankMoney = Convert.ToInt32((ts.Hours * (double)r.RoomPrice)); if (order.Beveragecost != null) { Mint.BankMoney += (int)order.Beveragecost; } Bint.Add(Mint); } } gdvOrder.DataSource = databind(); gdvOrder.DataBind(); }
protected void btnCreate_Click(object sender, EventArgs e) { try { QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room(); QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room(); if (this.fulImg.FileName == "") { //this.lblMessage.Text = "<font color=#FF0000>请选择上传的图片!</font>"; this.fulImg.Focus(); return; } if (txfName.Value == string.Empty) { Response.Write("<script>alert('用户名不能为空,请重新输入')</script>"); return; } if (txfRoomPrice.Value == string.Empty) { Response.Write("<script>alert('请重新输入房间价格')</script>"); return; } if (txfAddress.Value == string.Empty) { Response.Write("<script>alert('地址不能为空,请重新输入')</script>"); return; } if (txfArea.Text == string.Empty) { Response.Write("<script>alert('地区不能为空,请重新输入')</script>"); return; } if (txfContent.Value == string.Empty) { Response.Write("<script>alert('内容不能为空,请重新输入')</script>"); return; } if (txfRoomType.Text == string.Empty) { Response.Write("<script>alert('房间类型不能为空,请重新输入')</script>"); return; } Mroom.Name = txfName.Value; Mroom.RoomPrice = Convert.ToDecimal(txfRoomPrice.Value); Mroom.RoomState = 0; Mroom.IfRecommend =1; Mroom.Address = txfAddress.Value; Mroom.Are = txfArea.Text; Mroom.Content = txfContent.Value.Length > 100 ? txfContent.Value.Substring(0, 100) : txfContent.Value; Mroom.RoomType = txfRoomType.Text; Mroom.OwnerID = userid; Mroom.ImagePath = Upload(fulImg); Mroom.Examine = 0; Broom.Add(Mroom); Response.Write("<script>alert('添加棋牌室成功!')</script>"); Response.Write("<script>window.close()</script>"); } catch (Exception ex) { Response.Write("<script>alert('添加棋牌室失败!')</script>"); return; } }