예제 #1
0
        public IActionResult AddResourceAssignment(string companyID, DateTime dateOfArrival, long bookingItemID, int resourceID)
        {
            string comment = "I was testing";
            ResourceAssignmentViewModel vm = new ResourceAssignmentViewModel()
            {
                BookingItemsResourceAssignments = resourceAssignmentRepository.AssignResourceToBookingItem(resourceID, bookingItemID, comment),
                DateOfArrival             = dateOfArrival,
                CompanyID                 = companyID,
                BookingItemsByArrivalDate = resourceAssignmentRepository.GetBookingItemsByArrivalDate(companyID, dateOfArrival),
                //ResourcesAvailableForAssignment = resourceAssignmentRepository.GetResourcesAvailableForAssignment(companyID, dateOfArrival)
            };

            return(View(nameof(Index), vm));
        }
예제 #2
0
        public IActionResult RemoveResourceAssignment(BookingItemResourceAssignment biRa, DateTime dateOfArrival, string companyID)
        {
            resourceAssignmentRepository.RemoveBookignItemResourceAssignement(biRa);

            //string comment = "I was testing";
            ResourceAssignmentViewModel vm = new ResourceAssignmentViewModel()
            {
                DateOfArrival             = dateOfArrival,
                CompanyID                 = companyID,
                BookingItemsByArrivalDate = resourceAssignmentRepository.GetBookingItemsByArrivalDate(companyID, dateOfArrival),
                //ResourcesAvailableForAssignment = resourceAssignmentRepository.GetResourcesAvailableForAssignment(companyID, dateOfArrival),
                BookingItemsResourceAssignments = resourceAssignmentRepository.GetBookingItemResourceAssignments(companyID, dateOfArrival)
            };

            return(View(nameof(Index), vm));
        }
예제 #3
0
        public IActionResult Index(string companyID, DateTime?dateOfArrival = null)
        {
            string   pCompanyID     = (companyID ?? "B68162");
            DateTime pDateOfArrival = dateOfArrival ?? DateTime.Now;
            //DateTime dateOfArrival = DateTime.Parse("2018-05-03");
            ResourceAssignmentViewModel vm = new ResourceAssignmentViewModel()
            {
                DateOfArrival                   = pDateOfArrival,
                CompanyID                       = pCompanyID,
                BookingItemsByArrivalDate       = resourceAssignmentRepository.GetBookingItemsByArrivalDate(pCompanyID, pDateOfArrival),
                BookingItemsResourceAssignments = resourceAssignmentRepository.GetBookingItemResourceAssignments(companyID, pDateOfArrival),
                //ResourcesAvailableForAssignment = resourceAssignmentRepository.GetResourcesAvailableForAssignment(pCompanyID, pDateOfArrival)
            };

            return(View(vm));
        }
        public virtual JsonResult UpdateAssignment([DataSourceRequest] DataSourceRequest request, ResourceAssignmentViewModel assignment)
        {
            if (ModelState.IsValid)
            {
                assignmentService.Update(assignment);
            }

            return(Json(new[] { assignment }.ToDataSourceResult(request, ModelState)));
        }