async void OnTapGestureRecognizerTapped(object sender, EventArgs args) { WishListUser wishList = new WishListUser(); wishList.MovieID = globalID; wishList.Email = AuthenticationViewModel.LoggedinUser; WishListHelper wishHelper = new WishListHelper(); var label = (Label)sender; if (full) { await wishHelper.DeleteWishList(AuthenticationViewModel.LoggedinUser, globalID); label.Text = HeartOutline; full = false; //globalID } else { await wishHelper.AddWishList(wishList); label.Text = Heart; full = true; } }
public void SearchProduct(object sender, EventArgs e) { string username = Session["User"].ToString(); string Wishname = WishListProductName.Text; string ConnectionString = ConfigurationManager.ConnectionStrings["Website"].ToString(); SqlConnection conn = new SqlConnection(ConnectionString); SqlCommand sqlCommand = new SqlCommand("showWishlistProduct", conn); sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue("@customername", username); sqlCommand.Parameters.AddWithValue("@name", Wishname); conn.Open(); SqlDataReader ReadProductWishList = sqlCommand.ExecuteReader(); DataTable Datatb = new DataTable(); WishListUser.DataSource = ReadProductWishList; WishListUser.DataBind(); try { } catch (Exception ex) { Response.Write("Make sure you enter correct WishList Name product or you have a WishListName " + "Product"); } conn.Close(); }
public void AddWishList(object sender, EventArgs e) { Boolean f = false; string ConnectionString = ConfigurationManager.ConnectionStrings["Website"].ToString(); SqlConnection conn = new SqlConnection(ConnectionString); SqlCommand sqlCreateWishList = new SqlCommand("createList", conn); SqlCommand sqlCheckWishList = new SqlCommand("CheckWishList", conn); sqlCreateWishList.CommandType = CommandType.StoredProcedure; sqlCheckWishList.CommandType = CommandType.StoredProcedure; string username = Username.Text; string wishName = WishName.Text; sqlCreateWishList.Parameters.Add(new SqlParameter("@customername", username)); sqlCreateWishList.Parameters.Add(new SqlParameter("@name", wishName)); sqlCheckWishList.Parameters.Add(new SqlParameter("@Username", username)); sqlCheckWishList.Parameters.Add(new SqlParameter("@WishName", wishName)); conn.Open(); SqlDataReader rd = sqlCheckWishList.ExecuteReader(); if (wishName == "") { LabelWishName.Text = "Wish Name Can't be Empty !"; } else { while (rd.Read()) { if (rd[0] == wishName) { f = true; break; } } rd.Close(); if (f) { LabelWishName.Text = "Wish Name Can't be Repeated!"; } else { DataTable WishListTable = new DataTable("WishList"); WishListTable.Columns.Add("UserName", typeof(String)); WishListTable.Columns.Add("WishListName", typeof(String)); DataRow row = WishListTable.NewRow(); row["UserName"] = Username.Text; row["WishListName"] = WishName.Text; WishListUser.DataSource = WishListTable; WishListUser.DataBind(); sqlCreateWishList.ExecuteNonQuery(); } } conn.Close(); }
public async Task EnsureSeedDone() { if (await _userManager.FindByEmailAsync("*****@*****.**") == null) { var newUser = new WishListUser() { UserType = "AD", FirstName = "Sandip", LastName = "Timsina", UserName = "******", Email = "*****@*****.**" }; await _userManager.CreateAsync(newUser, "P@ssw0rd!"); } if (_context.WishLists.Any()) { var wishList = new WishList() { }; } }
public async Task AddWishList(WishListUser wish) { await firebase .Child("WishLists").PostAsync(wish); }