Exemple #1
0
        public static void FinishDeleteRide(Ride ride)
        {
            var rslt = DatabaseSingleton.GetInstance().Rides.Where(x => x.RideID == ride.RideID).FirstOrDefault();

            rslt.RideStatus_ = "Deleted";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void AcceptAttraction(int id, String action)
        {
            var rslt = DatabaseSingleton.GetInstance().RequestAttractions.Where(x => x.RequestAttractionID == id).FirstOrDefault();

            rslt.AttractionStatus = action;
            DatabaseSingleton.GetInstance().SaveChanges();
        }
Exemple #3
0
        public static void ProgressAdd(Ride ride)
        {
            var rslt = DatabaseSingleton.GetInstance().Rides.Where(x => x.RideID == ride.RideID).FirstOrDefault();

            rslt.RideStatus_ = "In Progress To Add";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void RejectingPurchaseRequest(PurchaseRequest purchaseRequest)
        {
            var rslt = DatabaseSingleton.GetInstance().PurchaseRequests.Where(x => x.PurchaseID == purchaseRequest.PurchaseID).FirstOrDefault();

            rslt.PurchaseStatus = "Rejected";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void WaitingFundRequest(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().PurchaseRequests.Where(x => x.PurchaseID == id).FirstOrDefault();

            rslt.PurchaseStatus = "Waiting For Fund";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void AcceptRide(int id, String action)
        {
            var rslt = DatabaseSingleton.GetInstance().RequestRides.Where(x => x.RequestRideID == id).FirstOrDefault();

            rslt.RideStatus_ = action;
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void deleteAttraction(RequestAttraction requestAttraction)
        {
            var rslt = DatabaseSingleton.GetInstance().Attractions.Where(x => x.AttractionID == requestAttraction.AttractionID).FirstOrDefault();

            rslt.AttractionStatus = "Deleted";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void FinishRequestRide(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().RequestRides.Where(x => x.RequestRideID == id).FirstOrDefault();

            rslt.RideStatus_ = "Applied to Construct";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void RejectingFundRequest(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().FundRequests.Where(x => x.FundId == id).FirstOrDefault();

            rslt.FundStatus = "Rejected";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void RejectRide(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().RequestRides.Where(x => x.RequestRideID == id).FirstOrDefault();

            rslt.RideStatus_ = "Rejected";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
Exemple #11
0
        public static void deleteRide(RequestRide ride)
        {
            var rslt = DatabaseSingleton.GetInstance().Rides.Where(x => x.RideID == ride.RideID).FirstOrDefault();

            rslt.RideStatus_ = "Waiting For Construction To Delete";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void Delete(Ingredient newIngredient)
        {
            var rslt = DatabaseSingleton.GetInstance().Ingredients.Where(x => x.IngredientID == newIngredient.IngredientID).FirstOrDefault();

            rslt.IngredientStatus = "Deleted";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void FinishRequestAttraction(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().RequestAttractions.Where(x => x.RequestAttractionID == id).FirstOrDefault();

            rslt.AttractionStatus = "Finish";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void deleteTransaction(int id)
        {
            var rslt = DatabaseSingleton.GetInstance().TicketTransactions.Where(x => x.TicketTransactionID == id).FirstOrDefault();

            rslt.TransactionStauts = "Deleted";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void updateQty(int qty, int id)
        {
            var rslt = DatabaseSingleton.GetInstance().TicketTransactions.Where(x => x.TicketTransactionID == id).FirstOrDefault();

            rslt.Quantity = qty;
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void insertTicket()
        {
            Ticket newTc = new Ticket();

            newTc.TicketID = ticketId;

            DatabaseSingleton.GetInstance().Tickets.Add(newTc);
            DatabaseSingleton.GetInstance().SaveChanges();
        }
Exemple #17
0
 public static void UpdateAds(Advertisement newAds)
 {
     Advertisement rd = DatabaseSingleton.GetInstance().Advertisements.Where(x => x.AdvertisementID == newAds.AdvertisementID).FirstOrDefault();
     rd.AdvertisementDescription = newAds.AdvertisementDescription;
     rd.AdvertisementStatus = newAds.AdvertisementStatus;
     rd.EmployeeID = rd.EmployeeID;
     rd.Deadline = newAds.Deadline;
     DatabaseSingleton.GetInstance().SaveChanges();
 }
        public static void Update(Ingredient newIngredient)
        {
            Ingredient rd = DatabaseSingleton.GetInstance().Ingredients.Where(x => x.IngredientID == newIngredient.IngredientID).FirstOrDefault();

            rd.IngredientName   = newIngredient.IngredientName;
            rd.IngredientStock  = newIngredient.IngredientStock;
            rd.IngredientStatus = "Active";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void insertRecordTicketTransaction(DateTime date, int qty)
        {
            TicketTransaction newTct = new TicketTransaction();

            newTct.TicketDate        = date;
            newTct.Quantity          = qty;
            newTct.TransactionStauts = "Active";

            DatabaseSingleton.GetInstance().TicketTransactions.Add(newTct);
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void UpdateAttraction(RequestAttraction requestAttraction)
        {
            Attraction rd = DatabaseSingleton.GetInstance().Attractions.Where(x => x.AttractionID == requestAttraction.AttractionID).FirstOrDefault();

            rd.AttractionName        = requestAttraction.AttractionName;
            rd.AttractionDescription = requestAttraction.AttractionDescription;
            rd.AttractionHowToWork   = requestAttraction.AttractionHowToWork;
            rd.AttractionStartDate   = requestAttraction.AttractionStartDate;
            rd.AttractionParticipant = requestAttraction.AttractionParticipant;
            DatabaseSingleton.GetInstance().SaveChanges();
        }
Exemple #21
0
        public static Employee DoSearchEmployee(String username, String password)
        {
            Employee employee = DatabaseSingleton.GetInstance().Employees.Where(x => x.EmployeeUsername.Equals(username) && x.EmployeePassword.Equals(password)).FirstOrDefault();

            if (employee == null || employee.EmployeeBannedStatus.Equals("True"))
            {
                return(null);
            }

            return(employee);
        }
Exemple #22
0
        public static void UpdateRide(RequestRide requestedRide)
        {
            Ride rd = DatabaseSingleton.GetInstance().Rides.Where(x => x.RideID == requestedRide.RideID).FirstOrDefault();

            rd.RideName              = requestedRide.RideName;
            rd.RideDescription       = requestedRide.RideDescription;
            rd.RideHowToWork         = requestedRide.RideHowToWork;
            rd.RideType              = requestedRide.RideType;
            rd.RideSafetyInformation = requestedRide.RideSafetyInformation;
            rd.RideStatus_           = "Waiting For Construction To Update";
            DatabaseSingleton.GetInstance().SaveChanges();
        }
Exemple #23
0
        public static void CreateRide(RequestRide requestedRide)
        {
            Ride rd = new Ride();

            rd.RideName              = requestedRide.RideName;
            rd.RideDescription       = requestedRide.RideDescription;
            rd.RideHowToWork         = requestedRide.RideHowToWork;
            rd.RideType              = requestedRide.RideType;
            rd.RideSafetyInformation = requestedRide.RideSafetyInformation;
            rd.RideStatus_           = "Waiting For Construction To Add";
            DatabaseSingleton.GetInstance().Rides.Add(rd);
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static void CreateRide(RequestAttraction requestedAttraction)
        {
            Attraction rd = new Attraction();

            rd.AttractionName        = requestedAttraction.AttractionName;
            rd.AttractionDescription = requestedAttraction.AttractionDescription;
            rd.AttractionHowToWork   = requestedAttraction.AttractionHowToWork;
            rd.AttractionStartDate   = requestedAttraction.AttractionStartDate;
            rd.AttractionParticipant = requestedAttraction.AttractionParticipant;
            rd.AttractionStatus      = "Active";
            DatabaseSingleton.GetInstance().Attractions.Add(rd);
            DatabaseSingleton.GetInstance().SaveChanges();
        }
        public static string generateTicketId()
        {
            Ticket tc = DatabaseSingleton.GetInstance().Tickets.ToArray().LastOrDefault();

            ticketId = tc.TicketID.Substring(8);
            string id  = "" + (Int32.Parse(ticketId) + 1);
            string nol = "";

            if (id.Length == 1)
            {
                nol = "00";
            }
            else if (id.Length == 2)
            {
                nol = "0";
            }
            else if (id.Length == 3)
            {
                nol = "";
            }
            ticketId = DateTime.Now.ToString("yyyyMMdd") + nol + id;
            return(ticketId);
        }
 public static RequestAttraction SearchByID(int id)
 {
     return(DatabaseSingleton.GetInstance().RequestAttractions.Where(x => x.RequestAttractionID == id).FirstOrDefault());
 }
Exemple #27
0
 public static void CreateAdvertisement(Advertisement newAds)
 {
     newAds.AdvertisementStatus = "Active";
     DatabaseSingleton.GetInstance().Advertisements.Add(newAds);
     DatabaseSingleton.GetInstance().SaveChanges();
 }
 public static void CreateRequestAttraction(RequestAttraction newRequest)
 {
     DatabaseSingleton.GetInstance().RequestAttractions.Add(newRequest);
     DatabaseSingleton.GetInstance().SaveChanges();
 }
Exemple #29
0
        public static Advertisement SearchByID(int id)
        {
            return DatabaseSingleton.GetInstance().Advertisements.Where(x => x.AdvertisementID == id).FirstOrDefault();

        }
Exemple #30
0
 public static void DeleteAds(Advertisement newAds)
 {
     var rslt = DatabaseSingleton.GetInstance().Advertisements.Where(x => x.AdvertisementID == newAds.AdvertisementID).FirstOrDefault();
     rslt.AdvertisementStatus = "Deleted";
     DatabaseSingleton.GetInstance().SaveChanges();
 }