Esempio n. 1
0
        public void AddContribution(decimal amount, int fundId, string progName, string levelName,
				char? option, bool makeAnon, string acknowlName, int tributeTypeId,
				bool declineBenefits, bool plansCorpMatch, string corpName)
        {
            base.AddContribution(amount, fundId);
            Cart cart = GetCart();
            Contribution lastCont = (from cont in cart.Contributions
                                     orderby cont.Id descending
                                     select cont).First<Contribution>();
            ContributionCustomData data = new ContributionCustomData(progName, levelName, option,
                    makeAnon, acknowlName, tributeTypeId, declineBenefits, plansCorpMatch,
                    corpName);
            UpdateContributionCustomData(lastCont.Id.Value, 10, data.ToString());
        }
Esempio n. 2
0
 public void RecordFinalizedContributions(ContributionCollection conts)
 {
     foreach (Contribution cont in conts)
     {
         Dictionary<string,string> sqlParams = new Dictionary<string,string>();
         sqlParams.Add("ref_no", cont.Id.Value.ToString());
         ContributionCustomData data = new ContributionCustomData(cont.Custom0);
         sqlParams.Add("ack_name", data.AcknowlName);
         sqlParams.Add("anonymous", data.MakeAnon ? "Y" : "N");
         sqlParams.Add("tribute_type_no", data.TributeTypeId.ToString());
         sqlParams.Add("decline_benefits", data.DeclineBenefits ? "Y" : "N");
         sqlParams.Add("company_match", data.PlansCorpMatch ? "Y" : "N");
         sqlParams.Add("company_match_name", data.CorpName);
         if (data.Option.HasValue)
         {
             sqlParams.Add("opt", data.Option.Value.ToString());
         }
         Tess.ExecuteLocalProcedure(Key, 8017, sqlParams);
     }
 }
Esempio n. 3
0
 protected void OutputContributions(StringBuilder output, Cart cart)
 {
     if (cart.Contributions == null || cart.Contributions.Count == 0)
     {
         return;
     }
     output.AppendLine("<div id=\"ContribSection\" class=\"CartSection\">");
     output.AppendLine("<h3>Contributions</h3>");
     output.AppendLine("<ul>");
     foreach (Contribution cont in cart.Contributions)
     {
         output.AppendLine("<li>");
         output.AppendLine("<div class=\"CartItemDesc\">");
         if (String.IsNullOrWhiteSpace(cont.Custom0))
         {
             output.AppendLine("donation");
         }
         else
         {
             ContributionCustomData data = new ContributionCustomData(cont.Custom0);
             output.Append((data.ProgName ?? String.Empty) + " - "
                     + (data.LevelName ?? String.Empty) + System.Environment.NewLine);
         }
         output.AppendLine("</div>");
         output.AppendLine("<div class=\"CartItemValue\">");
         output.AppendLine(cont.Amount.Value.ToString("C"));
         output.AppendLine("</div>");
         output.AppendLine("<div class=\"CartItemControls\">");
         output.AppendLine("<input type=\"submit\" value=\"Remove\" name=\"remove_cont_"
                 + cont.Id.Value + "\"/>");
         output.AppendLine("</div>");
         output.AppendLine("</li>");
     }
     output.AppendLine("</ul>");
     output.AppendLine("</div>");
 }