Ejemplo n.º 1
0
        public WishListModelClass GetWhishList(WishListModelClass cart)
        {
            try
            {
                SqlCommand sqlCommand = new SqlCommand("sp_WishList", sqlConnection);
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.AddWithValue("@cartId", cart.WhishListId);
                sqlConnection.Open();
                SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();

                while (sqlDataReader.Read())
                {
                    cart.BookId      = Convert.ToInt32(sqlDataReader["Quantity"]);
                    cart.WhishListId = Convert.ToInt32(sqlDataReader["TotalPrice"]);
                }
                return(cart);
            }
            catch (Exception e)
            {
                throw new Exception("Value is not able to read" + e);
            }
            finally
            {
                sqlConnection.Close();
            }
        }
Ejemplo n.º 2
0
        //[Route("Addwhis")]
        public IActionResult DeleteWhishList(WishListModelClass whis)
        {
            var userResult = this.whish.DeleteWhishList(whis);

            try
            {
                if (userResult != null)
                {
                    return(this.Ok(new Response(HttpStatusCode.OK, "The  Data", userResult)));
                }
                return(this.NotFound(new Response(HttpStatusCode.NotFound, " Data Not Found", userResult)));
            }
            catch (Exception)
            {
                return(this.BadRequest(new Response(HttpStatusCode.BadRequest, "List of data not displayed", null)));
            }
        }
Ejemplo n.º 3
0
 public WishListModelClass AddWhishList(WishListModelClass whis)
 {
     try
     {
         SqlCommand sqlCommand = new SqlCommand("sp_AddWishList", sqlConnection);
         sqlCommand.Parameters.AddWithValue("@Bookid", whis.BookId);
         sqlConnection.Open();
         sqlCommand.ExecuteNonQuery();
         sqlConnection.Close();
         return(whis);
     }
     catch (Exception e)
     {
         throw new Exception("WishList not Details Added" + e);
     }
     finally
     {
         sqlConnection.Close();
     }
 }
Ejemplo n.º 4
0
 public WishListModelClass DeleteWhishList(WishListModelClass whis)
 {
     return(wishList.DeleteWhishList(whis));
 }
Ejemplo n.º 5
0
 public WishListModelClass UpdateWhishList(WishListModelClass whis)
 {
     return(wishList.UpdateWhishList(whis));
 }
Ejemplo n.º 6
0
 public WishListModelClass AddWhishList(WishListModelClass whis)
 {
     return(wishList.AddWhishList(whis));
 }
Ejemplo n.º 7
0
 public WishListModelClass GetWhishList(WishListModelClass cart)
 {
     return(wishList.GetWhishList(cart));
 }