Example #1
0
        private SaveResult <int> SaveCreate(Cryptocurrencies cur)
        {
            List <PriceInfos>   list = new List <PriceInfos>();
            CryptocurrenciesBLL ab   = new CryptocurrenciesBLL();
            PriceInfoAgent      pia  = new PriceInfoAgent();
            var result = ab.Create(cur, UserId, UserName);

            if (cur.IsFixedPrice)
            {
                foreach (Currency item in FoundationDB.CurrencyDb.GetList())
                {
                    PriceInfos pi = new PriceInfos();
                    pi.CryptoID       = result.Data;
                    pi.CurrencyID     = item.ID;
                    pi.LastUpdateDate = DateTime.Now;
                    pi.Price          = Convert.ToDecimal(Request.Form[item.Code]);
                    list.Add(pi);
                }
                pia.Insert(list);
            }
            return(result);
        }
Example #2
0
        public ActionResult Delete(int Id)
        {
            PriceInfoAgent ab = new PriceInfoAgent();

            return(Json(ab.Delete(Id, UserId, UserName).toJson()));
        }
Example #3
0
        private SaveResult SaveEdit(PriceInfos priceinfo)
        {
            PriceInfoAgent ab = new PriceInfoAgent();

            return(ab.Update(priceinfo, UserId, UserName));
        }