Beispiel #1
0
    private void SetInterest(string OrderCode, float Amount)
    {
        PipCoin pc = new PipCoin();

        pc.OrderCode     = OrderCode;
        pc.Amount        = Amount;         //Tổng tiền bid
        pc.Type          = 0;              //Trạng thái chưa thanh toán
        pc.InterestByDay = pc.Amount / 30; //Tính tiền lãi mỗi ngày
        pc.DateCreate    = DateTime.Now;

        PipCoinBLL pcBLL = new PipCoinBLL();

        pcBLL.Insert(pc);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            PipCoinBLL pcBLL = new PipCoinBLL();
            var        lst   = pcBLL.GetByUserId(BitcoinSession.LoginMemberId);

            foreach (var itm in lst)
            {
                var    countDate       = DateTime.Now - itm.DateCreate;
                double availableAmount = itm.Amount + (countDate.TotalDays * itm.InterestByDay);
                itm.InterestByDay = Math.Round(availableAmount, 3);
            }

            rptPipCoins.DataSource = lst;
            rptPipCoins.DataBind();
        }
    }