private void SendStatus()
        {
            //sends the updated line status to the server
            if (string.IsNullOrEmpty(SelectedLine))
            {
                logger.Print("Please selected a line first.");
                return;
            }
            Line updatedLine = new Line();

            updatedLine.Number = SelectedLine;
            updatedLine.Status = LineStatus;
            Tuple <object, HttpStatusCode> returnTuple = httpClient.PostRequest(ApiConfigs.SendLineStatusRoute, updatedLine);

            if (returnTuple.Item2 == HttpStatusCode.OK)
            {
                RequestStatusEnum status = (RequestStatusEnum)Enum.ToObject(typeof(RequestStatusEnum), returnTuple.Item1);
                logger.Print("Status updated successfully.");
                CloseThisWindow();
            }
            else
            {
                logger.Print($"{returnTuple.Item2.ToString()} Error.");
            }
        }
Exemple #2
0
        private void UpdateRequestStatus(RequestStatusEnum status)
        {
            request.Status   = (int)status;
            request.DriverId = null;
            var operatorBL = HttpContext.Current.Application.GetContainer().Resolve <OperatorBl>();

            operatorBL.UpdateRequest(request);
        }
        public IHttpActionResult GetByStatIdAndSendId(RequestStatusEnum status_num, int sender_id)
        {
            var request = db.Requests.Where(ss => ss.RequestStatusId == status_num && ss.SenderId == sender_id).Select(BB => new {
                BB.SenderId,
                BB.Id,
                BB.RequestStaus,
                BB.Swap,
                BB.BookId,
                BB.DateOfMessage,
                BB.RecieverId,
                senderUser   = new { BB.SenderId, BB.SenderUser.FirstName },
                recieverUser = new { BB.RecieverId, BB.RecieverUser.FirstName },
            }).ToList();

            if (request == null)
            {
                return(NotFound());
            }

            return(Ok(request));
        }
 private void DeleteLine()
 {
     //deletes the line,its package, package details and selected numbers
     if (!string.IsNullOrEmpty(SelectedLine))
     {
         Tuple <object, HttpStatusCode> returnTuple = httpClient.PostRequest(ApiConfigs.DeleteLineRoute, SelectedLine);
         if (returnTuple.Item2 == HttpStatusCode.OK)
         {
             RequestStatusEnum status = (RequestStatusEnum)Enum.ToObject(typeof(RequestStatusEnum), returnTuple.Item1);
             logger.Print("Line Removed Successfully");
             CloseThisWindow();
         }
         else
         {
             logger.Print($"{returnTuple.Item2.ToString()} Error.");
         }
     }
     else
     {
         logger.Print("Please select a line first.");
     }
 }
Exemple #5
0
 public void UpdateStatus(RequestStatusEnum status, RequestTypeEnum type, string description)
 {
     this.Status      = status;
     this.Type        = type;
     this.Description = description;
 }
 private void UpdateRequestStatus(RequestStatusEnum status)
 {
     request.Status = (int)status;
     request.DriverId = null;
     var operatorBL = HttpContext.Current.Application.GetContainer().Resolve<OperatorBl>();
     operatorBL.UpdateRequest(request);
 }