protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "p") { RentProductBll pBll = new RentProductBll(); RentLogModel log = bll.GetModel(Convert.ToInt32(e.CommandArgument)); pBll.UpdateStatus(log.RentID, (int)RentProductStatus.已出租); bll.UpdateStatus(log.RentLogID, (int)RentLogStatus.已确认); } }
private void BindData() { RentLogModel log = bll.GetModel(RentID, GetUserID()); RentProductModel product = new RentProductBll().GetModel(RentID); for (int i = 1; i <= product.MaxRentTime; i++) { ListItem item = new ListItem(); item.Text = i.ToString(); item.Value = i.ToString(); DropDown_RentTime.Items.Add(item); } if (log != null) { Div_ApplyContent.InnerHtml = "对不起,您已经申请过了,请返回<a href=\"/member/rent/rentloglist.aspx\">用户中心</a>查看。"; Button_Add.Enabled = false; } }
public XmlDocument GetData(NameValueCollection TagParameter) { XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><tag />"); XmlNode rootNode = xdoc.SelectSingleNode("/tag"); XmlNode PawnNode = XmlUtility.AddNewNode(rootNode, "pawn", null); DataTable dt1 = new PawnProductBll().GetNewestList(2, PawnProductStatus.已收当); foreach (DataRow row in dt1.Rows) { XmlNode PawnProductNode = XmlUtility.AddNewNode(PawnNode, "pawnproduct", null); XmlUtility.AddNewNode(PawnProductNode, "pid", row["pawnproductid"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "productname", row["pawnproductname"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "image", MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString())); XmlUtility.AddNewNode(PawnProductNode, "price", row["sellingprice"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "deadtime", Convert.ToDateTime(row["deadtime"]).ToString("yyyy-MM-dd")); } XmlNode RentNode = XmlUtility.AddNewNode(rootNode, "rent", null); DataTable dt2 = new RentProductBll().GetNewestList(10); foreach (DataRow row in dt2.Rows) { XmlNode RentProductNode = XmlUtility.AddNewNode(RentNode, "rentlist", null); XmlUtility.AddNewNode(RentProductNode, "rentid", row["rentid"].ToString()); XmlUtility.AddNewNode(RentProductNode, "rentname", row["rentname"].ToString()); XmlUtility.AddNewNode(RentProductNode, "createtime", Convert.ToDateTime(row["createtime"]).ToString("yyyy年MM月dd日")); } return(xdoc); }