/// <summary> Wallet transfer. </summary> /// /// <remarks> Paul, 22/12/2014. </remarks> /// /// <param name="amount"> The amount. </param> /// <param name="asset"> The asset. </param> /// <param name="fromAccount"> from account. </param> /// <param name="toAccount"> to account. </param> /// <param name="memo"> (Optional) the memo. </param> /// <param name="voteMethod"> (Optional) the vote method. </param> /// /// <returns> A BitsharesTransactionResponse. </returns> public BitsharesTransactionResponse WalletTransfer(decimal amount, string asset, string fromAccount, string toAccount, string memo = "", VoteMethod voteMethod = VoteMethod.vote_recommended) { memo = TrucateMemo(memo); return(ApiPostSync <BitsharesTransactionResponse>(BitsharesMethods.wallet_transfer, amount, asset, fromAccount, toAccount, memo, voteMethod)); }
public IActionResult VoteSite(VoteDetail vd) { VoteMethod vm = new VoteMethod(); int i = 0; string error = ""; int temp = Convert.ToInt32(HttpContext.Session.GetInt32("extraInfo")); i = vm.InsertVote(vd, temp, out error); ViewBag.error = error; UserMethod um = new UserMethod(); um.SetHasVotedToTrue(HttpContext.Session.GetString("AdminID"), out string errormsg1); um.SetHasVotedToTrue(HttpContext.Session.GetString("UserID"), out string errormsg); return(RedirectToAction("NomineesToVoteOn")); }
public IActionResult Motivations(int id) { if (HttpContext.Session.GetString("AdminID") != null) { NomineeMethod nm = new NomineeMethod(); NomineeDetail nd = nm.GetNomineeById(id, out string errormsg); List <VoteDetail> voteList = new List <VoteDetail>(); VoteMethod vm = new VoteMethod(); voteList = vm.GetMotivationListById(id, out string msg); ViewBag.Name = nd.Nominee_FirstName + " " + nd.Nominee_LastName; return(View(voteList)); } else { return(RedirectToAction("AdminLogin")); } }
public static RuleExpr <T, RuleExprContext <Unit> > LiftImpl <T>(this RuleExpr <Option <T>, RuleExprContext <string> > sRule, VoteMethod <T> vote, IEnumerable <string> sKeys) { return(mcontext => { var scontext = mcontext.WithSelector <string>(null); var result = new List <Option <T> >(); foreach (var applicant in mcontext.Applicants) { scontext = scontext.WithSelector(applicant.Key); var(maybea, newSContext) = sRule(scontext); scontext = newSContext; if (!maybea.IsSome(out var a)) { throw new Exception("Internal error. Lifting failed. Exception scope did not catch error as expected."); } result.Add(a); } return (vote(result), scontext.WithSelector(Unit.Value)); }); }
public static RuleExprAst <T, RuleExprContext <Unit> > Lift <T>(this RuleExprAst <T, RuleExprContext <string> > sRuleExprAst, VoteMethod <T> vote) { var sRule = sRuleExprAst.ExceptionContext().Compile(); var sKeys = sRuleExprAst.GetKeys(); return(new RuleExprAst <T, RuleExprContext <Unit> > { Expression = mcontext => sRule.LiftImpl(vote, sKeys)(mcontext) }); }