Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Customer should be able to redeem points only when the unredeemed reward points are above 100 Customer's balance should be increased when the rewards points

Customer should be able to redeem points only when the unredeemed reward points are above 100 Customer's balance should be increased when the rewards points are redeemed Partial redemption of points should not be allowed Only 10% of the redeemed points should get credited as amount to the wallet On skiccessful redemption, a success message along with the updated balance should be displayed In case of any error or exception, appropriate error message should be displayed . . wallet 2. 14. 1 Validations/Acceptance Criteria Customer should be able to see the balance available in E-wallet in the Home page 2.15 Yiou my wallet transactions . Customer should be able to see the transactions made using the wallet By default, only last 1 month transaction should be displayed Only 10 records should be displayed per page Filter options based on start date and end date also should be provided . .

Please make the code using these getters and setters:

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;

namespace AmigoWalletWebServices.Models { public class UserTransaction { public long UserTransactionId { get; set; } public string EmailId { get; set; } public decimal Amount { get; set; } public DateTime TransactionDateTime { get; set; } public byte PaymentTypeId { get; set; } public string Remarks { get; set; } public string Info { get; set; } public byte StatusId { get; set; } public short? PointsEarned { get; set; } public bool IsRedeemed { get; set; }

public decimal balance{ get; set; } } }

These are bits and pieces of the code done so far.

//Code for redeem points

using System.IO; using System;

namespace ewallet_code_david_snow { public class RedeemPoints { public static void Main() { int rp = 0; //redeem points double bal = 0; //balance Console.WriteLine(\"Enter Redeem points:\"); //Get the input from user for Redeem points rp = Convert.ToInt32(Console.ReadLine()); //convert the value to int Console.WriteLine(\"Enter the current balance:\"); bal = Convert.ToDouble(Console.ReadLine()); //convert the value to double if (rp > 100) { //only redeem points when > 100 Console.WriteLine(\"Customer is able to redeem points\"); rp = rp * 10 / 100; //as only 10 % of redeemed points should get credited bal += rp; //and then adding that to the existing balance amount Console.Write(\"Redeem Points amount\"); Console.Write(\" \" + bal); } else { Console.Write(\"Customer does not have enough points\"); Console.WriteLine(\"Error: Cannot update\"); }

/*Below scenarios are not specifically required Moreover partial redemption is not supported. In that case, we need to check only when rp > 100 as like above calculation if(rp >= 110){ Console.Write(bal *( 1.01)); } else if(rp >= 120){ Console.Write(bal * 1.03); } else if (rp >= 130){ Console.Write(bal * 1.05); } */ } } }

//code for displaying transaction log

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations;

namespace BindingDataFromDatabase.Model{ [key] public class AmigoWalletClass{ public DateTime transactionDate { get; set; } public string transactionInfo { get; set; } public string transactionType { get; set; } public double amount { get; set; } public bool status { get; set; } }

These are all the codes in C#, However for the transaction log I will provide the code with the DB and HTML that I've done so far to help with the C# part.

//Index.cshtml.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Mircrosft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; using Microsoft.EntityFrameworkCore; using BindingDataFromDatabase.Model;

namespace BindingDataFromDatabase.Pages { public class IndexModel : PageModel { private readonly ConnectionDBClass _db; public IndexModel (ConnectionDBClass db) { _db = db; } public IEnumerable getrecords {get; set;} public async Task onGet(){ getrecords = await _db.empjsondata.ToListAsync();

//Index.cshtml @Page @model IndexModel @{ ViewData[\"Title\"] = \"Home page\"; }

asp.net Core 3.0 Tutorials h2> Display Records From Database SQL Server


@foreach(var item in model.getrecords) { }
Transaction Date Transaction Info Transaction Type Amount Status
@item.transactionDate @item.transactionInfo @item.transactionType @item.amount @item.status

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions