public ReviewWindow(int productId, int customerId) { InitializeComponent(); bll = new ReviewBLL(); this.productId = productId; this.customerId = customerId; }
protected void Page_Load(object sender, EventArgs e) { if (Session["isLogin"] == null) { Response.Redirect("Login.aspx"); } UserAccount user = (UserAccount)Session["UserAccountObj"]; if (!user.UserRole.Equals("Staff")) { lblAccessRight.Text = "YOU DO NOT HAVE STAFF RIGHTS TO ACCESS THIS FUNCTION"; btn_back.Visible = false; } else { StaffBLL staffbll = new StaffBLL(); Staff staff = staffbll.DoRetrieveStaffByID(user.UserId); DataTable dt = new DataTable(); ReviewBLL reviewBLL = new ReviewBLL(); int restId = Convert.ToInt32(staff.RestId); dt = reviewBLL.DoRetrieveRestaurantRating(restId); if (dt != null) { gv_restaurants.DataSource = dt; gv_restaurants.DataBind(); } } }
protected void gv_pastOrders_RowCommand(object sender, GridViewCommandEventArgs e) { int rowNo = int.Parse(e.CommandArgument.ToString()); GridViewRow row = gv_pastOrders.Rows[rowNo]; row.Cells[2].Text = Convert.ToDateTime(row.Cells[2].Text).ToString("dd/MM/yyyy HH:mm"); if (e.CommandName == "Details") { int orderId = int.Parse(row.Cells[0].Text); Response.Redirect("UserViewOrderDetails.aspx?orderid=" + orderId); } if (e.CommandName == "Review") { ReviewBLL reviewBLL = new ReviewBLL(); int orderId = int.Parse(row.Cells[0].Text); if (reviewBLL.DoCheckReviewExists(orderId) == 0) { Response.Redirect("UserCreateReview.aspx?orderid=" + orderId); } else { Response.Redirect("UserRetrieveReview.aspx?orderid=" + orderId); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["isLogin"] == null) { Response.Redirect("Login.aspx"); } UserAccount user = (UserAccount)Session["UserAccountObj"]; txtOrderId.Text = Request.QueryString["orderid"].ToString(); Orders od = new Orders(); OrdersBLL odbll = new OrdersBLL(); od = odbll.DoRetrieveUserOrderDetails(int.Parse(txtOrderId.Text)); Rider rider = new Rider(); RiderBLL riderBLL = new RiderBLL(); rider = riderBLL.DoRetrieveRiderByID(od.RId); txtTransactionID.Text = od.TransactionId; txtRiderID.Text = od.RId.ToString(); txtRiderName.Text = rider.RName; ReviewBLL reviewBLL = new ReviewBLL(); Review review = reviewBLL.DoRetrieveReviewByOrderID(Convert.ToInt32(txtOrderId.Text)); txtReview.Text = review.ReviewTxt.ToString(); ddlRestaurantRating.SelectedValue = review.RestaurantRating.ToString(); ddlRiderRating.SelectedValue = review.RiderRating.ToString(); }
protected void btn_Review_Click(object sender, EventArgs e) { Orders od = new Orders(); OrdersBLL odbll = new OrdersBLL(); RestaurantBLL rbll = new RestaurantBLL(); od = odbll.DoRetrieveUserOrderDetails(int.Parse(txtOrderId.Text)); ReviewBLL reviewBLL = new ReviewBLL(); reviewBLL.DoCreateReview(od.OrderId, od.CId, od.RId, rbll.DoRetrieveRestIdByTransactionId(od.TransactionId), Convert.ToInt32(ddlRiderRating.SelectedValue), Convert.ToInt32(ddlRestaurantRating.SelectedValue), txtReview.Text); Response.Redirect("UserRetrieveReview.aspx?orderid=" + od.OrderId); }
protected void btn_Review_Click(object sender, EventArgs e) { ReviewBLL reviewBLL = new ReviewBLL(); int orderId = Convert.ToInt32(txtOrderId.Text); if (reviewBLL.DoCheckReviewExists(orderId) == 0) { Response.Redirect("UserCreateReview.aspx?orderid=" + orderId); } else { Response.Redirect("UserRetrieveReview.aspx?orderid=" + orderId); } }
public ActionResult GetData(Input input) { ReviewBLL review = new ReviewBLL(); Output output = null; if (input.productID != null && input.data != null) { output = review.getReviews(input.productID, input.data); } if (output != null) { input.SL = output.SL.ToString(); input.SP = output.SP.ToString(); } return(View(input)); }
protected void Page_Load(object sender, EventArgs e) { if (Session["isLogin"] == null) { Response.Redirect("Login.aspx"); } UserAccount user = (UserAccount)Session["UserAccountObj"]; lblUserName.Text = user.Username.ToUpper(); lblUserRole.Text = user.UserRole.ToUpper(); ReviewBLL reviewBLL = new ReviewBLL(); double rating = reviewBLL.DoRetrieveRiderAvgRating(user.UserId); if (rating == 0) { lblRating.Text = "NIL"; } else { lblRating.Text = rating.ToString(); } StatsBLL statsBLL = new StatsBLL(); int totalAvailOrders = statsBLL.DoCountTotalAvailableOrders(); lblTotalAvailOrders.Text = totalAvailOrders.ToString(); int totalOrdersDone = statsBLL.DoCountOrdersDoneByRider(user.UserId); lblOrdersDone.Text = totalOrdersDone.ToString(); int totalOrders = statsBLL.DoCountTotalOrders(); lbltotalOrders.Text = totalOrders.ToString(); double totalOrderAmt = statsBLL.DoCountTotalOrderAmount(); lbltotalOrderAmt.Text = "$" + totalOrderAmt.ToString(); }
/// <summary> /// 评论 /// </summary> /// <returns></returns> public int pinglun() { ReviewBLL rbll = new ReviewBLL(); int workid = Convert.ToInt32(Request["workid"]); string PinglunContent = Request["PinglunContent"].ToString(); ReviewModel t = new ReviewModel(); t.Reviewcontent = PinglunContent; t.Userid = Convert.ToInt32(Session["userid"]); t.Reviewstate = DateTime.Now; t.Worksid = workid; if (rbll.ReviewADD(t) > 0) { return(1); } else { return(0); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["isLogin"] == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { DataTable dt = new DataTable(); ReviewBLL reviewBLL = new ReviewBLL(); int restId = Convert.ToInt32(Request.QueryString["restId"]); dt = reviewBLL.DoRetrieveRestaurantRating(restId); if (dt != null) { gv_restaurants.DataSource = dt; gv_restaurants.DataBind(); } } }
public ReviewController(ReviewBLL reviewBll) { _reviewBll = reviewBll; }