Exemplo n.º 1
0
        /// <summary>
        /// This method inserts inter client conversion activity details in db
        /// </summary>
        /// <param name="pkUsrActivityId">pkUsrActivityId</param>
        /// <param name="fromUserId">fromUserId</param>
        /// <param name="toUserId">toUserId</param>
        /// <param name="fromCurrId">fromCurrId</param>
        /// <param name="toCurrId">toCurrId</param>
        /// <param name="amount">amount</param>
        /// <param name="exchangeRate">exchangeRate</param>
        /// <param name="fromAcc">fromAcc</param>
        /// <param name="toAcc">toAcc</param>
        /// <param name="status">status</param>
        public void InsertInterClientConversionActivityDetails(int pkUsrActivityId, int?fromUserId, int?toUserId, int fromCurrId, int toCurrId, double amount, double exchangeRate, string fromAcc, string toAcc, string status)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var convActRepo =
                        new ConversionActivityRepository(new EFRepository <ConversionActivity>(), unitOfWork);

                    ConversionActivity newConvAct = new ConversionActivity();
                    newConvAct.FK_UserActivityID = pkUsrActivityId;
                    newConvAct.FK_FromCurrencyID = fromCurrId;
                    newConvAct.FK_ToCurrencyID   = toCurrId;
                    newConvAct.ConversionAmount  = Convert.ToDecimal(amount);
                    newConvAct.ExchangeRate      = exchangeRate;
                    newConvAct.FromAccount       = fromAcc;
                    newConvAct.ToAccount         = toAcc;
                    newConvAct.FK_FromUserID     = fromUserId;
                    newConvAct.FK_ToUserID       = toUserId;
                    newConvAct.ConversionStatus  = status;

                    convActRepo.Add(newConvAct);
                    convActRepo.Save();
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
Exemplo n.º 2
0
 public void Delete(ConversionActivity entity)
 {
     Repository.Delete(entity);
 }
Exemplo n.º 3
0
 public void Add(ConversionActivity entity)
 {
     Repository.Add(entity);
 }
		void SyncDownloadInfo(ConversionActivity status)
		{
			if (status != null)
			{
				DownloadInfo.Download.BytesDownloaded = status.DownloadCurrent;
				DownloadInfo.Download.PercentComplete = status.PercentComplete;
				DownloadInfo.Download.TotalBytes = status.DownloadTotal;
			}
		}