Ejemplo n.º 1
0
        public RequestDetailsViewModel(RequestViewModel request)
        {
            if (request.DateMade != null)
            {
                DateMade = request.DateMade;
            }
            if (request.DateRequested != null && request.DateRequested != new DateTime())
            {
                DateRequested = request.DateRequested;
            }
            else
            {
                DateRequested = RoundUp(DateTime.Now, TimeSpan.FromMinutes(15));
            }
            ID              = request.Id;
            Duration        = request.Duration;
            ProjectName     = request.ProjectName;
            ProjectDescript = request.ProjectDescript;
            ProjectFilePath = request.ProjectFilePath;
            PersonalUse     = request.PersonalUse;
            Request         = request;
            Status          = request.Status;
            Printer         = request.Printer;
            User            = request.User;

            PrintTimeLabel       = "Print Time: " + DateRequested.ToString();
            SaveOrUpdateCommand  = new SaveOrUpdateCommand(this);
            DeleteCommand        = new DeleteCommand(this);
            PushChatPagesCommand = new PushChatPagesCommand(this);
            FilePickerCommand    = new FilePickerCommand(this);
            SetDateCommand       = new SetDateCommand(this);
        }
Ejemplo n.º 2
0
        public dynamic AdviseBooking([FromBody] Stuff Booking)
        {
            db.Configuration.ProxyCreationEnabled = false;
            dynamic toReturn = new ExpandoObject();

            try
            {
                int      BookingID   = Booking.BookingID;
                int      EmployeeID  = (int)Booking.EmployeeID;
                int      RequestedID = Booking.RequestedID;
                DateTime getDate     = Convert.ToDateTime(Booking.Date);
                int      TimeID      = (int)Booking.TimeID;

                int DateID = db.Dates.Where(zz => zz.Date1 == getDate).Select(zz => zz.DateID).FirstOrDefault();


                EmployeeSchedule findSlot = db.EmployeeSchedules.Where(zz => zz.EmployeeID == EmployeeID && zz.DateID == DateID && zz.TimeID == TimeID).FirstOrDefault();
                findSlot.BookingID = BookingID;
                findSlot.StatusID  = 3;
                db.SaveChanges();

                Booking findBooking = db.Bookings.Where(zz => zz.BookingID == BookingID).FirstOrDefault();
                findBooking.StatusID = 2;
                db.SaveChanges();

                DateRequested findRequest = db.DateRequesteds.Where(zz => zz.RequestedID == RequestedID).FirstOrDefault();
                db.DateRequesteds.Remove(findRequest);

                return("success");
            }
            catch (Exception err)
            {
                return(err.Message);
            }
        }
Ejemplo n.º 3
0
 private void RequestInformation_Load(object sender, EventArgs e)
 {
     if (RequestStatus == "APPROVED" || RequestStatus == "DENIED")
     {
         btnReply.Enabled   = false;
         btnReply.BackColor = Color.WhiteSmoke;
     }
     lblRequestID.Text          = "Request ID : " + RequestID;
     lblRequestName.Text        = "Requested By: " + RequestFullname;
     lblDateRequested.Text      = "Date Requested : " + DateRequested.ToShortDateString();
     lblRequestStatus.Text      = "Request Status : " + RequestStatus;
     txtRequestMessage.Text     = RequestMessage;
     txtRequestSubject.Text     = RequestTitle;
     txtRequestMessage.ReadOnly = true;
 }
Ejemplo n.º 4
0
 private void OnDateTimeSubmitted(DateTime datetime)
 {
     DateRequested  = RoundUp(datetime, TimeSpan.FromMinutes(15));
     PrintTimeLabel = "Print Time: " + DateRequested.ToString();
 }