protected void Page_Load(object sender, EventArgs e) { if (Session["userid"] == null) { Response.Redirect("~/Login.aspx"); } Session.Add("url", "Wishlist.aspx"); dw = new DeleteWishlist(); string userstr = "SELECT * from wishlist where userid = " + Convert.ToInt16(Session["userid"]); con = new MyConnection(); c1 = con.GetConnection(); SqlCommand cmd = new SqlCommand(userstr, c1); c1.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { isWishlistEmpty = false; } else { isWishlistEmpty = true; } c1.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["userid"] == null) Response.Redirect("~/Login.aspx"); Session.Add("url","Wishlist.aspx"); dw = new DeleteWishlist(); string userstr = "SELECT * from wishlist where userid = "+ Convert.ToInt16(Session["userid"]); con = new MyConnection(); c1 = con.GetConnection(); SqlCommand cmd = new SqlCommand(userstr, c1); c1.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { isWishlistEmpty = false; } else { isWishlistEmpty = true; } c1.Close(); }
/// <summary> /// Initializes a new instance of the <see cref="DeleteCartTest"/> class. /// </summary> public DeleteWishlistTest() { this.visitorId = Guid.NewGuid(); this.wishlist = new WishList { ExternalId = this.visitorId.ToString() }; this.request = new DeleteWishListRequest(this.wishlist); this.result = new DeleteWishListResult(); this.args = new ServicePipelineArgs(this.request, this.result); this.client = Substitute.For <IWishlistsServiceChannel>(); var clientFactory = Substitute.For <ServiceClientFactory>(); clientFactory.CreateClient <IWishlistsServiceChannel>(Arg.Any <string>(), Arg.Any <string>()).Returns(this.client); this.processor = new DeleteWishlist { ClientFactory = clientFactory }; }