/// <summary> /// Initializes a new instance of the <see cref="ReferralRejectionReason" /> class. /// </summary> /// <param name="campaignId">campaignId (required).</param> /// <param name="referralId">referralId (required).</param> /// <param name="reason">reason (required).</param> public ReferralRejectionReason(int campaignId = default(int), int referralId = default(int), ReasonEnum reason = default(ReasonEnum)) { // to ensure "campaignId" is required (not null) if (campaignId == null) { throw new InvalidDataException("campaignId is a required property for ReferralRejectionReason and cannot be null"); } else { this.CampaignId = campaignId; } // to ensure "referralId" is required (not null) if (referralId == null) { throw new InvalidDataException("referralId is a required property for ReferralRejectionReason and cannot be null"); } else { this.ReferralId = referralId; } // to ensure "reason" is required (not null) if (reason == null) { throw new InvalidDataException("reason is a required property for ReferralRejectionReason and cannot be null"); } else { this.Reason = reason; } }
protected override bool AuthorizeCore(HttpContextBase httpContext) { // Check if LoggedUserExists if (AuthenticationManager.LoggedUser == null) { Reason = ReasonEnum.Login; return false; } if (CheckType && AuthenticationManager.UserType.Value != UserType) { Reason = ReasonEnum.Role; return false; } // Users authorization if (!string.IsNullOrEmpty(Users)) { if (Users.Split(',').Any(u => string.Compare(u, AuthenticationManager.LoggedUser.Username, StringComparison.OrdinalIgnoreCase) == 0)) { return true; } } // If authorization is ok, return true return true; }
public IsLegalResponse(ReasonEnum reason = ReasonEnum.Fine) { this.Reason = reason; this.Killed = new List<Chain>(); this.MergeResultant = new Chain(); this.AbsorbedInMerge = new List<Chain>(); }
public MyEventSectorOwnerChanged(MyFaction oldOwner, MyFaction newOwner, MySector sector, ReasonEnum reason) : base(false) { OldOwner = oldOwner; NewOwner = newOwner ?? throw new ArgumentNullException(nameof(newOwner)); Sector = sector ?? throw new ArgumentNullException(nameof(sector)); _reason = reason; }
protected override bool AuthorizeCore(HttpContextBase httpContext) { // Check if LoggedUserExists if (AuthenticationManager.LoggedUser == null) { Reason = ReasonEnum.Login; return(false); } // Roles authorization if (!string.IsNullOrEmpty(Roles)) { if (!(Roles.Split(',').Any(role => string.Compare(role.Trim(), AuthenticationManager.LoggedUser.Role.ToString(), StringComparison.OrdinalIgnoreCase) == 0))) { Reason = ReasonEnum.Role; return(false); } } // Users authorization if (!string.IsNullOrEmpty(Users)) { if (Users.Split(',').Any(u => string.Compare(u, AuthenticationManager.LoggedUser.Username, StringComparison.OrdinalIgnoreCase) == 0)) { return(true); } } // If authorization is ok, return true return(true); }
public SessionEndedRequest(JObject json) : base(json) { ReasonEnum reason = ReasonEnum.UNKNOWN; Enum.TryParse(json.Value <string>("reason"), out reason); Reason = reason; Error = Error.FromJson(json.Value <JObject>("error")); }
/// <summary> /// Initializes a new instance of the <see cref="InvalidToShareUserDisplayDetails" /> class. /// </summary> /// <param name="Reason">The reason why the user was not valid for updating the share (required).</param> /// <param name="Username">The user's username (required).</param> /// <param name="Firstname">The user's first name (required).</param> /// <param name="Surname">The user's surname (required).</param> /// <param name="EmailAddress">The user's email address (required).</param> public InvalidToShareUserDisplayDetails(ReasonEnum Reason = default(ReasonEnum), string Username = default(string), string Firstname = default(string), string Surname = default(string), string EmailAddress = default(string)) { // to ensure "Reason" is required (not null) if (Reason == null) { throw new InvalidDataException("Reason is a required property for InvalidToShareUserDisplayDetails and cannot be null"); } else { this.Reason = Reason; } // to ensure "Username" is required (not null) if (Username == null) { throw new InvalidDataException("Username is a required property for InvalidToShareUserDisplayDetails and cannot be null"); } else { this.Username = Username; } // to ensure "Firstname" is required (not null) if (Firstname == null) { throw new InvalidDataException("Firstname is a required property for InvalidToShareUserDisplayDetails and cannot be null"); } else { this.Firstname = Firstname; } // to ensure "Surname" is required (not null) if (Surname == null) { throw new InvalidDataException("Surname is a required property for InvalidToShareUserDisplayDetails and cannot be null"); } else { this.Surname = Surname; } // to ensure "EmailAddress" is required (not null) if (EmailAddress == null) { throw new InvalidDataException("EmailAddress is a required property for InvalidToShareUserDisplayDetails and cannot be null"); } else { this.EmailAddress = EmailAddress; } }
private string GetStatusTranscription(ReasonEnum status) { string statusString; switch (status) { case ReasonEnum.None: statusString = "Aucun"; break; case ReasonEnum.Absent: statusString = "Autre"; break; case ReasonEnum.Formation: statusString = "Formation"; break; case ReasonEnum.Holiday: statusString = "Congé"; break; case ReasonEnum.Recover: statusString = "Récupération"; break; case ReasonEnum.Sickness: statusString = "Maladie"; break; default: statusString = "Aucun"; break; } return(statusString); }
public SessionEndedRequest(string requestId, string timestamp, string locale, ReasonEnum reason, Error error) { this.requestId = requestId; this.timestamp = timestamp; this.locale = locale; this.error = error; this.reason = reason; }
/// <summary> /// Constructor /// </summary> /// <param name="service">A Service to which the rule is added when created</param> /// <param name="result">Result of the rule</param> /// <param name="reason">Description of eventual failure reason</param> public ApplicationRule(IApplicationServiceWithRules <ApplicationRule> service, bool result, ReasonEnum reason) { Result = result; Reason = reason; service.AddRule(this); }
public SessionEndedRequest(string requestId, DateTime timestamp, string locale, ReasonEnum reason, Error error) : base(requestId, timestamp, locale) { Reason = reason; Error = error; }
public void ApplyLeave(string userName, DateTime startDate, DateTime endDate, int workingDays, ReasonEnum reason, string comment, DateTime? asAt = null) { asAt = asAt ?? DateTime.Now; Update(new LeaveApplied { WorkingDays = workingDays, UserName = userName, Comment = comment, StartDate = startDate, EndDate = endDate, Reason = reason, SourceId = Id, HappenedOn = asAt.Value, }); }
public void Set(ReasonEnum value) { Set(value.ToString()); }
public RequestResponse(ReasonEnum reason) { this.Reason = reason; }
public void ApplyLeave(string userName, DateTime startDate, DateTime endDate, int workingDays, ReasonEnum reason, string comment, DateTime?asAt = null) { asAt = asAt ?? DateTime.Now; Update(new LeaveApplied { WorkingDays = workingDays, UserName = userName, Comment = comment, StartDate = startDate, EndDate = endDate, Reason = reason, SourceId = Id, HappenedOn = asAt.Value, }); }