コード例 #1
0
        public static void DoOrderFood(String id, String quantity)
        {
            int foodId, quantityId, tableNumberId;

            Int32.TryParse(id, out foodId);
            Int32.TryParse(quantity, out quantityId);
            Int32.TryParse(tableNumber, out tableNumberId);

            OrderRequest orderReq = new OrderRequest();

            orderReq.CustomerId       = ActiveUserController.GetActiveCustomer().Id;
            orderReq.OrderDate        = DateTime.Now;
            orderReq.EmployeeId       = 1;
            orderReq.TableNumber      = tableNumberId;
            orderReq.OrderStatus      = "Waiting";
            orderReq.FeedBackCustomer = "None";
            ConnectionController.GetInstance().OrderRequests.Add(orderReq);
            ConnectionController.GetInstance().SaveChanges();


            OrderDetail orderDetail = new OrderDetail();

            orderDetail.FoodId   = foodId;
            orderDetail.Quantity = quantityId;
            orderDetail.OrderId  = orderReq.Id;

            ConnectionController.GetInstance().OrderDetails.Add(orderDetail);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #2
0
        public static void DoAddFiringReason(String reason)
        {
            Firing firing = new Firing();

            firing.employeeId      = ActiveUserController.GetActiveEmployee().Id;
            firing.fireDescription = reason;

            ConnectionController.GetInstance().Firings.Add(firing);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #3
0
        private static void DoInsertHeader()
        {
            HeaderCreation headerCreation = new HeaderCreation();

            headerCreation.EmployeeId  = ActiveUserController.GetActiveEmployee().Id;
            headerCreation.CreatedDate = DateTime.Now;

            ConnectionController.GetInstance().HeaderCreations.Add(headerCreation);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #4
0
        public static void DoRequestRaiseSalary(int targetId, int price)
        {
            RequestRaiseSalary raiseRequest = new RequestRaiseSalary();

            raiseRequest.EmployeeId         = ActiveUserController.GetActiveEmployee().Id;
            raiseRequest.EmployeeRaisePrice = price;
            raiseRequest.EmployeeTargetId   = targetId;
            raiseRequest.ResponseStatus     = "Waiting";

            ConnectionController.GetInstance().RequestRaiseSalaries.Add(raiseRequest);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #5
0
        public static void DoRequestResign(String startTime, String reason)
        {
            ResignRequest resignPermission = new ResignRequest();

            resignPermission.EmployeeId     = ActiveUserController.GetActiveEmployee().Id;
            resignPermission.ResignLetter   = reason;
            resignPermission.ResignDate     = Convert.ToDateTime(startTime);
            resignPermission.ResignResponse = "Waiting";

            ConnectionController.GetInstance().ResignRequests.Add(resignPermission);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #6
0
        public static void DoScheduleMaintainTime(String startTime, String endTime, int id)
        {
            HeaderMaintenance headerMaintenance = new HeaderMaintenance();

            headerMaintenance.EmployeeId = ActiveUserController.GetActiveEmployee().Id;
            headerMaintenance.RideId     = id;
            headerMaintenance.StartTime  = Convert.ToDateTime(startTime);
            headerMaintenance.EndTime    = Convert.ToDateTime(endTime);

            ConnectionController.GetInstance().HeaderMaintenances.Add(headerMaintenance);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #7
0
        public static void DoRequestLeaving(String startTime, String endTime, String reason)
        {
            LeavingPermission leavingPermission = new LeavingPermission();

            leavingPermission.EmployeeId     = ActiveUserController.GetActiveEmployee().Id;
            leavingPermission.Reason         = reason;
            leavingPermission.StartDate      = Convert.ToDateTime(startTime);
            leavingPermission.EndDate        = Convert.ToDateTime(endTime);
            leavingPermission.ResponseStatus = "Waiting";

            ConnectionController.GetInstance().LeavingPermissions.Add(leavingPermission);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #8
0
        public static void DoCreateOrder(int id)
        {
            OrderRequest orderReq = ConnectionController.GetInstance().OrderRequests.Where(x => x.Id.Equals(id)).FirstOrDefault();

            orderReq.EmployeeId  = ActiveUserController.GetActiveEmployee().Id;
            orderReq.OrderStatus = "Pending";
            ConnectionController.GetInstance().SaveChanges();

            Table table = ConnectionController.GetInstance().Tables.Where(x => x.Id.Equals(orderReq.TableNumber)).FirstOrDefault();

            table.TableStatus = "Unavailable";

            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #9
0
        public static void DoRequestManager(int id)
        {
            Ride ride;

            ride = RideCreationController.DoSearchRide(id);

            HeaderResponse headerResponse = new HeaderResponse();

            headerResponse.EmployeeId     = ActiveUserController.GetActiveEmployee().Id;
            headerResponse.ResponseDate   = DateTime.Now;
            headerResponse.ResponseStatus = "Waiting";
            headerResponse.RideId         = ride.Id;

            ConnectionController.GetInstance().HeaderResponses.Add(headerResponse);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #10
0
        public static void DoFundRequest(int money, String desc, bool fromPurchaseDepartment)
        {
            HeaderFundRequest headerFundRequest = new HeaderFundRequest();

            headerFundRequest.PriceValue     = money;
            headerFundRequest.Description    = desc;
            headerFundRequest.ResponseStatus = "Waiting";
            headerFundRequest.EmployeeId     = ActiveUserController.GetActiveEmployee().Id;
            if (fromPurchaseDepartment)
            {
                HeaderPurchaseRequest headerPurchaseRequest = ConnectionController.GetInstance().HeaderPurchaseRequests.Where(x => x.ItemPiece.ItemPrice.Equals(money)).FirstOrDefault();
                headerFundRequest.PurchaseId = headerPurchaseRequest.Id;
            }
            ConnectionController.GetInstance().HeaderFundRequests.Add(headerFundRequest);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #11
0
        public static void DoInsertIngredient(String ingredientName, int quantity)
        {
            Ingredient ingredient = new Ingredient();

            ingredient.IngredientName = ingredientName;

            ConnectionController.GetInstance().Ingredients.Add(ingredient);

            HeaderIngredient headerIng = new HeaderIngredient();

            headerIng.Quantity     = quantity;
            headerIng.IngredientId = ingredient.Id;
            headerIng.EmployeeId   = ActiveUserController.GetActiveEmployee().Id;

            ConnectionController.GetInstance().HeaderIngredients.Add(headerIng);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #12
0
        public static void DoSendToConstructionDepartment(int id)
        {
            HeaderResponse headerResponse;

            headerResponse = ConnectionController.GetInstance().HeaderResponses.Where(x => x.Id.Equals(id)).FirstOrDefault();
            Ride ride;

            ride = RideCreationController.DoSearchRide(headerResponse.RideId);

            HeaderConstruction headerConstruction = new HeaderConstruction();

            headerConstruction.EmployeeId = ActiveUserController.GetActiveEmployee().Id;
            headerConstruction.ConstructionRequestDate = DateTime.Now;
            headerConstruction.RideId = ride.Id;

            ride.RideStatus = "On Going";

            ConnectionController.GetInstance().HeaderConstructions.Add(headerConstruction);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #13
0
        public static void DoPurchaseRequest(String itemName, String itemDesc, int qty)
        {
            ItemPiece itemPiece = new ItemPiece();

            itemPiece.ItemName        = itemName;
            itemPiece.ItemDescription = itemDesc;
            itemPiece.ItemPrice       = 0;
            ConnectionController.GetInstance().ItemPieces.Add(itemPiece);
            ConnectionController.GetInstance().SaveChanges();

            HeaderPurchaseRequest headerPurchaseRequest = new HeaderPurchaseRequest();

            headerPurchaseRequest.EmployeeId     = ActiveUserController.GetActiveEmployee().Id;
            headerPurchaseRequest.ItemPieceId    = itemPiece.Id;
            headerPurchaseRequest.RequestDate    = DateTime.Now;
            headerPurchaseRequest.ResponseStatus = "Waiting";
            headerPurchaseRequest.Quantity       = qty;
            ConnectionController.GetInstance().HeaderPurchaseRequests.Add(headerPurchaseRequest);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #14
0
        public static void DoInsertAttraction(String attName, int durabilityCheck, int quantity, String startDate)
        {
            Attraction attraction = new Attraction();

            attraction.AttractionName = attName;
            attraction.DurationInDays = durabilityCheck;
            attraction.StartDate      = Convert.ToDateTime(startDate);

            ConnectionController.GetInstance().Attractions.Add(attraction);


            HeaderAttraction headerAtt = new HeaderAttraction();

            headerAtt.EmployeeId    = ActiveUserController.GetActiveEmployee().Id;
            headerAtt.CreatedDate   = DateTime.Now;
            headerAtt.Area_Quantity = quantity;
            headerAtt.AttractionId  = attraction.Id;

            ConnectionController.GetInstance().HeaderAttractions.Add(headerAtt);
            ConnectionController.GetInstance().SaveChanges();
        }
コード例 #15
0
 public static void DoFeedActiveCustomer(int id)
 {
     ActiveUserController.SetActiveCustomer(CustomerController.DoSearchCustomer(id));
 }
コード例 #16
0
 public static void DoFeedActiveEmployee(int id)
 {
     ActiveUserController.SetActiveEmployee(EmployeeController.DoSearchEmployee(id));
 }