//添加 protected void Button1_Click(object sender, EventArgs e) { string uid = this.txtId.Text; string uname = this.txtName.Text; string jf = this.txtJf.Text; QPS.NEW.Model.Integral Mgral = new QPS.NEW.Model.Integral(); //Mgral.UserID = uid; //Mgral.Content = Convert.ToInt32(jf); //Mgral.CreateTime = DateTime.Now; Mgral.UserID = Convert.ToInt32(uid); Mgral.TotalMoney = Convert.ToInt32(jf); QPS.NEW.BLL.Integral Bin = new QPS.NEW.BLL.Integral(); int i = Bin.Add(Mgral); if (i >= 0) { Response.Write("<script>alert('积分添加成功!!');window.location.href = 'UserInfo.aspx';</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 Button1_Click(object sender, EventArgs e) { string uid = this.txtId.Text; string uname = this.txtName.Text; string jf = this.txtJf.Text; QPS.NEW.Model.Integral Mgral = new QPS.NEW.Model.Integral(); //Mgral.UserID = uid; //Mgral.Content = Convert.ToInt32(jf); //Mgral.CreateTime = DateTime.Now; Mgral.UserID = Convert.ToInt32(uid); Mgral.TotalMoney = Convert.ToInt32(jf); QPS.NEW.BLL.Integral Bin = new QPS.NEW.BLL.Integral(); int i=Bin.Add(Mgral); if (i >= 0) { Response.Write("<script>alert('积分添加成功!!');window.location.href = 'UserInfo.aspx';</script>"); } else { Response.Write("<script>alert('积分添加失败!!');</script>"); } }
//查询 protected void Button1_Click(object sender, EventArgs e) { string name = this.txlogin.Text; QPS.NEW.BLL.Integral intgl = new QPS.NEW.BLL.Integral(); ds = intgl.SelectByName(name); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
public void Bind() { string tempUserID = Convert.ToString(Request["userid"]); QPS.NEW.BLL.Integral Ig = new QPS.NEW.BLL.Integral(); //ds = Ig.SelectByJfxq(" where userid=" + tempUserID + ""); ds = Ig.SelectByJfxq(tempUserID); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
public void BindShow() { DataSet dse = new DataSet(); QPS.NEW.BLL.Integral rm = new QPS.NEW.BLL.Integral(); dse = rm.GetList(" UserID =" + tempID + " "); this.txtName.Text = dse.Tables[0].Rows[0]["UserID"].ToString(); //this.txtTime.Text = dse.Tables[0].Rows[0]["CreateTime"].ToString(); this.txtJiFen.Text = dse.Tables[0].Rows[0]["TotalMoney"].ToString(); //this.txtRoom.Text = dse.Tables[0].Rows[0]["RoomId"].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.Integral intgl = new QPS.NEW.BLL.Integral(); ds = intgl.Select(pageSize, currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = intgl.GetCount(); dgExamProj.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 dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { string m_commandName = e.CommandName.ToString(); string m_commandArg = e.CommandArgument.ToString(); switch (m_commandName) { case "editItem"://修改 this.Bind(); break; case "delete"://删除 QPS.NEW.BLL.Integral il = new QPS.NEW.BLL.Integral(); il.Delete(Convert.ToInt32(m_commandArg)); this.Bind(); break; case "JiFen"://积分 Response.Redirect("Jfxq.aspx?userid=" + m_commandArg); break; } }
protected void bntUpdate_Click(object sender, EventArgs e) { string id = Request["ID"].ToString(); string jifen = this.txtJiFen.Text; QPS.NEW.Model.Integral Mro = new QPS.NEW.Model.Integral(); //Mro.Id = Convert.ToInt32(id); //Mro.Content = Convert.ToInt32(jifen); Mro.UserID = Convert.ToInt32(id); Mro.TotalMoney = Convert.ToInt32(jifen); QPS.NEW.BLL.Integral rm = new QPS.NEW.BLL.Integral(); int i =Convert.ToInt32( rm.UpdateContent(Mro)); if (i >= -1) { Response.Write("<script>alert('修改成功!!');window.location.href = 'Jfgl.aspx';</script>"); } else { Response.Write("<script>alert('修改失败!!');</script>"); } }
protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { string m_commandName = e.CommandName.ToString(); string m_commandArg = e.CommandArgument.ToString(); switch (m_commandName) { case "editItem": //修改 this.Bind(); break; case "delete": //删除 QPS.NEW.BLL.Integral il = new QPS.NEW.BLL.Integral(); il.Delete(Convert.ToInt32(m_commandArg)); this.Bind(); break; case "JiFen": //积分 Response.Redirect("Jfxq.aspx?userid=" + m_commandArg); break; } }
protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Update") { //Label lab = ((Label)e.Item.FindControl("lblPack")); Response.Redirect("JfXiuGai.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "delete") { string id = e.CommandArgument.ToString(); QPS.NEW.BLL.Integral Binte = new QPS.NEW.BLL.Integral(); try { Binte.DeleteByUid(Convert.ToInt32(id)); Bind(); //Response.Redirect("Jfgl.aspx?id=" + e.CommandArgument.ToString()); } catch (Exception ex) { } } }
protected void bntUpdate_Click(object sender, EventArgs e) { string id = Request["ID"].ToString(); string jifen = this.txtJiFen.Text; QPS.NEW.Model.Integral Mro = new QPS.NEW.Model.Integral(); //Mro.Id = Convert.ToInt32(id); //Mro.Content = Convert.ToInt32(jifen); Mro.UserID = Convert.ToInt32(id); Mro.TotalMoney = Convert.ToInt32(jifen); QPS.NEW.BLL.Integral rm = new QPS.NEW.BLL.Integral(); int i = Convert.ToInt32(rm.UpdateContent(Mro)); if (i >= -1) { Response.Write("<script>alert('修改成功!!');window.location.href = 'Jfgl.aspx';</script>"); } else { Response.Write("<script>alert('修改失败!!');</script>"); } }
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(); }