예제 #1
0
 public void AddFinanceSettings(FinanceSettings entity)
 {
     try
     {
         using (var manage = new UserBalanceManager())
         {
             var FinanceInfo = manage.GetFinanceUserByUserId(entity.UserId);
             if (FinanceInfo != null && FinanceInfo.Count > 0)
             {
                 var query = from f in FinanceInfo where f.OperateType == entity.OperateType select f;
                 if (query != null && query.ToList().Count > 0)
                 {
                     throw new Exception("当前用户已存在,不能重复添加!");
                 }
             }
             manage.AddFinanceSettings(entity);
         }
     }
     catch (Exception ex)
     {
         throw new Exception("保存数据失败,原因:" + ex.Message);
     }
 }