/// <summary>The method was already called in the stack.</summary> public void RecursiveCall(ICallInfo callInfo, ActionSet callerSet) { // Push object array. if (_builder.Controller.Attributes.RecursiveRequiresObjectStack) { actionSet.AddAction(_objectStore.ModifyVariable(Operation.AppendToArray, (Element)callerSet.CurrentObject)); } // Push new parameters. _builder.ParameterHandler.Push(callerSet, callInfo.Parameters.Select(p => p.Value).ToArray()); // Add to the continue skip array. var skipLength = new NumberElement(); actionSet.AddAction(_continueArray.ModifyVariable( Operation.AppendToArray, skipLength )); // Restart the method. SkipStartMarker resetSkip = new SkipStartMarker(actionSet); resetSkip.SetEndMarker(_endOfMethod); actionSet.AddAction(resetSkip); SkipEndMarker continueAtMarker = new SkipEndMarker(); actionSet.AddAction(continueAtMarker); skipLength.Value = _continueAt.NumberOfActionsToMarker(continueAtMarker); }
NumberElement calculate(NumberElement left, NumberElement right, OperatorElement op) { Double temp = Double.MaxValue; if (op.type == OperatorType.ADD) { temp = left.getNumber() + right.getNumber(); } else if (op.type == OperatorType.SUBTRACT) { temp = left.getNumber() - right.getNumber(); } else if (op.type == OperatorType.MULTIPLY) { temp = left.getNumber() * right.getNumber(); } else if (op.type == OperatorType.DIVIDE) { temp = left.getNumber() / right.getNumber(); } else if (op.type == OperatorType.EXPONENTIAL) { temp = Math.Pow(left.getNumber(), right.getNumber()); } return(new NumberElement(temp.ToString())); }
public Double Evaluate(List <Element> e) { List <Element> v = new List <Element>(e); for (int i = 0; i < v.Count; i++) { Element element = v[i]; if (element.GetType().Equals(typeof(NumberElement))) { stack.Push(element); } if (element.GetType().Equals(typeof(OperatorElement))) { NumberElement right = (NumberElement)stack.Pop(); NumberElement left = (NumberElement)stack.Pop(); NumberElement result = calculate(left, right, (OperatorElement)element); stack.Push(result); } } return(((NumberElement)stack.Pop()).getNumber()); }
public static Element GetElementFromObject(object model) { Element element = null; if (model == null) { element = new NullElement(); } else { var type = model.GetType(); if (Array.IndexOf(Constants.NumberTypes, type) >= 0) { element = new NumberElement(); } else if (Array.IndexOf(Constants.StringTypes, type) >= 0) { element = new StringElement(); } else if (Array.IndexOf(Constants.BooleanTypes, type) >= 0) { element = new BooleanElement(); } else if (typeof(IEnumerable).IsAssignableFrom(type)) { element = new ArrayElement(); } else { element = new ObjectElement(); } element.PopulateElement(model); } return(element); }
} // приоритет билета в очереди public override string ToString() { var ticketName = Prefix + NumberElement.ToString("000"); return($"; Дата добавления в очередь: {AddedTime}; Дата поступления в обработку: {StartProcessingTime}; Дата окончания обработки: {EndProcessingTime}; Номер билета: {ticketName}; Номер кассира: {Cashbox?.ToString() ?? "неизвестный кассир" } "); }
public void BuildInterface() { if (Root == null) { Root = new RootElement (""); } Root.Clear (); String name = ""; if (searchResult != null) { name = searchResult.matterName; } headerLabel = new UILabel (new RectangleF (40, 10, 620, 40)) { Font = UIFont.BoldSystemFontOfSize (20), BackgroundColor = ColorHelper.GetGPPurple (), TextAlignment = UITextAlignment.Center, TextColor = UIColor.White, Text = name }; var view = new UIViewBordered (); view.Frame = new RectangleF (40, 10, 620, 40); view.Add (headerLabel); var topSection = new Section (view); Root.Add (topSection); // var sec = new Section (""); matterName = new TitleElement ("Matter Details"); if (searchResult != null) { ownerName = new StringsElement ("Owner", searchResult.currentOwner); matterID = new NumberElement ( Convert.ToInt16 (searchResult.matterID), "Matter ID"); if (searchResult.matterLegacyAccount == null || searchResult.matterLegacyAccount.Trim () == "") { //ignore } else { legacy = new StringsElement ( "Legacy Account", searchResult.matterLegacyAccount ); } clientName = new StringsElement ("Client", "" + searchResult.clientName); } // var sec2 = new Section (""); if (matter == null) { busBal = new FinanceElement (S.GetText (S.BUSINESS_BALANCE) + ":", 0.00); currBal = new FinanceElement (S.GetText (S.CURRENT_BALANCE) + ":", 0.00); trustBal = new FinanceElement (S.GetText (S.TRUST_BALANCE) + ":", 0.00); reserveTrust = new FinanceElement (S.GetText (S.RESERVE_TRUST) + ":", 0.00); unbilled = new FinanceElement (S.GetText (S.UNBILLED_BALANCE) + ":", 0.00); pending = new FinanceElement (S.GetText (S.PENDING_DISBURSEMENTS) + ":", 0.00); investTrust = new FinanceElement (S.GetText (S.INVESTMENT_TRUST) + ":", 0.00); } else { busBal = new FinanceElement (S.GetText (S.BUSINESS_BALANCE) + ":", matter.businessBalance, deviceType); currBal = new FinanceElement (S.GetText (S.CURRENT_BALANCE) + ":", matter.currentBalance, deviceType); unbilled = new FinanceElement (S.GetText (S.UNBILLED_BALANCE) + ":", matter.unbilledBalance, deviceType); trustBal = new FinanceElement (S.GetText (S.TRUST_BALANCE) + ":", matter.trustBalance, deviceType); reserveTrust = new FinanceElement (S.GetText (S.RESERVE_TRUST) + ":", matter.reserveTrust, deviceType); pending = new FinanceElement (S.GetText (S.PENDING_DISBURSEMENTS) + ":", matter.pendingDisbursementBalance, deviceType); investTrust = new FinanceElement (S.GetText (S.INVESTMENT_TRUST) + ":", matter.investmentTrustBalance, deviceType ); } // sec.Add (matterName); sec.Add (clientName); sec.Add (ownerName); sec.Add (matterID); Root.Add (sec); // sec2.Add (busBal); sec2.Add (trustBal); sec2.Add (investTrust); sec2.Add (currBal); sec2.Add (reserveTrust); sec2.Add (unbilled); sec2.Add (pending); if (legacy != null) { sec2.Add (legacy); } Root.Add (sec2); }
public void buildFeeTargetReport() { //NumberFormatInfo nfi = new CultureInfo ("en-US", false).NumberFormat; Root = new RootElement ("Fee Target Progress"); var v = new UIView (); v.Frame = new RectangleF (10, 10, 600, 10); var dummy = new Section (v); Root.Add (dummy); var headerLabel = new UILabel (new RectangleF (10, 10, 800, 48)) { Font = UIFont.BoldSystemFontOfSize (18), BackgroundColor = ColorHelper.GetGPPurple (), TextAlignment = UITextAlignment.Center, TextColor = UIColor.White, Text = "Practice Fee Target Progress" }; var view = new UIViewBordered (); view.Frame = new RectangleF (10, 20, 800, 48); view.Add (headerLabel); Root.Add (new Section (view)); PracticeTotals totals = this.report.practiceTotals; var ptLabel = new UILabel (new RectangleF (10, 10, 800, 24)) { Font = UIFont.BoldSystemFontOfSize (24), TextAlignment = UITextAlignment.Center, TextColor = ColorHelper.GetGPPurple (), Text = "Practice Totals" }; var totSection = new Section ("Practice Totals"); var tot1 = new BigFinanceElement ("Invoiced MTD Total: ", totals.invoicedMTDTotal); totSection.Add (tot1); Root.Add (totSection); if (totals.recordedMTD != null) { var mtdSection = new Section ("Recorded MTD"); mtdSection.Add (getElement (totals.recordedMTD.achieved, "Achieved: ")); mtdSection.Add (getElement (totals.recordedMTD.estimatedTarget, "Estimated Target: ")); mtdSection.Add (getElement (totals.recordedMTD.invoicedDebits, "Invoiced Debits: ")); mtdSection.Add (getElement (totals.recordedMTD.unbilled, "Unbilled: ")); mtdSection.Add (getElement (totals.recordedMTD.total, "Total: ")); Root.Add (mtdSection); } if (totals.recordedYTD != null) { var mtdSection = new Section ("Recorded YTD"); mtdSection.Add (getElement (totals.recordedYTD.achieved, "Achieved: ")); mtdSection.Add (getElement (totals.recordedYTD.estimatedTarget, "Estimated Target: ")); mtdSection.Add (getElement (totals.recordedYTD.invoiced, "Invoiced: ")); mtdSection.Add (getElement (totals.recordedYTD.unbilled, "Unbilled: ")); mtdSection.Add (getElement (totals.recordedYTD.total, "Total: ")); Root.Add (mtdSection); } if (totals.matterActivity != null) { var matterActivitySection = new Section ("Matter Activity"); var tot2 = new NumberElement (totals.matterActivity.active, "Active Matters: "); matterActivitySection.Add (tot2); var tot3 = new NumberElement (totals.matterActivity.deactivated, "Deactivated Matters: "); matterActivitySection.Add (tot3); var tot4 = new NumberElement (totals.matterActivity.newWork, "New Work: "); matterActivitySection.Add (tot4); var tot5 = new NumberElement (totals.matterActivity.noActivity, "No Activity: "); matterActivitySection.Add (tot5); var tot6 = new StringElement ("No Activity Duration: " + totals.matterActivity.noActivityDuration); matterActivitySection.Add (tot6); Root.Add (matterActivitySection); } // if (totals.matterBalances != null) { var matterBalancesSection = new Section ("Matter Balances"); matterBalancesSection.Add (getElement (totals.matterBalances.business, "Business: ")); matterBalancesSection.Add (getElement (totals.matterBalances.unbilled, "Unbilled: ")); matterBalancesSection.Add (getElement (totals.matterBalances.trust, "Trust Balance: ")); matterBalancesSection.Add (getElement (totals.matterBalances.investment, "Investments: ")); Root.Add (matterBalancesSection); } for (var i = 0; i < 10; i++) { Root.Add (new Section (" ")); } }
} // количество попыток обработки этого билета кассиром public override string ToString() { var ticketName = Prefix + NumberElement.ToString("000"); return($" Дата поступления в обработку: {AddedTime} Номер билета: {ticketName} Номер кассира: { Сashbox?.ToString() ?? "неизвестный кассир" } "); }