public void Insert(DefaultUpperLimit limit)
 {
     string sql = string.Format(@"INSERT INTO {0} ({1},{2},{3}) VALUES (@{1},@{2},@{3}) SELECT SCOPE_IDENTITY()",
         DefaultUpperLimit.TABLENAME, DefaultUpperLimit.COMPANYTYPE, DefaultUpperLimit.GAMEPLAYWAYID, DefaultUpperLimit.LIMITAMOUNT);
     object id = base.ExecuteScalar(sql, new SqlParameter(DefaultUpperLimit.COMPANYTYPE, (int)limit.CompanyType),
         new SqlParameter(DefaultUpperLimit.GAMEPLAYWAYID, limit.GamePlayWayId),
         new SqlParameter(DefaultUpperLimit.LIMITAMOUNT, limit.LimitAmount));
     limit.LimitId = Convert.ToInt32(id);
 }
Example #2
0
 public void AddDefaultUpperLimit(CompanyType companyType, int gameplaywayId, decimal limitAmount)
 {
     var limit = DaDefaultLimit.GetDefaultUpperLimit(companyType, gameplaywayId);
     if (limit != null)
         throw new BusinessException(Resource.AlreadyExist);
     limit = new DefaultUpperLimit
     {
         CompanyType = companyType,
         GamePlayWayId = gameplaywayId,
         LimitAmount = limitAmount
     };
     DaDefaultLimit.Insert(limit);
 }