public PagingResult <Adoption> GetAdoptions(int page, int pageSize, AdoptionStatus?adoptionStatus = null, string searchString = null, bool?isActive = null) { Status?status = null; if (isActive != null) { status = isActive.Value ? Status.Active : Status.Inactive; } return(_repository.GetAdoptions(page, pageSize, adoptionStatus, searchString, status)); }
// GET: /Project/ChangeStatus/5?status=1 public ActionResult ChangeStatus(int?id, Status?status) { if (id == null || status.HasValue == false || Request.UrlReferrer == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project project = db.GetProjectById(User, id.Value); if (project == null) { return(HttpNotFound()); } if (status.Value != Status.Active) { //check if contains the selected action if (project.ContainsSelectedAction) { //not working nor pending confirmation if (project.Owner.WorkingPanelAvailable) { //clear selected action project.Owner.ActionID = null; db.Entry(project.Owner).State = EntityState.Modified; } else { //cannot perform change TempData["UpdateError"] = Settings.MSG_UNSUCCESSFUL_BECAUSE_WORKING; return(Redirect(Request.UrlReferrer.AbsoluteUri)); } } } //update end date if (Project.IsFinishedStatus(status.Value)) { //if no end date if (project.EndDate.HasValue == false) { project.EndDate = DateTime.UtcNow; } } else { //remove end date project.EndDate = null; } project.Status = status.Value; db.Entry(project).State = EntityState.Modified; db.SaveChanges(); TempData["UpdateInfo"] = Settings.MSG_SUCCESSFUL_UPDATE; return(Redirect(Request.UrlReferrer.AbsoluteUri)); }
public StockFollower(YesterdayCandleData stock, ContextProvider contextProvider, Action <PlacedOrder> addOrder, Status?status = null) { Stock = stock; _contextProvider = contextProvider; _addOrder = addOrder; if (status != null) { Status = status; } }
/// <summary> /// Resolve the specified exception to an end-user exception that will be thrown from the client. /// The resolved exception is normally a RpcException. Returns true when the resolved exception is changed. /// </summary> internal bool ResolveException(string summary, Exception ex, [NotNull] out Status?status, out Exception resolvedException) { if (ex is OperationCanceledException) { status = (CallTask.IsCompletedSuccessfully()) ? CallTask.Result : new Status(StatusCode.Cancelled, string.Empty); if (!Channel.ThrowOperationCanceledOnCancellation) { resolvedException = CreateRpcException(status.Value); return(true); } } else if (ex is RpcException rpcException) { status = rpcException.Status; // If trailers have been set, and the RpcException isn't using them, then // create new RpcException with trailers. Want to try and avoid this as // the exact stack location will be lost. // // Trailers could be set in another thread so copy to local variable. var trailers = Trailers; if (trailers != null && rpcException.Trailers != trailers) { resolvedException = CreateRpcException(status.Value); return(true); } } else { var s = GrpcProtocolHelpers.CreateStatusFromException(summary, ex); // The server could exceed the deadline and return a CANCELLED status before the // client's deadline timer is triggered. When CANCELLED is received check the // deadline against the clock and change status to DEADLINE_EXCEEDED if required. if (s.StatusCode == StatusCode.Cancelled) { lock (this) { if (IsDeadlineExceededUnsynchronized()) { s = new Status(StatusCode.DeadlineExceeded, s.Detail, s.DebugException); } } } status = s; resolvedException = CreateRpcException(s); return(true); } resolvedException = ex; return(false); }
/// <summary> /// Function to get all competition instances. /// </summary> /// <returns>All instances.</returns> public IEnumerable <CompetitionInstance> GetAllCompetitionInstances(Status?status = null) { var instances = _repo.GetInstances(); if (status != null) { instances = (from i in instances where i.Status == status select i).OrderBy(o => o.DateFrom).ToList(); } return(instances); }
private async Task <OsuUser> CreateOsuUserFromUserDataAsync(UserData userData) { OsuUser osuUser = _osuFriends.CreateUser(userData.OsuFriendsKey); Status? status = await osuUser.GetStatusAsync(); _logger.LogTrace("OsuDb Status: {status}", status); if (status != Status.Completed) { return(null); } return(osuUser); }
public PageResult <UserRoleDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, string userUid = "", string roleCode = "") { var cond = new UserRoleDto { Uid = uid, Status = status, UserGuid = userUid, RoleCode = roleCode, }; return(base.GetPagedList(cond, pageSize, pageNo)); }
public PageResult <RolePermDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, string roleCode = "", string permCode = "") { var cond = new RolePermDto { Uid = uid, Status = status, RoleCode = roleCode, PermCode = permCode, }; return(base.GetPagedList(cond, pageSize, pageNo)); }
public async void FlushAndTeardown() { var logger = LogManager.InitializeLogger(Token); Status?status = null; await Task.Run(() => { status = LogManager.FlushAndTeardown(); }); Assert.AreEqual(Status.Success, status); }
private void buttonModificare_Click(object sender, EventArgs e) { if (ListaAnime.SelectedIndex == -1) { return; } Anime a = adminAnime.GetAnime(ListaAnime.SelectedIndex); if (DateValide() == false) { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul nu a putut fi modificat"; return; } a.NumeAnime = txtNume1.Text; a.NotaAnime = Convert.ToDouble(txtRecenzie.Text); a.SezoaneAnime = Convert.ToInt32(txtSezoane.Text); a.EpisoadeAnime = Convert.ToInt32(txtEpisoade.Text); TypeAnime?typeAnime = GetTypeAnime(); if (typeAnime.HasValue) { a.TipulAnime = typeAnime.Value; } Status?status = GetStatus(); if (status.HasValue) { a.OngoingAnime = status.Value; } a.GenAnime = new List <string>(); a.GenAnime.AddRange(genurileBifate); if (adminAnime.RewriteAnime(a) == false) { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul nu a putut fi modificat"; } else { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul selectat a fost modificat"; } show(); ResetareControale(); }
protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { if (actionID == PLD.RoyalAuthority || actionID == PLD.RageOfHalone) { if (IsEnabled(CustomComboPreset.PaladinRoyalSpiritFeature)) { if (IsEnabled(CustomComboPreset.PaladinConfiteorFeature)) { if (OriginalHook(PLD.Confiteor) != PLD.Confiteor) { return(OriginalHook(PLD.Confiteor)); } } Status?requiescat = FindEffect(PLD.Buffs.Requiescat); if (requiescat != null && !HasEffect(PLD.Buffs.FightOrFlight) && LocalPlayer?.CurrentMp >= 1000) { if (requiescat.StackCount <= 1 && level >= PLD.Levels.Confiteor && IsEnabled(CustomComboPreset.PaladinConfiteorFeature)) { return(OriginalHook(PLD.Confiteor)); } return(PLD.HolySpirit); } } if (IsEnabled(CustomComboPreset.PaladinRoyalLobFeature)) { if (CanUseAction(PLD.ShieldLob) && !InMeleeRange()) { return(PLD.ShieldLob); } } if (comboTime > 0) { if (lastComboMove == PLD.FastBlade && level >= PLD.Levels.RiotBlade) { return(PLD.RiotBlade); } if (lastComboMove == PLD.RiotBlade && level >= PLD.Levels.RageOfHalone) { return(OriginalHook(PLD.RageOfHalone)); } } return(PLD.FastBlade); } return(actionID); }
public ActionResult GetByStatus(Status?status) { var transactions = status.HasValue ? dataService.Get((int)status).ToUIString() : StringResources.NoResults; var model = new MainModel { Transactions = transactions }; return(View("MainView", model)); }
private void HandleSetProjectCommand(FileInfo project, string name, Status?status, FileInfo thumbnail, FileInfo readme) { var projectFile = ProjectFile.Load(project.FullName); projectFile.Name = !string.IsNullOrEmpty(name) ? name : projectFile.Name; projectFile.Status = status ?? projectFile.Status; projectFile.Thumbnail = thumbnail != null?Path.GetRelativePath(project.DirectoryName, thumbnail.FullName) : projectFile.Thumbnail; projectFile.Readme = readme != null?Path.GetRelativePath(project.DirectoryName, readme.FullName) : projectFile.Readme; projectFile.Save(project.FullName, true); Console.WriteLine("Project values set."); }
public Memento(Guid id, Status?status = null, string description = null) { Id = id; if (description != null) { Description = description; } if (status != null) { Status = status.Value; } LastUpdate = DateTime.Now; }
public Status move(Direction dir) { this.dir = dir; while (result is null) { machine.step(); } var output = (Status)result; result = null; return(output); }
public SearchDeviceRequest(string authorizationKey, DateTime modifiedSince, int?pageNumber = null, int?pageSize = 50, Status?status = null, long?accountId = null) : base(authorizationKey) { var count = 1; if (pageNumber != null) { count += 1; } if (pageSize != null) { count += 1; } if (status != null) { count += 1; } if (accountId != null) { count += 1; } ; var buf = new List <KeyValuePair <string, string> >(count); buf.Add(new KeyValuePair <string, string>(nameof(modifiedSince), modifiedSince.ToJasperString())); if (pageNumber != null) { buf.Add(new KeyValuePair <string, string>(nameof(pageNumber), pageNumber.ToString())); } if (pageSize != null) { buf.Add(new KeyValuePair <string, string>(nameof(pageSize), pageSize.ToString())); } if (status != null) { buf.Add(new KeyValuePair <string, string>(nameof(status), status.ToString())); } if (pageSize != null) { buf.Add(new KeyValuePair <string, string>(nameof(accountId), accountId.ToString())); } Parameters = buf; }
/// <summary> /// Handles receive status completion for calls with streaming response. /// </summary> private void HandleFinished(bool wasError, BatchContextSafeHandleNotOwned ctx) { var status = ctx.GetReceivedStatus(); lock (myLock) { finished = true; finishedStatus = status; ReleaseResourcesIfPossible(); } CompleteReadObserver(); }
public List <Property> GetPropertyList(Status?propertyStatus = null) { List <Property> colProperties = new List <Property>(); using (var context = new RealEstateDataLayer.RealEstateEntities()) { context.ContextOptions.LazyLoadingEnabled = false; colProperties = context.Properties .Where(p => p.StatusId == (int)propertyStatus) .OrderByDescending(r => r.DateOfListing) .Select(s => s).ToList(); } return(colProperties); }
public PageResult <MenuDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, string name = "", string url = "", string alias = "", string ParentUid = "") { var cond = new MenuDto { Uid = uid, Status = status, Name = name, Alias = alias, Url = url, ParentUid = ParentUid, }; return(base.GetPagedList(cond, pageSize, pageNo)); }
public PageResult <RoleDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, string code = "", string name = "", bool?isSuperAdmin = null, bool?isBuiltin = null) { var cond = new RoleDto { Uid = uid, Status = status, Code = code, Name = name, IsSuperAdmin = isSuperAdmin, IsBuiltin = isBuiltin }; return(base.GetPagedList(cond, pageSize, pageNo)); }
/// <summary> /// ステータスを取得します。 /// </summary> /// <returns></returns> private Status GetStatus() { if (m_Status.HasValue) { return(m_Status.Value); } if (m_Call == null) { return(Status.DefaultSuccess); } m_Status = m_Call.GetStatus(); return(m_Status.Value); }
public AnticaptchaResult(Status?status, string solution, int?errorId, string errorCode, string errorDescription, double?cost, string ip, int?createTime, int?endTime, int?solveCount) { _errorId = errorId; _errorCode = errorCode; _errorDescription = errorDescription; _status = status; _solution = solution; _cost = cost; _ip = ip; _createTime = createTime; _endTime = endTime; _solveCount = solveCount; }
/// <summary> /// Get releases with status /// </summary> public async Task <ApprovalsPendingVSTSCountDto> GetApprovalPendingAsync( string user, string token, Status?status = null) { GetAuthorizationHeader(user, token); var url = new Uri(BaseUri, $"_apis/release/approvals?continuationToken=0&status={status}"); var response = await _httpClient.GetAsync(url); response.EnsureSuccessStatusCode(); var responseBody = ApprovalsPendingVSTSCountDto.FromJson( await response.Content.ReadAsStringAsync()); return(responseBody); }
public PageResult <UserDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, int?userId = null, string userName = "", string nickName = "", UserType?userType = null) { var cond = new UserDto { UserID = userId ?? 0, Uid = uid, Status = status, UserType = userType, UserName = userName, NickName = nickName, }; return(base.GetPagedList(cond, pageSize, pageNo)); }
public async Task <History> Pop() { var history = await _dbContext.History.OrderBy(x => x.SysId).FirstOrDefaultAsync(); Status?status = history?.Status; if (history != null) { _dbContext.History.Remove(history); } await _dbContext.SaveChangesAsync(); return(new History { Status = status }); }
public IEnumerable <QueueTime> TimeToWait(Status?status) { IEnumerable <CheckIn> query = context.CheckIns; { int AverageProcessingWait = 15; query = query.Where(c => c.Status == Status.Waiting && c.CheckInDate == DateTime.Today); var total = query.Sum(x => x.CategoryTime); return(query.GroupBy(e => e.Status).Select(g => new QueueTime() { Status = g.Key.Value, Count = g.Count(), TotalWait = (total + AverageProcessingWait) }).ToList()); } }
private async Task <OsuUser> CreateOsuUserAsync() { for (int tries = 0; tries < 30; tries++) { OsuUser osuUser = _osuFriends.CreateUser(); Status? status = await osuUser.GetStatusAsync(); _logger.LogTrace("Verification Status: {status}", status); if (status == Status.Invalid) { return(osuUser); } } return(null); }
public override void Reject(Person rejectingPerson, string reason) { if (rejectingPerson is Student) { throw new ArgumentException("Theme request can't be rejected by student"); } if (rejectingPerson is Teacher) { TeacherResponse = Models.Status.REJECTED; } else { CafedraResponse = Models.Status.REJECTED; } base.Reject(rejectingPerson, reason); }
public PageResult <PermDto> GetList(int pageSize = 0, int pageNo = 1, string uid = "", Status?status = null, string permCode = "", string permName = "", PermType?permType = null, string menuGuid = "", string actionCode = "") { var cond = new PermDto { Uid = uid, Status = status, Code = permCode, Name = permName, Type = permType, MenuGuid = menuGuid, ActionCode = actionCode }; return(base.GetPagedList(cond, pageSize, pageNo)); }
public Task <IEnumerable <Parcel> > BrowseAsync(Size?size = null, Status?status = null) { var parcels = _parcels.AsEnumerable(); if (size.HasValue) { parcels = parcels.Where(p => p.Size == size); } if (status.HasValue) { parcels = parcels.Where(p => p.Status == status); } return(Task.FromResult(parcels)); }
/// <summary> /// Initializes a new instance of EntityEntry. /// </summary> /// <param name="status">The current <see cref="Status"/> of the Entity.</param> /// <param name="loadedState">The snapshot of the Entity's state when it was loaded.</param> /// <param name="rowId"></param> /// <param name="id">The identifier of the Entity in the database.</param> /// <param name="version">The version of the Entity.</param> /// <param name="lockMode">The <see cref="LockMode"/> for the Entity.</param> /// <param name="existsInDatabase">A boolean indicating if the Entity exists in the database.</param> /// <param name="persister">The <see cref="IEntityPersister"/> that is responsible for this Entity.</param> /// <param name="entityMode"></param> /// <param name="disableVersionIncrement"></param> /// <param name="lazyPropertiesAreUnfetched"></param> internal EntityEntry(Status status, object[] loadedState, object rowId, object id, object version, LockMode lockMode, bool existsInDatabase, IEntityPersister persister, EntityMode entityMode, bool disableVersionIncrement, bool lazyPropertiesAreUnfetched) { this.status = status; this.previousStatus = null; // only retain loaded state if the status is not Status.ReadOnly if (status != Status.ReadOnly) { this.loadedState = loadedState; } this.id = id; this.rowId = rowId; this.existsInDatabase = existsInDatabase; this.version = version; this.lockMode = lockMode; isBeingReplicated = disableVersionIncrement; loadedWithLazyPropertiesUnfetched = lazyPropertiesAreUnfetched; this.persister = persister; this.entityMode = entityMode; entityName = persister == null ? null : persister.EntityName; }
private void UpdateWithoutTransition(BuildStatus status) { if (_lastStatus == null || _lastStatus != status.Status) { FileLogger.Logger.LogInformation("{0}\t {1}\tStatus = '{2}'", DateTime.Now.ToString(CultureInfo.InvariantCulture), status.Name, status.Status); _traceFile.WriteLine("{0}\t {1}\tStatus = '{2}'", DateTime.Now.ToString(CultureInfo.InvariantCulture), status.Name, status.Status); _traceFile.Flush(); _lastStatus = status.Status; } }
public void Sleep() { _traceFile.Flush(); _lastStatus = Status.Unknown; }
public void UpdateTripStatus(bool notifyPartner, Status status, Location driverLocation = null, DateTime? eta = null) { if (TripStatusHasChanged(status, driverLocation, eta)) { Logger.Log("Trip status changed from " + _status + " to " + status + (driverLocation != null ? (" and driver's location has changed to " + driverLocation) : "") + (eta != null ? (" and eta has changed to " + eta) : "")); _status = status; if (driverLocation != null) this.driverLocation = driverLocation; if (eta != null) this.ETA = eta; if (IsOneOfTheActiveTrips()) { partner.activeTrips[ID].Status = status; if (TripHasForeignDependency() && lastStatusNotifiedToPartner != status && notifyPartner) NotifyForeignPartner(status, driverLocation, eta); } else Logger.Log("Cannot set status: because cannot find active trip with ID = " + this.ID); } if (status == Status.Complete) { if (service == Origination.Foreign) { Gateway.GetTripStatusResponse resp = GetStatsFromForeignServiceProvider(); partner.DeactivateTripAndUpdateStats(ID, Status.Complete, resp.price, resp.distance); } else partner.DeactivateTripAndUpdateStats(ID, Status.Complete, PartnerFleet.GetPrice(this), PartnerFleet.GetDistance(this)); } else if (status == Status.Cancelled || status == Status.Rejected) partner.DeactivateTripAndUpdateStats(ID, status); lastStatusNotifiedToPartner = status; }
private void UpdateWithoutTransition(BuildStatus status) { if (_lastStatus == null || _lastStatus != status.Status) { FileLogger.Logger.LogInformation("Publishing to Visualiser: {0} with a status of {1}", Name, status.Status); switch (status.Status) { case Status.Success: _controller.SetColor(new DelcomLight(Colors.Green, Modes.On)); break; case Status.Unknown: _controller.SetColor(new DelcomLight(Colors.Yellow, Modes.Flash)); break; case Status.InProgress: _controller.SetColor(new DelcomLight(Colors.Yellow, Modes.On)); break; case Status.Error: _controller.SetColor(new DelcomLight(Colors.Red, Modes.Flash)); break; case Status.Failed: _controller.SetColor(new DelcomLight(Colors.Red, Modes.On)); break; case Status.FailedInProgress: _controller.SetColor(new DelcomLight(Colors.Red, Modes.On), new DelcomLight(Colors.Yellow, Modes.Flash)); break; case Status.SuccessInProgress: _controller.SetColor(new DelcomLight(Colors.Green, Modes.On), new DelcomLight(Colors.Yellow, Modes.Flash)); break; } _lastStatus = status.Status; } }
public GetTripStatusResponse(string partnerID = null, string partnerName = null, string fleetID = null, string fleetName = null, string originatingPartnerName = null, string servicingPartnerName = null, string driverID = null, string driverName = null, Location driverLocation = null, VehicleType? vehicleType = null, string passengerName = null, DateTime? ETA = null, Status? status = null, DateTime? pickupTime = null, Location pickupLocation = null, DateTime? dropoffTime = null, Location dropoffLocation = null, double? price = null, double? distance = null, double? driverRouteDuration = null, Result result = Result.OK ) { this.partnerID = partnerID; this.partnerName = partnerName; this.fleetID = fleetID; this.fleetName = fleetName; this.passengerName = passengerName; this.driverID = driverID; this.driverName = driverName; this.driverLocation = driverLocation; this.vehicleType = vehicleType; this.ETA = ETA; this.pickupTime = pickupTime; this.pickupLocation = pickupLocation; this.dropoffLocation = dropoffLocation; this.dropoffTime = dropoffTime; this.price = price; this.distance = distance; this.driverRouteDuration = driverRouteDuration; this.result = result; this.status = status; this.originatingPartnerName = originatingPartnerName; this.servicingPartnerName = servicingPartnerName; }
public GetTripsRequest(string clientID, Status? status = null) { this.clientID = clientID; this.status = status; }
public void Sleep() { _controller.Off(); _lastStatus = Status.Unknown; _transitionController.Clear(); }
/// <summary> /// After actually deleting a row, record the fact that the instance no longer /// exists in the database /// </summary> public void PostDelete() { previousStatus = status; status = Status.Gone; existsInDatabase = false; }