public async Task<ActionResult> Index(string sortField, string sortOrder, DateTime? endDate, DateTime? createdDate, string location, string description, RequestStatus? requestStatus)
        {
            var specifiedRequest = _requestSvc.CreateRequestSearchObject(endDate, createdDate, location, description, requestStatus);
            if (string.IsNullOrEmpty(sortOrder))
            {
                // If it's blank, default to descending
                sortOrder = "desc";
            }
            else
            {
                // switch sortOrder otherwise
                sortOrder = sortOrder == "desc" ? "asc" : "desc";
            }

            ViewBag.SortOrderParam   = sortOrder;
            ViewBag.SortFieldParam   = String.IsNullOrEmpty(sortOrder) ? "EndDate" : sortField;
            ViewBag.SpecifiedRequest = specifiedRequest;

            IQueryable<Request> requests = db.Requests.Include(r => r.Creator).Include(r => r.Assignee).AsQueryable();

            IEnumerable<Request> filteredRequests = await _requestSvc.FilterRequestsAsync(specifiedRequest, requests);

            IOrderedEnumerable<Request> sortedRequests = _requestSvc.SortRequests(sortField, sortOrder, filteredRequests);

            return View(new AdminRequestIndexViewModel()
            {
                Requests = sortedRequests.ToList(),
                RequestSearch = specifiedRequest
            });
        }
        public static PrivateObject CreateTestModule(RequestStatus requestStatus = RequestStatus.Success)
        {
            InitializeTelemetryConfiguration();

            switch (requestStatus)
            {
                case RequestStatus.Success:
                    {
                        HttpContext.Current = GetFakeHttpContext();
                        break;
                    }

                case RequestStatus.RequestFailed:
                    {
                        HttpContext.Current = GetFakeHttpContextForFailedRequest();
                        break;
                    }

                case RequestStatus.ApplicationFailed:
                    {
                        HttpContext.Current = GetFakeHttpContextForFailedApplication();
                        break;
                    }
            }

            PrivateObject moduleWrapper = new PrivateObject(typeof(ApplicationInsightsHttpModule));

            return moduleWrapper;
        }
Exemple #3
0
 public RequestBug(RequestStatus status, BugType bugtype, string description, int submittedByID)
 {
     this.Status = status;
     this.BugType = bugtype;
     this.Description = description;
     this.SubmittedByUserId = submittedByID;
 }
 private void UpdateDealLineStatusUnsafe(int index, RequestStatus status)
 {
     var lines = tbDeals.Lines;
     if (lines.Length <= index) return;
     lines[index] = lines[index] + ": " + EnumFriendlyName<RequestStatus>.GetString(status);
     tbDeals.Text = string.Join(Environment.NewLine, lines);
 }
        public async Task<IActionResult> Details(int id, string requestKeywords, RequestStatus? requestStatus)
        {
            var itinerary = await _mediator.SendAsync(new ItineraryDetailQuery {ItineraryId = id});
            if (itinerary == null)
            {
                return NotFound();
            }

            if (!User.IsOrganizationAdmin(itinerary.OrganizationId))
            {
                return Unauthorized();
            }

            var filteredRequests = await _mediator.SendAsync(new RequestListItemsQuery
            {
                Criteria = new RequestSearchCriteria
                {
                    ItineraryId = itinerary.Id,
                    Keywords = requestKeywords,
                    Status = requestStatus
                }
            });

            itinerary.Requests = filteredRequests;

            return View("Details", itinerary);
        }
        public ActionResult Create(RequestStatus requestStatus)
        {
            if (ViewData.ModelState.IsValid)
            {
                requestStatus.LastUpdateTimeStamp = DateTime.Now;
                requestStatus.LastUpdateUser = GetCurrentUser().Id;
                ActionConfirmation saveOrUpdateConfirmation =
                    _requestStatusManagementService.SaveOrUpdate(requestStatus);

                if (saveOrUpdateConfirmation.WasSuccessful)
                {
                    TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] =
                        saveOrUpdateConfirmation.Message;
                    return RedirectToAction("Index");
                }
            }
            else
            {
                requestStatus = null;
            }

            RequestStatusFormViewModel viewModel =
                _requestStatusManagementService.CreateFormViewModelFor(requestStatus);
            return View(viewModel);
        }
		public ApplicationLogEntryResult(RequestStatus status, IApplicationLogEntry data, Guid key, Exception exception)
		{
			Status = status;
			Data = data;
			Key = key;
			Exception = exception;
		}
		public TemperatureEntryResults(RequestStatus status, IList<ITemperatureEntry> data, Guid key, Exception exception)
		{
			Status = status;
			Data = data;
			Key = key;
			Exception = exception;
		}
Exemple #9
0
		public DeviceResults(RequestStatus status, IList<IDevice> data, Int32 key, Exception exception)
		{
			Status = status;
			Data = data;
			Key = key;
			Exception = exception;
		}
Exemple #10
0
 public async Task<IEnumerable<RequestDto>> GetRequestsByRequestStatusAsync(RequestStatus status)
 {
     var requests =
         Mapper.Map<IEnumerable<Request>, IEnumerable<RequestDto>>(
             await DbContext.GetRequestsByRequestStatusAsync(status));
     return requests;
 }
        public IARequestStatus GetRequestStatus(RequestStatus requestStatus)
        {
            IARequestStatus iaRequestStatus = null;
             switch (requestStatus)
             {
            case RequestStatus.Submitted:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Submitted");
               break;
            case RequestStatus.NeedsEstimate:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Needs Estimate");
               break;
            case RequestStatus.WaitingEstimateApproval:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Waiting Estimate Approval");
               break;
            case RequestStatus.InProduction:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "In Production");
               break;
            case RequestStatus.Completed:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Completed");
               break;
            case RequestStatus.Canceled:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Canceled");
               break;
            case RequestStatus.Processing:
               iaRequestStatus = _dataContext.IARequestStatus.SingleOrDefault(row => row.Name == "Processing");
               break;
            default:
               throw new ApplicationException(string.Format("Request status is undefined or doesn't exist: {0}", requestStatus.ToString()));
             }

             return iaRequestStatus;
        }
		public TemperatureSettingResult(RequestStatus status, ITemperatureSetting data, Int64 key, Exception exception)
		{
			Status = status;
			Data = data;
			Key = key;
			Exception = exception;
		}
Exemple #13
0
 public RequestChange(RequestStatus status, string businessneed, string description, int submittedByID)
 {
     this.Status = status;
     this.BusinessNeed=businessneed;
     this.Description = description;
     this.SubmittedByUserId = submittedByID;
 }
Exemple #14
0
 public OrderStatusRecord(JSONObject value)
 {
     this.CustomComment = (string)value["customComment"];
     this.Message       = (string)value["message"];
     this.Order         = (long)value["order"];
     this.Price         = (double)value["price"];
     this.RequestStatus = RequestStatus.FromCode((int)value["requestStatus"]);
 }
        public RequestStatus login([BodyParam()] User dtls, HttpResp response)
        {
            RequestStatus sts = new RequestStatus();

            sts.Message         = "Login success";
            response.StatusCode = 200;
            return(sts);
        }
Exemple #16
0
 /// <summary>
 /// 取消
 /// </summary>
 public ApprovePositionApplication(PositionApplication positionApplication, int operatorID,
                                   RequestStatus requestStatus, string reason)
 {
     _PositionApplication = positionApplication;
     _RequestStatus       = requestStatus;
     _Reason     = reason;
     _OperatorID = operatorID;
 }
Exemple #17
0
 /// <summary>
 /// Return the HashCode of this object.
 /// </summary>
 /// <returns>The HashCode of this object.</returns>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         return(TransactionId.GetHashCode() * 3 ^
                RequestStatus.GetHashCode());
     }
 }
        public void ConfirmNoAnswerFromCustomer_Invalid(RequestStatus status)
        {
            var orderGroup   = MockOrderGroups.Single(og => og.OrderGroupNumber == "REQUESTSJUSTCREATED");
            var requestGroup = orderGroup.RequestGroups.First();

            requestGroup.SetStatus(status, false);
            Assert.Throws <InvalidOperationException>(() => requestGroup.ConfirmNoAnswer(DateTimeOffset.Now, 1, null));
        }
Exemple #19
0
 public UpdateRequestStatusCommand(long requestID, RequestStatus status,
                                   RequestStatusMinor?statusMinor, Officer user)
 {
     _requestID   = requestID;
     _status      = status;
     _statusMinor = statusMinor;
     _user        = user;
 }
Exemple #20
0
 public SupportRequest(int id, string userName, RequestStatus status, SupportSpecialist specialist)
 {
     _id          = id;
     _userName    = userName;
     _status      = status;
     _specialist  = specialist;
     _messageList = new List <Message>();
 }
Exemple #21
0
 /// <summary>
 /// 取消请假单
 /// </summary>
 public CancelPositionApplication(int positionApplicationID, int operatorID,
                                  RequestStatus requestStatus, string reason)
 {
     _PositionApplicationID = positionApplicationID;
     _RequestStatus         = requestStatus;
     _Reason     = reason;
     _OperatorID = operatorID;
 }
        /// <summary>
        /// 审核整张请假单
        /// </summary>
        /// <param name="leaveRequestID"></param>
        /// <param name="accountID"></param>
        /// <param name="requestStatus"></param>
        /// <param name="reason"></param>
        /// <returns></returns>
        public string ApproveWholeLeaveRequest(int leaveRequestID, int accountID, RequestStatus requestStatus, string reason)
        {
            ApproveWholeLeaveRequest approveWholeLeaveRequest =
                new ApproveWholeLeaveRequest(leaveRequestID, accountID, requestStatus, reason);

            approveWholeLeaveRequest.Excute();
            return(approveWholeLeaveRequest.ResultMessage);
        }
Exemple #23
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <param name="accountID"></param>
 /// <param name="leaveRequestTypeID"></param>
 public CalculateCostHour(DateTime from, DateTime to, int accountID, int leaveRequestTypeID)
 {
     _From               = from;
     _To                 = to;
     _AccountID          = accountID;
     _LeaveRequestTypeID = leaveRequestTypeID;
     _RequestStatus      = RequestStatus.All;
 }
Exemple #24
0
        public void SetRequestStatusToDelivered(ADProjectDb db, int requestId)
        {
            Request       request       = db.Request.Where(r => r.RequestId == requestId).SingleOrDefault();
            RequestStatus requestStatus = db.RequestStatus.Where(rs => rs.RequestStatusDescription == RequestStatusEnum.DELIVERED.ToString()).SingleOrDefault();

            request.RequestStatus = requestStatus;
            db.SaveChanges();
        }
        /// <summary>
        /// 取消整张请假单
        /// </summary>
        public string CancelAllLeaveRequest(int leaveRequestID, RequestStatus requestStatus, string reason)
        {
            CancelAllLeaveRequest cancelAllLeaveRequest =
                new CancelAllLeaveRequest(leaveRequestID, requestStatus, reason);

            cancelAllLeaveRequest.Excute();
            return(cancelAllLeaveRequest.ResultMessage);
        }
        public void Accept_Invalid(RequestStatus status)
        {
            var orderGroup   = MockOrderGroups.Single(og => og.OrderGroupNumber == "REQUESTSJUSTCREATED");
            var requestGroup = orderGroup.RequestGroups.First();

            requestGroup.SetStatus(status, false);
            Assert.Throws <InvalidOperationException>(() => requestGroup.Accept(DateTime.Now, 10, null, Enumerable.Empty <RequestGroupAttachment>().ToList(), false, false, null, null));
        }
Exemple #27
0
 public SongRequest(JSONObject song, TwitchUser requestor, DateTime requestTime, RequestStatus status = RequestStatus.Invalid, string requestInfo = "")
 {
     this.song        = song;
     this.requestor   = requestor;
     this.status      = status;
     this.requestTime = requestTime;
     this.requestInfo = requestInfo;
 }
        public void Cancel_Invalid(RequestStatus status)
        {
            var orderGroup   = MockOrderGroups.Single(og => og.OrderGroupNumber == "REQUESTSJUSTCREATED");
            var requestGroup = orderGroup.RequestGroups.First();

            requestGroup.SetStatus(status, false);
            Assert.Throws <InvalidOperationException>(() => requestGroup.Cancel(DateTime.Now, 10, null, "apa"));
        }
Exemple #29
0
        public static void Skip(int index, RequestStatus status = RequestStatus.Skipped)
        {
            // Set the final status of the request
            SetRequestStatus(index, status);

            // Then dequeue it
            DequeueRequest(index);
        }
Exemple #30
0
        public Task <Response <RequestStatus> > IssuancePostAsync(IssuanceRequest body, string policyId)
        {
            var status = new RequestStatus {
                Id = "", Status = RequestState.Completed
            };

            return(Task.FromResult(ResponseCodes.OK(status)));
        }
Exemple #31
0
        public RequestStatus Update(long id, RequestStatus newRequestStatus)
        {
            newRequestStatus.Id = id;
            this.context.Entry(newRequestStatus).State = EntityState.Modified;
            this.context.SaveChanges();

            return(newRequestStatus);
        }
        public async Task Subscription_queries_should_be_cached(bool disableAggressiveCache, RequestStatus expectedResultOnSubscriptionQueries)
        {
            persister = new SubscriptionPersister(store);
            persister.DisableAggressiveCaching = disableAggressiveCache;

            await persister.Subscribe(new Subscriber("TransportAddress1", "Endpoint1"), MessageTypes.MessageA, new ContextBag());
            await persister.Subscribe(new Subscriber("TransportAddress2", "Endpoint2"), MessageTypes.MessageA, new ContextBag());

            using (var session = store.OpenAsyncSession())
            {
                await session.StoreAsync(new RandomDoc(), "RandomDoc/test").ConfigureAwait(false);
                await session.SaveChangesAsync().ConfigureAwait(false);
            }


            var messageTypes = new[]
            {
                MessageTypes.MessageA
            };

            Console.WriteLine("-- First subscriber query...");
            requests.Clear();
            var subscribers = await persister.GetSubscriberAddressesForMessage(messageTypes, new ContextBag()).ConfigureAwait(false);
            Assert.AreEqual(2, subscribers.Count());
            Assert.AreEqual(1, requests.Count);
            Assert.AreEqual(RequestStatus.SentToServer, requests[0].Status);

            Console.WriteLine($"-- Subsequent subscription queries, should be {expectedResultOnSubscriptionQueries}");
            for (var i = 0; i < 5; i++)
            {
                requests.Clear();
                var cachedSubs = await persister.GetSubscriberAddressesForMessage(messageTypes, new ContextBag()).ConfigureAwait(false);
                Assert.AreEqual(2, cachedSubs.Count());
                Assert.AreEqual(1, requests.Count);
                Assert.AreEqual(expectedResultOnSubscriptionQueries, requests[0].Status);
            }

            Console.WriteLine("-- Random doc first query");
            using (var session = store.OpenAsyncSession())
            {
                requests.Clear();
                await session.LoadAsync<RandomDoc>("RandomDoc/test").ConfigureAwait(false);
                Assert.AreEqual(1, requests.Count);
                Assert.AreEqual(RequestStatus.SentToServer, requests[0].Status);
            }

            Console.WriteLine("-- Random doc, subsequent loads should be Cached, not AggressivelyCached");
            for (var i = 0; i < 5; i++)
            {
                using (var session = store.OpenAsyncSession())
                {
                    requests.Clear();
                    await session.LoadAsync<RandomDoc>("RandomDoc/test").ConfigureAwait(false);
                    Assert.AreEqual(1, requests.Count);
                    Assert.AreEqual(RequestStatus.Cached, requests[0].Status);
                }
            }
        }
Exemple #33
0
        protected void MarkCompleted(RequestStatus status, string status_msg)
        {
            _StatusMsg += status_msg;
            _Status     = status;

            _Completed.Set();

            _AssetManager.FireTransferRequestCompletedEvent(this);
        }
Exemple #34
0
 public RequestChange(int id, RequestStatus status, List<Remark> remarks, string businessneed, string description, int submittedByID)
 {
     this.Id = id;
     this.Status = status;
     this.Remarks = remarks;
     this.BusinessNeed=businessneed;
     this.Description = description;
     this.SubmittedByUserId = submittedByID;
 }
        public void SaveRequestStatus(RequestStatus requestStatus)
        {
            if (requestStatus.Id == 0)
            {
                context.RequestStatuses.Add(requestStatus);
            }

            context.SaveChanges();
        }
Exemple #36
0
 public static Request Request(User user, Guid refNo, RequestStatus status, int isCurrent)
 => new Request()
 {
     Id            = Guid.NewGuid(),
     RefNo         = refNo,
     IsCurrent     = isCurrent,
     RequestStatus = status,
     User          = user,
 };
 public WorkRequest(WorkType workType, Vehicle vehicle)
 {
     Code       = Guid.NewGuid();
     CreateDate = DateTime.Now;
     //
     WorkType      = workType;
     Vehicle       = vehicle;
     RequestStatus = RequestStatus.IsActive;
 }
Exemple #38
0
        public async Task UpdateRequestAsync(RequestEditingBindingModel model)
        {
            Request request = await this.repository
                              .All()
                              .FirstOrDefaultAsync(r => r.Id == model.Id);

            if (request == null)
            {
                throw new ArgumentException("Invalid request!");
            }

            if (model.StatusId != null && model.StatusId != request.StatusId)
            {
                RequestStatus status = await this.statusService.GetAll()
                                       .FirstOrDefaultAsync(s => s.Id == model.StatusId);

                if (status == null)
                {
                    throw new ArgumentException("Invalid status!");
                }

                request.StatusId = status.Id;

                if (status.Id == WebConstants.ClosedStatusId || status.Id == WebConstants.RejectedStatusId)
                {
                    request.EndTime = DateTime.UtcNow;
                }
            }

            if (model.CategoryId != null && model.CategoryId != request.CategoryId)
            {
                RequestCategory category = await this.categoriesService.ById(Convert.ToInt32(model.CategoryId)).FirstOrDefaultAsync();

                if (category == null)
                {
                    throw new ArgumentException("Invalid category!");
                }

                request.CategoryId = category.Id;
            }

            //if (model.AssignToId != null && model.AssignToId != request.AssignedToId)
            //{
            //    User technician = this.userService.GetById(model.AssignToId);
            //    if (technician == null || technician.RoleId == WebConstants.UserRoleId)
            //    {
            //        throw new ArgumentException("Invalid technician!");
            //    }

            //     request.AssignedToId = technician.Id;
            //}
            if (model.Resolution != request.Resolution)
            {
                request.Resolution = model.Resolution;
            }
            await this.SaveChangesAsync();
        }
 public static void PrepareNextRequest(RequestStatus status = RequestStatus.Success, object response = null, Exception exception = null)
 {
     requests.Add(new RequestMockWrapper()
     {
         Status    = status,
         Response  = response,
         Exception = exception,
     });
 }
Exemple #40
0
 public RequestBug(int id, RequestStatus status, List<Remark> remarks, BugType bugtype, string description, int submittedByID)
 {
     this.Id = id;
     this.Status = status;
     this.Remarks = remarks;
     this.BugType = bugtype;
     this.Description = description;
     this.SubmittedByUserId = submittedByID;
 }
        public async Task <bool> Add(RequestStatus RequestStatus)
        {
            await db.RequestStatus.AddAsync(RequestStatus);


            await db.SaveChangesAsync();

            return(true);
        }
Exemple #42
0
 public SalachovResponse(SalachovRequest request, RequestStatus status, IResponseData data, IResponseData headerSection, IResponseData bodySection)
     : base(request, status, data,
            new Dictionary <Key, IResponseData>()
 {
     { SalachovProtocol.HEADER_SECTION_KEY, headerSection },
     { SalachovProtocol.BODY_SECTION_KEY, bodySection }
 })
 {
 }
 public void NewCloseOrderResponse(MarketOrder order, RequestStatus status, string detailMessage)
 {
     if (status == RequestStatus.OK)
         logMessage(string.Format("Счет {0}: ордер {1} закрыт",
                                  order.AccountID, order));
     else
         logMessage(string.Format("Счет {0}: ошибка закрытия ордера {1}: {2}",
                                  order.AccountID, order, status));
 }
Exemple #44
0
 /// <summary>
 /// 取消请假单
 /// </summary>
 public CancelLeaveRequestItem(int leaveRequestID, int leaveRequestItemID, int operatorID,
                               RequestStatus requestStatus, string reason)
 {
     _LeaveRequestID     = leaveRequestID;
     _LeaveRequestItemID = leaveRequestItemID;
     _RequestStatus      = requestStatus;
     _Reason             = reason;
     _OperatorID         = operatorID;
 }
 public void EditPendingOrderResponse(PendingOrder order, RequestStatus status, string detailMessage)
 {
     if (status == RequestStatus.OK)
         logMessage(string.Format("Счет {0}: ордер {1} успешно изменен",
                                  order.AccountID, order));
     else
         logMessage(string.Format("Счет {0}: ошибка редактирования ордера {1}: {2}",
                                  order.AccountID, order, status));
 }
 public SongRequest FromJson(JSONObject obj)
 {
     requestor   = new TwitchUser(obj["requestor"].Value);
     requestTime = DateTime.FromFileTime(long.Parse(obj["time"].Value));
     status      = (RequestStatus)Enum.Parse(typeof(RequestStatus), obj["status"].Value);
     song        = obj["song"].AsObject;
     requestInfo = obj["requestInfo"].Value;
     return(this);
 }
Exemple #47
0
 public RequestLog(int RequestID, string Description, string Remark, RequestStatus Requeststatus, string URL)
 {
     this.uRL = URL;
     this.requestID = RequestID;
     this.description = Description;
     this.remark = Remark;
     this.status = Requeststatus;
     this.logDateTime = DateTime.Now;
 }
Exemple #48
0
 /// <summary>
 ///
 /// </summary>
 public OutApplicationFlow(int pkid, Account account, DateTime operationTime, string remark, RequestStatus operation, int step)
 {
     _OutApplicationFlowID = pkid;
     _Account                 = account;
     _OperationTime           = operationTime;
     _Remark                  = remark;
     _OutApplicationOperation = operation;
     _Step = step;
 }
Exemple #49
0
 T map <T>(RequestStatus sendResults)
     where T : struct, Enum
 {
     return(EnumUtils.GetValues <T>()
            .Where(v => v.HasAttribute <RequestStatusMappingAttribute>())
            .ToDictionary(v => v.GetAttribute <RequestStatusMappingAttribute>())
            .Single(kvp => kvp.Key.RequestStatuses.Contains(sendResults))
            .Value);
 }
Exemple #50
0
        public RequestAccess( Market market, Product product, RequestStatus status, ControllerStatus cstatus, string description, int submittedByID)
        {
            this.Status = status;
            this.ControllerStatus = cstatus;
            this.Description = description;
            this.SubmittedByUserId = submittedByID;

            this.MarketAccess = market;
            this.ProductAccess = product;
        }
        private void SetStatus(RequestStatus status)
        {
            report.LastRequestStatus = status;
            reportRepo.Merge(report.Id, report);

            foreach(var request in requests)
            {
                request.Status = status;
                requestRepo.Merge(request.Id, request);
            }
        }
 public static string getStringFromRequestStatus(RequestStatus type)
 {
     switch (type)
     {
         case RequestStatus.WAITING_APPROVE:
             return Lib.Resources.Messages.WAITING_APPROVE;
         case RequestStatus.APPROVED:
             return Lib.Resources.Messages.APPROVED;
         default:
             return Lib.Resources.Messages.WAITING_APPROVE;
     }
 }
 public void NewOrderResponse(MarketOrder order, RequestStatus status, string detailMessage)
 {
     if (status == RequestStatus.OK)
         logMessage(string.Format("Счет {0}: ордер ({1} {2} {3}) успешно размещен",
                                  order.AccountID, order.Side > 0 ? "BUY" : "SELL",
                                  order.Volume.ToStringUniformMoneyFormat(), order.Symbol));
     else
         logMessage(string.Format("Счет {0}: ошибка размещения ордера ({1} {2} {3}): {4}",
                                  order.AccountID, order.Side > 0 ? "BUY" : "SELL",
                                  order.Volume.ToStringUniformMoneyFormat(), order.Symbol,
                                  status));
 }
        public void CanCompareRequestStatuses()
        {
            var instance = new RequestStatus();
            instance.Code = "ABC";
            instance.LongDesc = "Description for status";

            var instanceToCompareTo = new RequestStatus();
            instanceToCompareTo.Code = "ABC";
            instanceToCompareTo.LongDesc = "Description for status";

            instance.ShouldEqual(instanceToCompareTo);
        }
Exemple #55
0
        public Request(int EventID, string TargetEmail,string Description, string URL, DateTime RequestDate, string Requestor, string Title)
        {
            this.Title = Title;
            this.EventID = EventID;
            this.TargetEmail = TargetEmail;
            this.Remark = "";
            status = RequestStatus.Pending;

            this.Description = Description;

            this.URL = URL;
            this.RequestDate = RequestDate;
            this.Requestor = Requestor;
        }
        public void To(RequestStatus requestStatus, Guid requestId)
        {
            var request = context.Requests.Single(x => x.RequestId == requestId);
            if (requestStatus == RequestStatus.Assigned)
            {
                request.Status = RequestStatus.Assigned;
            }

            if (requestStatus == RequestStatus.Unassigned)
            {
                request.Status = RequestStatus.Unassigned;
                mediator.Send(new SetRequstsToUnassignedCommand { RequestIds = new List<Guid> { requestId } });
            }

            context.SaveChanges();
        }
 internal static string ConvertToRequestStatus(RequestStatus status)
 {
     switch (status)
     {
         case RequestStatus.Approved:
             return "APR";
         case RequestStatus.Denied:
             return "DNY";
         case RequestStatus.New:
             return "NEW";
         case RequestStatus.PendingApproval:
             return "PEN";
         default:
             throw new System.InvalidOperationException("Invalid status for request.");
     }
 }
        public void CanDeleteRequestStatus()
        {
            // Establish Context
            var requestStatusToDelete = new RequestStatus();

            _requestStatusRepository.Expect(r => r.Get(1))
                .Return(requestStatusToDelete);

            // Act
            ActionConfirmation confirmation =
                _requestStatusManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
        private void DoWait(string requestUrl)
        {
            if (string.IsNullOrEmpty(requestUrl))
                return;
            var requestApi = new RequestApi(configuration);

            var sub = requestUrl.Substring(requestUrl.IndexOf("requests/") + 9, 36);
            var request = new RequestStatus();
            int counter = 0;

            do
            {
                request = requestApi.GetStatus(sub);
                counter++;
                Thread.Sleep(1000);
            } while (request.Metadata.Status != "DONE" && counter != 35);
        }
        //to approve or reject
        public static void ChangeStatus(Requestee requestee, int requestID, RequestStatus status, string remark)
        {
            DAL dalDataContext = new DAL();
            try
            {

                Request request = (from requests in dalDataContext.requests
                                   where requests.RequestID == requestID
                                   && requests.TargetEmail.Equals(requests.TargetEmail)
                                   select requests).FirstOrDefault();

                if (request == null)
                {
                    throw new FaultException<SException>(new SException(),
                        new FaultReason("Invalid Request"));
                }
                else if (!request.TargetEmail.Equals(requestee.TargetEmail, StringComparison.CurrentCultureIgnoreCase))
                {
                    throw new FaultException<SException>(new SException(),
                        new FaultReason("You are not authorized to perform this task"));
                }
                else
                {
                    if (status == RequestStatus.Cancelled || status == RequestStatus.Pending)
                    {
                        throw new FaultException<SException>(new SException(),
                                        new FaultReason("You can either approve or reject the request!"));
                    }
                    request.Status = status;
                    request.Remark = remark;
                    dalDataContext.SubmitChanges();

                    RequestLogController.InsertRequestLog(request);
                }

            }
            catch (Exception ex)
            {
                throw new FaultException<SException>(new SException(ex.Message),
                    new FaultReason("An Error occured While Updating Request: " + ex.Message));
            }
        }