public void CreateOrder(Orders order) { if (order == null) { throw new Exception("Incomplete Fields"); } _RTSystemContext.Orders.Add(order); _RTSystemContext.SaveChanges(); }
public void CreateSellerBid(SellerBids sellerBid) { if (sellerBid == null) { throw new Exception("Incomplete Fields"); } else { _RTSystemContext.SellerBids.Add(sellerBid); _RTSystemContext.SaveChanges(); } }
public void CreateBuyerBid(BuyerBids buyerBid) { if (buyerBid.Quality == null || buyerBid.PaymentIn == null) { throw new Exception("Incomplete Fields"); } else { _RTSystemContext.BuyerBids.Add(buyerBid); _RTSystemContext.SaveChanges(); } }
public Users Authenticate(AuthenticateModel user) { var userExists = _RTSystemContext.Users .SingleOrDefault(u => u.Email == user.email); if (userExists == null || !VerifyPassword(userExists.Password, user.password)) { throw new Exception("Incorrect Email or Password"); } if (userExists.Status == "deactivated") { userExists.Status = "active"; } _RTSystemContext.SaveChanges(); return(userExists); }