//修改 protected void Button1_Click(object sender, EventArgs e) { int id = Convert.ToInt32(this.UserID.Value); string name = this.TextUsername.Text; //string password = this.TextPassword.Text; string phone = this.TextPhone.Text; string address = this.TextAddress.Text; string mail = this.TextMail.Text; //string type = this.TextUsertype.Text; QPS.NEW.BLL.Users us = new QPS.NEW.BLL.Users(); NEW.Model.Users user = new NEW.Model.Users(); user.Id = id; user.Username = name; // user.Password = password; user.Phone = phone; user.Mail = mail; if (us.UpdateUs(user)) { Response.Write("<script>alert('修改成功!!');</script>"); } else { Response.Write("<script>alert('修改失败!!');</script>"); } }
//Username Nvarchar 会员用户名 //Password Nvarchar 会员密码 //Phone Nvarchar 会员移动电话 //Address Nvarchar 用户名 //Mail Nvarchar 邮箱地址 //Usertype Int 会员类型 protected void Button1_Click(object sender, EventArgs e) { string name = this.TextUsername.Text; string pwd = this.TextPassword.Text; string phone = this.TextPhone.Text; string address = this.TextAddress.Text; string mail = this.TextMail.Text; string type = this.TextUsertype.Text; QPS.NEW.Model.Users us = new QPS.NEW.Model.Users(); us.Username = name; us.Password = pwd; us.Phone = phone; us.Address = address; us.Mail = mail; us.Usertype = int.Parse(type); QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); user.Add(us); int i = user.Add(us); if (i > 0) { Response.Write("<script>alert('添加成功!!');</script>"); } else { Response.Write("<script>alert('添加失败!!');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral(); if (Session["username"] != null) { //获取Uid string uname = Session["username"].ToString(); DataSet dsUser = user.GetList(uname); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]); DataSet dsInt = Bint.GetListlocalize("UserID='" + uid + "'"); GridView1.DataSource = dsInt; GridView1.DataBind(); // === modified by jeffery DataTable dt = Bint.GetSum(uid).Tables[0]; if (dt == null || dt.Rows.Count <= 0 || dt.Rows[0][0].ToString().Trim() == "") { lblSum.Text = " 0"; } else { lblSum.Text = Bint.GetSum(uid).Tables[0].Rows[0][0].ToString(); } // === } } }
protected void imgbtn_Click(object sender, ImageClickEventArgs e) { string role = ""; string code = (string)Session["CheckCodes"]; if (code == checkcode.Value) { string name = this.txtAdminname.Text; string pwd = this.txtAdminPW.Text; QPS.NEW.BLL.Users bll = new QPS.NEW.BLL.Users(); bool b = bll.Denglu(name, QPS.NEW.BLL.MD5Helper.Encode(pwd),1); if (b) { Session["admin"] = name; Response.Redirect("main.aspx"); } else { Response.Write("<script>alert('帐号或密码错误!!');</script>"); } } else { Response.Write("<script>alert('验证码输入错误!!');</script>"); } }
protected void imgbtn_Click(object sender, ImageClickEventArgs e) { string role = ""; string code = (string)Session["CheckCodes"]; if (code == checkcode.Value) { string name = this.txtAdminname.Text; string pwd = this.txtAdminPW.Text; QPS.NEW.BLL.Users bll = new QPS.NEW.BLL.Users(); bool b = bll.Denglu(name, QPS.NEW.BLL.MD5Helper.Encode(pwd), 1); if (b) { Session["admin"] = name; Response.Redirect("main.aspx"); } else { Response.Write("<script>alert('帐号或密码错误!!');</script>"); } } else { Response.Write("<script>alert('验证码输入错误!!');</script>"); } }
//手机号查询 protected void bntChaXun_Click(object sender, EventArgs e) { string phone = this.txtPhone.Text; QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); ds = user.SelectList(phone); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
protected void btnLogin_Click(object sender, EventArgs e) { string UserName = txbUserName.Text.Trim(); string UserPwd = txbPwd.Text.Trim(); QPS.NEW.BLL.Users bll = new QPS.NEW.BLL.Users(); try { if (rbtuser.Checked) { UserPwd = QPS.NEW.BLL.MD5Helper.Encode(UserPwd); if (bll.Denglu(UserName, UserPwd) && txbCode.Text.Trim().Equals(Session["code"])) { Session["username"] = UserName; Response.Redirect("MainPage.aspx", false); MainMaser m = new MainMaser(); MainPage d = new MainPage(); Hashtable t = new Hashtable(); t.Add("username", UserName); t.Add("password", UserPwd); m.hashtable = t; d.hashtable = t; } } if (rbtBusiuser.Checked) { QPS.NEW.BLL.Enterprise enter = new QPS.NEW.BLL.Enterprise(); UserPwd = QPS.NEW.BLL.MD5Helper.Encode(UserPwd); DataSet ds = enter.GetList("Username='******'and Password='******'"); if (ds.Tables[0].Rows.Count > 0 && txbCode.Text.Trim().Equals(Session["code"]) && ds.Tables[0].Rows[0]["IfChecked"].ToString() == "1") { Session["username"] = UserName; Response.Redirect("BusiMan/orderMan.aspx", false); MainMaser m = new MainMaser(); MainPage d = new MainPage(); Hashtable t = new Hashtable(); t.Add("username", UserName); t.Add("password", UserPwd); m.hashtable = t; d.hashtable = t; } } if (Session["username"] == null) { Response.Write("<script>alert(' 登录失败!')</script>"); return; } } catch (Exception ex) { Response.Write("<script>alert(' 登录失败!+" + ex.ToString() + "')</script>"); return; } }
public void BindShow() { DataSet dse = new DataSet(); QPS.NEW.BLL.Users Bus = new QPS.NEW.BLL.Users(); dse = Bus.GetList(tempID); this.txtId.Text = tempID.ToString(); this.txtName.Text = dse.Tables[0].Rows[0]["UserName"].ToString(); this.txtPhone.Text = dse.Tables[0].Rows[0]["Phone"].ToString(); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { string name = this.txlinkman.Text; string xingm = this.txlogin.Text; QPS.NEW.BLL.Users user =new QPS.NEW.BLL.Users (); ds = user.GetList(name,xingm); dgExamProj.DataSource = ds; dgExamProj.DataBind(); //AboutBox方法,Refresh方法,SetFocus方法。 }
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); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { string name = this.txlinkman.Text; string xingm = this.txlogin.Text; QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); ds = user.GetList(name, xingm); dgExamProj.DataSource = ds; dgExamProj.DataBind(); //AboutBox方法,Refresh方法,SetFocus方法。 }
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(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Leaveword Bleave= new QPS.NEW.BLL.Leaveword(); if (Session["username"] != null) { //获取Uid string uname = Session["username"].ToString(); DataSet dsUser = user.GetList(uname); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]); DataSet dsInt = Bleave.GetListLocalise("UserID='" + uid + "'"); GridView1.DataSource = dsInt; GridView1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users(); QPS.NEW.BLL.Leaveword Bleave = new QPS.NEW.BLL.Leaveword(); if (Session["username"] != null) { //获取Uid string uname = Session["username"].ToString(); DataSet dsUser = user.GetList(uname); int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]); DataSet dsInt = Bleave.GetListLocalise("UserID='" + uid + "'"); GridView1.DataSource = dsInt; GridView1.DataBind(); } } }
/// <summary> /// 绑定 /// </summary> 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.Users user = new QPS.NEW.BLL.Users(); ds = user.SelectUs(pageSize, currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = user.GetCount(); dgExamProj.DataBind(); }
/// <summary> /// 绑定 /// </summary> 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.Users user = new QPS.NEW.BLL.Users(); ds = user.SelectUs(pageSize,currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = user.GetCount(); dgExamProj.DataBind(); }
protected void btnModPwd_Click(object sender, EventArgs e) { try { // === modified bu jeffery //DataHandler.PageAction pa = new DataHandler.PageAction(); // === QPS.NEW.BLL.Users Buser = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Users Muser = Buser.GetModel(userid); // === modified by jeffery //if (pa.getStatus(pa.ModifyPwd("http://59.175.238.107:8080", Session["username"].ToString(), txfModPwd.Value, "dfd8915f711b45c78c2b15ef70528699")) != "true") //{ // Response.Write("<script>alert('修改密码失败')</script>"); // return; //} // === if (QPS.NEW.BLL.MD5Helper.Encode(txfOriginalPwd.Value) != Muser.Password) { Response.Write("<script>alert('原始密码错误,请重新输入')</script>"); return; } if (txfModPwd.Value != txfRepwd.Value) { Response.Write("<script>alert('确认密码与修改密码不一致,请重新输入')</script>"); return; } if (txfModPwd.Value == string.Empty) { Response.Write("<script>alert('确认密码不能为空,请重新输入')</script>"); return; } Muser.Password = QPS.NEW.BLL.MD5Helper.Encode(txfModPwd.Value); Muser.Usertype = 0; user.Update(Muser); Response.Write("<script>alert('密码修改成功!')</script>"); } catch (Exception ex) { Response.Write("<script>alert('修改失败!" + ex.ToString() + "')</script>"); } }
protected void btnModPwd_Click(object sender, EventArgs e) { try { // === modified bu jeffery //DataHandler.PageAction pa = new DataHandler.PageAction(); // === QPS.NEW.BLL.Users Buser = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Users Muser = Buser.GetModel(userid); // === modified by jeffery //if (pa.getStatus(pa.ModifyPwd("http://59.175.238.107:8080", Session["username"].ToString(), txfModPwd.Value, "dfd8915f711b45c78c2b15ef70528699")) != "true") //{ // Response.Write("<script>alert('修改密码失败')</script>"); // return; //} // === if (QPS.NEW.BLL.MD5Helper.Encode( txfOriginalPwd.Value) != Muser.Password) { Response.Write("<script>alert('原始密码错误,请重新输入')</script>"); return; } if (txfModPwd.Value != txfRepwd.Value) { Response.Write("<script>alert('确认密码与修改密码不一致,请重新输入')</script>"); return; } if (txfModPwd.Value == string.Empty) { Response.Write("<script>alert('确认密码不能为空,请重新输入')</script>"); return; } Muser.Password =QPS.NEW.BLL.MD5Helper.Encode( txfModPwd.Value); Muser.Usertype = 0; user.Update(Muser); Response.Write("<script>alert('密码修改成功!')</script>"); } catch (Exception ex) { Response.Write("<script>alert('修改失败!"+ex.ToString()+"')</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { if (Request["UserID"]!=null) { QPS.NEW.BLL.Users us = new QPS.NEW.BLL.Users(); string userid = Request["UserID"].ToString(); NEW.Model.Users user = us.GetModel(Convert.ToInt32(userid)); if (user!=null) { this.UserID.Value = Convert.ToString(user.Id); this.TextUsername.Text = user.Username; this.TextPhone.Text = user.Phone; this.TextAddress.Text = user.Address; this.TextMail.Text = user.Mail; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["UserID"] != null) { QPS.NEW.BLL.Users us = new QPS.NEW.BLL.Users(); string userid = Request["UserID"].ToString(); NEW.Model.Users user = us.GetModel(Convert.ToInt32(userid)); if (user != null) { this.UserID.Value = Convert.ToString(user.Id); this.TextUsername.Text = user.Username; this.TextPhone.Text = user.Phone; this.TextAddress.Text = user.Address; this.TextMail.Text = user.Mail; } } } }
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; }
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(); }
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 btnSub_Click(object sender, EventArgs e) { if (txbPhone.Text == "") { Response.Write("<script>alert('请填写手机号!')</script>"); return; } string erromsg = string.Empty; string celpattern = @"(^18\d{9}$)|(^13\d{9}$)|(^15\d{9}$)"; if (txbNum.Text == "") { Response.Write("<script>alert('请填写预定人数!')</script>"); return; } string IsNumeric = @"^[0-9]+$"; if (!System.Text.RegularExpressions.Regex.IsMatch(txbNum.Text, IsNumeric)) { Response.Write("<script>alert('请填写数字!')</script>"); return; } if (Calendar1.SelectedDate.ToString() == "" || Calendar2.SelectedDate.ToString() == "") { Response.Write("<script>alert('请填写预定预定时间!')</script>"); return; } if (txbPhone.Text != "") { if (!System.Text.RegularExpressions.Regex.IsMatch(txbPhone.Text, celpattern)) { Response.Write("<script>alert('输入的手机号有错误,请重新输入!')</script>"); return; } } try { //生成一张订单 然后 修改房间信息表的房间状态 最后添加积分信息 double starthour = Convert.ToDouble(this.dplStartTime.SelectedValue); DateTime ddd = this.Calendar1.SelectedDate; DateTime startdate = this.Calendar1.SelectedDate.AddHours(starthour); double endhour = Convert.ToDouble(this.dplEndTime.SelectedValue); DateTime enddate = this.Calendar2.SelectedDate.AddHours(endhour); if (startdate >= enddate) { Response.Write("<script>alert('起始时间不应该早于结束时间,请认真填写预定时间')</script>"); return; } Morder.Roomid = roomid; Morder.Userid = userid; Morder.StartTime = startdate; Morder.endTime = enddate; Morder.OrderNumber = txbNum.Text.Trim(); Border.Add(Morder); QPS.NEW.Model.Room r = room.GetModel(roomid); r.RoomState = 1; room.Update(r); QPS.NEW.BLL.Users Buser = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Users Muser = Buser.GetModel(userid); Muser.Phone = txbPhone.Text.Trim(); Buser.Update(Muser); Response.Write("<script>alert('预定成功!');window.location.href='MainPage.aspx'</script>"); //Response.Redirect("MainPage.aspx", false); } catch (Exception ex) { Response.Write("<script>alert('预定失败!')</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { QPS.NEW.BLL.Users Buser = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Users Uuser = new QPS.NEW.Model.Users(); QPS.NEW.BLL.Enterprise Euser = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Enterprise Muser = new QPS.NEW.Model.Enterprise(); int result = -1; string userType = Request.QueryString["type"].ToString(); string username = Request.QueryString["username"].ToString(); string address = Request.QueryString["add"].ToString(); string mail = Request.QueryString["mail"].ToString(); string pwd = Request.QueryString["pwd"].ToString(); string phone = Request.QueryString["phone"].ToString(); string nickname = Request.QueryString["nickname"].ToString(); if (userType == "user") { Uuser.Username = username; Uuser.Address = address; Uuser.Mail = mail; Uuser.Password = pwd; Uuser.Phone = phone; Uuser.Nickname = nickname; Uuser.Action = "regist"; Uuser.Sign = "48c93e18ffbe4878b344cc1749ff6dc8"; Uuser.Usertype = 0; result = Buser.Add(Uuser); if (result == 1) { Response.Write("1"); } else if (result == -1) { Response.Write("0"); } else { Response.Write("-1"); } } if (userType == "enterprise") { Muser.Username = username; Muser.Address = address; Muser.Mail = mail; Muser.Password = pwd; Muser.Phone = phone; Muser.Nickname = nickname; Muser.IfChecked = 0; result = Euser.Add(Muser); if (result == 1) { Response.Write("1"); } else if (result == -1) { Response.Write("0"); } else { Response.Write("-1"); } } }
protected void Page_Load(object sender, EventArgs e) { QPS.NEW.BLL.Users Buser = new QPS.NEW.BLL.Users(); QPS.NEW.Model.Users Uuser = new QPS.NEW.Model.Users(); QPS.NEW.BLL.Enterprise Euser = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Enterprise Muser = new QPS.NEW.Model.Enterprise(); int result = -1; string userType=Request.QueryString["type"].ToString(); string username = Request.QueryString["username"].ToString(); string address = Request.QueryString["add"].ToString(); string mail = Request.QueryString["mail"].ToString(); string pwd=Request.QueryString["pwd"].ToString(); string phone = Request.QueryString["phone"].ToString(); string nickname = Request.QueryString["nickname"].ToString(); if (userType == "user") { Uuser.Username = username; Uuser.Address = address; Uuser.Mail = mail; Uuser.Password = pwd; Uuser.Phone = phone; Uuser.Nickname = nickname; Uuser.Action = "regist"; Uuser.Sign = "48c93e18ffbe4878b344cc1749ff6dc8"; Uuser.Usertype = 0; result = Buser.Add(Uuser); if (result == 1) { Response.Write("1"); } else if (result == -1) { Response.Write("0"); } else { Response.Write("-1"); } } if (userType == "enterprise") { Muser.Username = username; Muser.Address = address; Muser.Mail = mail; Muser.Password = pwd; Muser.Phone = phone; Muser.Nickname = nickname; Muser.IfChecked = 0; result = Euser.Add(Muser); if (result == 1) { Response.Write("1"); } else if (result == -1) { Response.Write("0"); } else { Response.Write("-1"); } } }