Beispiel #1
0
        /// <summary>
        /// 添加船舶
        /// </summary>
        /// <param name="ID">实体主键</param>
        /// <returns></returns>
        public void Delete(string ID)
        {
            ExchangeRateInfo cInfo = new ExchangeRateInfo();
            cInfo.ID = ID;

            dal.Delete(cInfo);
        }
Beispiel #2
0
 /// <summary>
 /// 添加船舶
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(ExchangeRateInfo cInfo)
 {
     return dal.Add(cInfo);
 }
Beispiel #3
0
 /// <summary>
 /// 更新船舶
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(ExchangeRateInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
Beispiel #4
0
 /// <summary>
 /// 获取对应比重某月的汇率
 /// </summary>
 /// <param name="currencyID"></param>
 /// <param name="year"></param>
 /// <param name="month"></param>
 /// <returns></returns>
 public ExchangeRateInfo GetInfo(string currencyID, int year, int month)
 {
     if (string.IsNullOrEmpty(currencyID))
     {
         throw new ArgumentNullException("currencyID不能为空。");
     }
     if (year < 1970 || year > 2050 || month > 12 || month < 1)
     {
         throw new ArgumentNullException("年份或者月份超过有效期。");
     }
     ExchangeRateInfo eInfo = new ExchangeRateInfo();
     if (currencyID == "1")
     {
         eInfo.CurrencyID = currencyID;
         eInfo.Rate = "1";
     }
     else
     {
         eInfo = dal.GetInfo(currencyID, year, month);
     }
     return eInfo;
 }