//生成事件时 protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { string strArgument = e.CommandArgument.ToString(); if (e.CommandName == "delete") { string id = e.CommandArgument.ToString(); QPS.NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise(); try { ep.DeleteById(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 == "Ifchecked") { string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string examine = Argument[1].ToString(); NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise(); ep.UpdateChecked(id, examine); Bind(); } }
protected void btnModPwd_Click(object sender, EventArgs e) { try { QPS.NEW.BLL.Enterprise Buser = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Enterprise Muser =Buser.GetModel(userid); // === modified by jeffery //if (txfOriginalPwd.Value != Buser.GetModel(userid).Password) 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 = txfModPwd.Value; Buser.Update(Muser); Response.Write("<script>alert('密码修改成功! ')</script>"); } catch (Exception ex) { Response.Write("<script>alert('修改失败!')</script>"); } }
protected void btnModPwd_Click(object sender, EventArgs e) { try { QPS.NEW.BLL.Enterprise Buser = new QPS.NEW.BLL.Enterprise(); QPS.NEW.Model.Enterprise Muser = Buser.GetModel(userid); // === modified by jeffery //if (txfOriginalPwd.Value != Buser.GetModel(userid).Password) 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 = txfModPwd.Value; Buser.Update(Muser); Response.Write("<script>alert('密码修改成功! ')</script>"); } catch (Exception ex) { Response.Write("<script>alert('修改失败!')</script>"); } }
//查询 protected void Button1_Click(object sender, EventArgs e) { string name = this.txlinkman.Text; string xingm = this.txlogin.Text; QPS.NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise(); ds = ep.GetList(" Username='******' or Nickname='" + xingm + "'"); 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 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); }
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; }
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.Enterprise ep = new QPS.NEW.BLL.Enterprise(); ds = ep.Select(pageSize, currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = ep.GetCount(); dgExamProj.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 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 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 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"); } } }