//查询 protected void Button1_Click(object sender, EventArgs e) { string name = this.txtId.Text; string xingm = this.txtName.Text; QPS.NEW.BLL.Orderform of = new QPS.NEW.BLL.Orderform(); if (name != "" && xingm != "") { ds = of.SelectList(Convert.ToInt32(name), xingm); } else { if (name != "") { ds = of.SelectList(Convert.ToInt32(name)); } else if (xingm != "") { ds = of.SelectList(xingm); } } //ds = of.SelectList("id = '" + name + "' or (select UserName From Users where id= o.Userid) = '" + xingm + "' "); dgExamProj.DataSource = ds; dgExamProj.DataBind(); }
//查询 protected void Button3_Click(object sender, EventArgs e) { string Rname = this.TextRname.Text; //string zhuangt = this.TextType.Text; QPS.NEW.BLL.Orderform of = new QPS.NEW.BLL.Orderform(); ds = of.SelectList("(select Name from Room where id=o.roomid)= '" + Rname + "' "); 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); }
protected void gdvOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = this.gdvOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform morder = Border.GetModel(ID); morder.IsDelete = 1; Border.Update(morder); gdvOrder.DataSource = databind(); gdvOrder.DataBind(); }
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.Orderform of = new QPS.NEW.BLL.Orderform(); ds = of.SelectRoom(pageSize, currentpage); dgExamProj.DataSource = ds; this.Pager1.ItemCount = of.GetCount(); dgExamProj.DataBind(); }
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); }
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(); }
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(); }
protected void btnCreate_Click(object sender, EventArgs e) { try { //转换为整数 int ID = Convert.ToInt32(orderid); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform order = Border.GetModel(ID); order.Beveragecost = Convert.ToDecimal(txfBeverageCost.Text); if (Border.Update(order)) { Response.Write("<script>alert('订单修改成功!')</script>"); Response.Write("<script>window.close()</script>"); } } catch (Exception ex) { Response.Write("<script>alert('订单修改失败!')</script>"); } }
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); }
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(); }
// 生成事件时激发 protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { string command = e.CommandName.ToString(); //两个参数 1.当前订单ID,2.当前订单状态 string strArgument = e.CommandArgument.ToString(); QPS.NEW.BLL.Orderform of = new QPS.NEW.BLL.Orderform(); switch (command) { case "changStart": string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); of.UpdateType(id, type); Bind(); break; case "delete": of.Delete(Convert.ToInt32(strArgument)); Bind(); break; case "DeleteIs": string[] Arguments = strArgument.Split('|'); string ids = Arguments[0].ToString(); string examine = Arguments[1].ToString(); of.UpdateIsDelete(ids, examine); Bind(); break; default: break; } }
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 Button1_Click(object sender, EventArgs e) { string name = this.txtId.Text; string xingm = this.txtName.Text; QPS.NEW.BLL.Orderform of = new QPS.NEW.BLL.Orderform(); if (name != "" && xingm != "") { ds = of.SelectList(Convert.ToInt32(name), xingm); } else { if (name != "") { ds = of.SelectList( Convert.ToInt32(name)); } else if (xingm != "") { ds = of.SelectList(xingm); } } //ds = of.SelectList("id = '" + name + "' or (select UserName From Users where id= o.Userid) = '" + xingm + "' "); dgExamProj.DataSource = ds; dgExamProj.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_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = this.gdvOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform morder = Border.GetModel(ID); morder.IsDelete = 1; Border.Update(morder); gdvOrder.DataSource= databind(); gdvOrder.DataBind(); }
// 生成事件时激发 protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e) { string command = e.CommandName.ToString(); //两个参数 1.当前订单ID,2.当前订单状态 string strArgument = e.CommandArgument.ToString(); QPS.NEW.BLL.Orderform of = new QPS.NEW.BLL.Orderform(); switch (command) { case "changStart": string[] Argument = strArgument.Split('|'); string id = Argument[0].ToString(); string type = Argument[1].ToString(); of.UpdateType(id,type); Bind(); break; case "delete": of.Delete(Convert.ToInt32(strArgument)); Bind(); break; case "DeleteIs": string[] Arguments = strArgument.Split('|'); string ids = Arguments[0].ToString(); string examine = Arguments[1].ToString(); of.UpdateIsDelete(ids, examine); Bind(); break; default: break; } }
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(); }