public Report(User reported, Channel channel, Reasons reason, string reasonInfo = "") { this.reported = reported; this.reason = reason; this.channel = channel; this.reasonInfo = reasonInfo; }
// <summary> /// 确认提交方法 /// </summary> public void button_ok() { if (this.TxtDiscount.Text != null) { string price_fixed = double.Parse(this.TxtDiscount.Text).ToString("0.00"); Member mb = new Member(); mb = (Member)this.Owner; mb.KeyPreview = true; mb.panelChildren.Controls.Remove(this); mb.panelInfor.Visible = true; mb.lbTitle.Text = "支付信息"; if (PassValue.payments.Count != 0 && PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault() != null) { mb.lbReceiveActual.Text = (mb.Price_Recive + double.Parse(price_fixed) - double.Parse(PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault().amount)).ToString("0.00"); PassValue.payments.Remove(PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault()); } else { mb.lbReceiveActual.Text = (mb.Price_Recive + double.Parse(price_fixed)).ToString("0.00"); } //银联卡支付 Payment pm = new Payment(); pm.amount = double.Parse(this.TxtDiscount.Text).ToString("0.00"); pm.method = "other"; Reasons rs = new Reasons(); rs.description = this.lbReasons.Text; rs.id = reasonid[0]; pm.reason = rs; PassValue.payments.Add(pm); mb.panelChildren.Visible = true; Form_Esc(); } }
public bool Equals(DestinyReportReasonCategoryDefinition input) { if (input == null) { return(false); } return (( DisplayProperties == input.DisplayProperties || (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties)) ) && ( Reasons == input.Reasons || (Reasons != null && Reasons.SequenceEqual(input.Reasons)) ) && ( Hash == input.Hash || (Hash.Equals(input.Hash)) ) && ( Index == input.Index || (Index.Equals(input.Index)) ) && ( Redacted == input.Redacted || (Redacted != null && Redacted.Equals(input.Redacted)) )); }
public static string ReasonToString(Reasons reason) { switch (reason) { case Reasons.NoError: return("No error"); case Reasons.HostNotFound: return("Host not found"); case Reasons.ErrorCreatingPacket: return("Error creating packet"); case Reasons.CannotSendPacket: return("Cannot send packet"); case Reasons.HostNotResponding: return("Host not responding"); case Reasons.TimeOut: return("Time out"); default: return("Unknown reason"); } }
private void DeleteReason(object ignored) { if (SelectedReason == null) { return; } if (SelectedReason.ID != 0) { this.interactionRequest.Raise( new Confirmation { Content = "Confirm to remove this?", Title = "Confirm" }, c => { if (c.Confirmed) { if (InitDelete(SelectedReason.ID)) { OnLoaded(); } } }); } else { if (!string.IsNullOrEmpty(SelectedReason.ReasonDesc)) { Reasons.Remove(SelectedReason); } } }
/// <summary> /// Join two sets of results together. If either is a success, the result /// will be a success. /// </summary> public Result Or(Result otherResult) { Success |= otherResult.Success; Reasons = (!Success) ? Reasons.Union(otherResult.Reasons).Distinct().ToList() : new List <string>(); return(this); }
private void ExecuteDelete(object parameter) { IMessageBoxService msg = new MessageBoxService(); string title = "Deleting Reason"; string confirmtxt = "Do you want to delete the selected item"; if (Reasons.Where(x => x.IsChecked).Count() > 1) { title = title + "s"; confirmtxt = confirmtxt + "s"; } if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK)) { foreach (ModelBaseVM si in Reasons) { if (si.IsChecked) { if (si.ID > 0) { DeleteIncompleteProjectReason(si.ID); } deleteditems.Add(si); } } foreach (ModelBaseVM pm in deleteditems) { Reasons.Remove(pm); } deleteditems.Clear(); CheckValidation(); } msg = null; }
public ProcessException(Reasons reason, IntPtr hProcess, string moduleName, string procName) : base($"{reason.ToString()}\nprocess handle: 0x{hProcess.ToString("x8")}\nmodule: {moduleName}\nproc: {procName}") { Reason = reason; ProcessHandle = hProcess; ModuleName = moduleName; ProcName = procName; }
public virtual void ReceiveMoveReason(Reasons reason, string code) { try { if (reason == null) { throw new ArgumentNullException("reason"); } using (var trans = RF.TransactionScope(BDEntityDataProvider.ConnectionStringName)) { Reasons model = DomainControllerFactory.Create <ReasonsController>().GetReason(reason.Name, reason.MoveType) as Reasons; var existReason = model ?? reason; //existReason.Name = reason.Name; existReason.Description = reason.Description; existReason.ReasonsType = ReasonsType.MOVER; // InvOrgIdExtension.SetInvOrgId(existReason, PlatformEnvironment.InvOrgId); RF.Save(existReason); trans.Complete(); } } catch (Exception e) { throw new Exception("移动原因数据下载异常:" + e); } }
private bool IsInvalidValidChars() { char[] chars = { ';', ',' }; int invalid = Reasons.Where(x => x.Name.IndexOfAny(chars) != -1).Count(); return(invalid > 0); }
public void Update(DestinyReportReasonCategoryDefinition?other) { if (other is null) { return; } if (!DisplayProperties.DeepEquals(other.DisplayProperties)) { DisplayProperties.Update(other.DisplayProperties); OnPropertyChanged(nameof(DisplayProperties)); } if (!Reasons.DeepEqualsDictionary(other.Reasons)) { Reasons = other.Reasons; OnPropertyChanged(nameof(Reasons)); } if (Hash != other.Hash) { Hash = other.Hash; OnPropertyChanged(nameof(Hash)); } if (Index != other.Index) { Index = other.Index; OnPropertyChanged(nameof(Index)); } if (Redacted != other.Redacted) { Redacted = other.Redacted; OnPropertyChanged(nameof(Redacted)); } }
/// <summary> /// Writes off the current sale /// </summary> /// <param name="reasonForWriteOff">Reason for writing off the sale</param> /// <returns>New WriteOff Model</returns> public async Task <WriteOff> WriteOff(Reasons reasonForWriteOff) { var writeOff = await _serializeManager.WriteOff(reasonForWriteOff); await _reportsBusinessLogic.SaveReport(writeOff.Receipt); return(writeOff); }
private void ProductNames_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e) { if (e.PropertyName != "IsChecked") { CheckValidation(); isdirty = true; } IsSelected = Reasons.Where(x => x.IsChecked).Count() > 0; }
public async Task <VoidSale> VoidSale(Reasons reason) { var action = new VoidSaleSerializeAction(_saleRestClient, _cacheManager, reason); await PerformTask(action); return((VoidSale)action.ResponseValue); }
private void SendToVoidSaleOnSwitchUser(Reasons reasons) { _fuelPrices = null; _bottleReturnSale = null; _isVoidSaleToBeCompleted = true; _lineNumberToBeDeleted = 0; _pumpId = 0; _setPostPayMessage = null; }
private void ExecuteAddNew(object parameter) { Reasons.Add(new ModelBaseVM() { Name = string.Empty, IsEnabled = true, IsChecked = false }); ScrollToIndex = Reasons.Count() - 1; CheckValidation(); }
private bool IsDuplicateName() { var query = Reasons.GroupBy(x => x.Name.Trim().ToUpper()) .Where(g => g.Count() > 1) .Select(y => y.Key) .ToList(); return(query.Count > 0); }
public bool DeepEquals(DestinyReportReasonCategoryDefinition?other) { return(other is not null && (DisplayProperties is not null ? DisplayProperties.DeepEquals(other.DisplayProperties) : other.DisplayProperties is null) && Reasons.DeepEqualsDictionary(other.Reasons) && Hash == other.Hash && Index == other.Index && Redacted == other.Redacted); }
/// <summary> /// Writes off the current sale /// </summary> /// <param name="reasonForWriteOff">Reason for Writing off the sale</param> /// <returns>Write off Model</returns> public async Task <WriteOff> WriteOff(Reasons reasonForWriteOff) { var action = new WriteOffSerializeAction(_saleRestClient, _cacheManager, reasonForWriteOff); await PerformTask(action); return((WriteOff)action.ResponseValue); }
public VoidSaleSerializeAction( ISaleRestClient saleRestClient, ICacheManager cacheManager, Reasons reason) : base("VoidSale") { _saleRestClient = saleRestClient; _cacheManager = cacheManager; _reason = reason; }
public WriteOffSerializeAction( ISaleRestClient saleRestClient, ICacheManager cacheManager, Reasons reason) : base("WriteOff") { _saleRestClient = saleRestClient; _cacheManager = cacheManager; _reason = reason; }
protected override async System.Threading.Tasks.Task onInit() { if (Reasons.Count < 1) { var lookups = await DataService.GetLookups(3); lookups.AttendanceReasons.ForEach(ar => Reasons.Add(ar)); lookups.Users.ForEach(u => Users.Add(u)); } }
public bool DeepEquals(DestinyReportReasonCategoryDefinition other) { return(other != null && DisplayProperties.DeepEquals(other.DisplayProperties) && Reasons.DeepEqualsReadOnlyDictionaryWithSimpleKeyAndEquatableValue(other.Reasons) && Blacklisted == other.Blacklisted && Hash == other.Hash && Index == other.Index && Redacted == other.Redacted); }
void ShuffleReasonsList(List <Reasons> reasonList) { for (int i = reasonList.Count - 1; i > 0; i--) { int rand = Random.Range(0, i); Reasons temp = reasonList[i]; reasonList[i] = reasonList[rand]; reasonList[rand] = temp; } }
public void Init() { if (Student != null) { switch (BookingType) { case BookingType.green: { _myBookingList = BookingLists.FirstOrDefault(); break; } case BookingType.yellow: { var list = BookingLists.FirstOrDefault(x => x.Curricula.Any(c => c.Id == Student.Curriculum.Id)); if (list != null) { _myBookingList = list; } else { _myBookingList = BookingLists.FirstOrDefault(x => !x.Curricula.Any()); } break; } case BookingType.red: { _myBookingList = BookingLists.FirstOrDefault(x => x.Curricula.Any(c => c.Id == Student.Curriculum.Id)); break; } } } if (!Occurrence.IsAvailable) { IsAvailable = false; Reasons.Add("Eintragung ist von Admin-Seite aus gesperrt worden."); } if (BookingType == BookingType.red && _myBookingList == null) { IsAvailable = false; Reasons.Add("Diese Lehrveranstaltung steht für meinen Studiengang nicht zur Verfügung."); } if (_myBookingList != null && _myBookingList.Capacity >= 0) { IsUnrestricted = false; AvailableSeats = _myBookingList.Capacity - _myBookingList.Participients.Count; } }
public OperationStatus With(OperationStatus operationStatus) { var newFlag = Flag | operationStatus.Flag; newFlag = (this.Failed() || operationStatus.Failed()) ? newFlag.RemoveFlag(OperationStatusFlag.Succeeded) : newFlag; newFlag = newFlag.Succeeded() ? newFlag.RemoveFlag(OperationStatusFlag.BestEffort) : newFlag; var reasons = Reasons.Concat(operationStatus.Reasons); return(new OperationStatus(newFlag, reasons)); }
public OperationStatus With(OperationStatusFlag flag, string reason) { var newFlag = Flag | flag; newFlag = (this.Failed() || flag.Failed()) ? newFlag.RemoveFlag(OperationStatusFlag.Succeeded) : newFlag; newFlag = newFlag.Succeeded() ? newFlag.RemoveFlag(OperationStatusFlag.BestEffort) : newFlag; var reasons = reason == null ? Reasons : Reasons.Concat(reason); return(new OperationStatus(newFlag, reasons)); }
public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime() + HistoricalFigure.ToLink(link, pov, this); string situationString = ""; switch (Situation) { case ConfrontSituation.GeneralSuspicion: situationString = "aroused general suspicion"; break; case ConfrontSituation.Unknown: situationString = "(" + _unknownSituation + ")"; break; } eventString += " " + situationString; if (Region != null) { eventString += " in " + Region.ToLink(link, pov, this); } if (Site != null) { eventString += " at " + Site.ToLink(link, pov, this); } string reasonString = "after "; int unknownReasonIndex = 0; foreach (ConfrontReason reason in Reasons) { switch (reason) { case ConfrontReason.Murder: reasonString += "a murder"; break; case ConfrontReason.Ageless: reasonString += "appearing not to age"; break; case ConfrontReason.Unknown: reasonString += "(" + _unknownReasons[unknownReasonIndex++] + ")"; break; } if (reason != Reasons.Last() && Reasons.Count > 2) { reasonString += ","; } if (Reasons.Count > 1 && reason == Reasons[Reasons.Count - 2]) { reasonString += " and "; } } eventString += " " + reasonString; eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
protected override void populateDisplayItem(DisplayItem item, DataLayer.Models.Attendance attendance) { attendance.AttendanceReason = Reasons.FirstOrDefault(r => r.AttendanceReasonId == attendance.AttendanceReasonId) ?? attendance.AttendanceReason; attendance.User = Users.FirstOrDefault(u => u.UserId == attendance.UserId) ?? attendance.User; item.Line1 = attendance.AttendanceDateValue.ToShortDateString() + (ForUser ? "" : " - " + (attendance.User == null ? string.Empty : attendance.User.DisplayName)); item.Line2 = attendance.AttendanceReason.ReasonName; item.Line3 = attendance.Comments; item.Tag = attendance; item.Tag2 = string.IsNullOrEmpty(attendance.AttendanceReason.BackgroundColor) ? Color.White : Color.FromHex(attendance.AttendanceReason.BackgroundColor); item.Tag3 = !string.IsNullOrEmpty(attendance.Comments); }
public void AddReason(decimal score, string reason, StockTrend trend = StockTrend.Bullish, bool isSignificant = false) { if (trend == StockTrend.Bearish && score > 0) { score = score * -1; } Reasons.Add(new ReasonScore { Reason = reason, Score = score, Trend = trend, IsSignificant = isSignificant }); }
/// <summary> /// Voids the ongoing sale /// </summary> /// <param name="reason">Reason for voiding sale</param> /// <returns>Updated sale model</returns> public async Task <VoidSale> VoidSale(Reasons reason) { var response = await _serializeManager.VoidSale(reason); if (response.Receipt != null) { await _reportsBusinessLogic.SaveReport(response.Receipt); } return(response); }
/// <summary> /// Constructs arguments for a cast failed event. /// </summary> public CastFailedEventArgs(ISpellHandler handler, Reasons reason) : base(handler) { this.m_reason = reason; }
public RulesCheckerResult(Reasons reason, string reasonString) { this.reason = reason; this.textReason = reasonString; }
public ComponentAccessException(uint entityId, Type componentType, Reasons reason) { EntityId = entityId; ComponentType = componentType; Reason = reason; }
public RulesCheckerResult() { this.textReason = null; this.reason = Reasons.NOMATCH; }
public override void Parse(GameBitBuffer buffer) { ItemID = buffer.ReadUInt(32); Reason = (Reasons)buffer.ReadInt(3); }