예제 #1
0
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            if (e.CommandName == "Delete")//删除数据
            {
                Users_Bll.DeleteList(id);
                if (Appraise_Bll.GetRecordCount("UserID='" + id + "'") != 0)
                {
                    Appraise_Bll.DeleteList2(id);
                }
                if (ShoppingCart_Bll.GetRecordCount("UserID='" + id + "'") != 0)
                {
                    ShoppingCart_Bll.DeleteList2(id);
                }
                if (OrderDetail_Bll.GetRecordCount("UserID='" + id + "'") != 0)
                {
                    OrderDetail_Bll.DeleteList2(id);
                }
                if (Orders_Bll.GetRecordCount("UserID='" + id + "'") != 0)
                {
                    Orders_Bll.DeleteList2(id);
                }
                RadGrid1.Rebind();
            }
        }
예제 #2
0
 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;
         }
     }
 }
예제 #3
0
        protected void RadGrid1_ItemCommand1(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            if (e.CommandName == "Delete")
            {
                if (Commodity_BLL.GetRecordCount(" CommodityID ='" + id + "' ") != 0 && OrderDetail_Bll.GetRecordCount(" CommodityID ='" + id + "' ") != 0)
                {
                    RadAjaxManager1.Alert("存在订单,删除失败!");
                }
                else
                {
                    Commodity_BLL.Delete(e.CommandArgument.ToString());
                    RadGrid1.Rebind();
                }
            }
        }