public void BindData() { #region //if (!Context.User.Identity.IsAuthenticated) //{ // return; //} //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); //if (user.HasPermissionID(PermId_Modify)) //{ // gridView.Columns[6].Visible = true; //} //if (user.HasPermissionID(PermId_Delete)) //{ // gridView.Columns[7].Visible = true; //} #endregion DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); if (txtKeyword.Text.Trim() != "") { #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称 //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); gridView.DataSource = ds; gridView.DataBind(); }
protected void Button2_Click1(object sender, EventArgs e) { if (UsersInfo.UserID == "") { Response.Write("<script> alert('请先登录!'); window.location.href='../Login.aspx' </script>"); return; } if (OrderDetail_Bll.GetRecordCount(" CommodityID='" + Request.QueryString["ID"].ToString() + "' and UserID='" + UsersInfo.UserID + "' ") <= 0) { RadRating1.Visible = false; Button2.Visible = false; } else { try { string OrdersDetailedid = OrderDetail_Bll.GetList(" CommodityID='" + Request.QueryString["ID"].ToString() + "' and UserID='" + UsersInfo.UserID + "'and AppraiseGrade is null ").Tables[0].Rows[0]["OrderDetailID"].ToString(); Maticsoft.Model.OrderDetail molorderdetail = OrderDetail_Bll.GetModel(OrdersDetailedid); } catch (Exception) { Response.Write("<script>alert('已经评过分,请刷新后重试!')</script>"); if (OrderDetail_Bll.GetRecordCount(" CommodityID='" + Request.QueryString["ID"].ToString() + "' and UserID='" + UsersInfo.UserID + "' ") > 0) { RadRating1.Visible = false; Button2.Visible = false; } return; } string OrdersDetailedid1 = OrderDetail_Bll.GetList(" CommodityID='" + Request.QueryString["ID"].ToString() + "' and UserID='" + UsersInfo.UserID + "'and AppraiseGrade is null ").Tables[0].Rows[0]["OrderDetailID"].ToString(); Maticsoft.Model.OrderDetail molorderdetail1 = OrderDetail_Bll.GetModel(OrdersDetailedid1); if (RadRating1.Value == 0) { Response.Write("<script>alert('请评分!')</script>"); return; } if (RadRating1.Value == 1) { molorderdetail1.AppraiseGrade = 40; } if (RadRating1.Value == 2) { molorderdetail1.AppraiseGrade = 60; } if (RadRating1.Value == 3) { molorderdetail1.AppraiseGrade = 80; } if (RadRating1.Value == 4) { molorderdetail1.AppraiseGrade = 100; } OrderDetail_Bll.Update(molorderdetail1); pinfen(); RadAjaxManager1.Alert("评分成功!"); if (OrderDetail_Bll.GetRecordCount(" CommodityID='" + Request.QueryString["ID"].ToString() + "' and UserID='" + UsersInfo.UserID + "' ") > 0) { RadRating1.Visible = false; Button2.Visible = false; } } }