public void InsertCustomerInformation(CustomerInfo info) { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); db.CustomerInfoes.Add(info); db.SaveChanges(); }
public void UpdateQuantity(int id, int quantity) { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); BootCart cart = db.BootCarts.Find(id); cart.Price = quantity; db.SaveChanges(); }
public string InsertProduct(BootProduct product) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); db.BootProducts.Add(product); db.SaveChanges(); return(product.ShoeName + " Inserted Successfull"); } catch (Exception e) { return("Error:" + e); } }
public void MarkBootsAsPaid(List <BootCart> carts) { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); if (carts != null) { foreach (BootCart cart in carts) { BootCart PreviousCart = db.BootCarts.Find(cart.ID); PreviousCart.DateBought = DateTime.Now; PreviousCart.InsideCart = false; } db.SaveChanges(); } }
public string InsertCart(BootCart cart) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); db.BootCarts.Add(cart); db.SaveChanges(); return(cart.DateBought + " Inserted Successfull"); } catch (Exception e) { return("Error:" + e); } }
public string DeleteProduct(int id) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); BootProduct product = db.BootProducts.Find(id); db.BootProducts.Attach(product); db.BootProducts.Remove(product); db.SaveChanges(); return(product.ShoeName + "Deleted Successfull"); } catch (Exception e) { return("Error:" + e); } }
public string DeleteCart(int id) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); BootCart cart = db.BootCarts.Find(id); db.BootCarts.Attach(cart); db.BootCarts.Remove(cart); db.SaveChanges(); return(cart.DateBought + "Deleted Successfull"); } catch (Exception e) { return("Error:" + e); } }
public string UpdateProductType(int id, BootType bootType) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); //get the info from the db BootType p = db.BootTypes.Find(id); p.ShoeName = bootType.ShoeName; db.SaveChanges(); return(bootType.ShoeName + " Updated Successfull"); } catch (Exception e) { return("Error:" + e); } }
public string UpdateProduct(int id, BootProduct product) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); //get the info from the db BootProduct p = db.BootProducts.Find(id); p.ShoeName = product.ShoeName; p.Price = product.Price; p.ShoeType = product.ShoeType; p.Description = product.Description; p.Image = product.Image; db.SaveChanges(); return(product.ShoeName + " Updated Successfull"); } catch (Exception e) { return("Error:" + e); } }
public string UpdateCart(int id, BootCart cart) { try { db_1525596_co5027Entities db = new db_1525596_co5027Entities(); //get the info from the db BootCart p = db.BootCarts.Find(id); p.DateBought = cart.DateBought; p.CustomerID = cart.CustomerID; p.Price = cart.Price; p.InsideCart = cart.InsideCart; p.ProductID = cart.ProductID; db.SaveChanges(); return(cart.DateBought + " Updated Successfull"); } catch (Exception e) { return("Error:" + e); } }