public void Insert(CommissionGroup group)
 {
     string sql = string.Format(@"INSERT INTO {0} ({1},{2}) VALUES (@{1},@{2}) SELECT SCOPE_IDENTITY()",
         CommissionGroup.TABLENAME, CommissionGroup.GROUPNAME, CommissionGroup.SPECIEID);
     object id = base.ExecuteScalar(sql, new SqlParameter(CommissionGroup.GROUPNAME, group.GroupName),
         new SqlParameter(CommissionGroup.SPECIEID, group.SpecieId));
     group.GroupId = Convert.ToInt32(id);
 }
 public void InsertMemberPackage(User user, CommissionGroup group)
 {
     string sql = string.Format(@"INSERT INTO {0} ({1},{2},{3}) VALUES (@{1},@{2},@{3})",
         MemberPackage.TABLENAME, MemberPackage.USERID, MemberPackage.GROUPID, MemberPackage.SPECIEID);
     base.ExecuteNonQuery(sql, new SqlParameter(MemberPackage.USERID, user.UserId),
         new SqlParameter(MemberPackage.GROUPID, group.GroupId),
         new SqlParameter(MemberPackage.SPECIEID, group.SpecieId));
 }
 /// <summary>
 /// 获取佣金分组的佣金信息
 /// </summary>
 /// <param name="group">The group.</param>
 /// <returns></returns>
 public IEnumerable<ConcreteCommission> GetConcreteCommission(CommissionGroup group)
 {
     string sql = string.Format(@"select * from tb_ConcreteCommission where {0}=@{0}", ConcreteCommission.GROUPID);
     return base.ExecuteList<ConcreteCommission>(sql, new SqlParameter(ConcreteCommission.GROUPID, group.GroupId));
 }
Beispiel #4
0
 public void UpdateMemberPackage(User user, CommissionGroup group)
 {
     DaMemPackage.ExecuteWithTransaction(() =>
     {
         DaMemPackage.DeleteMemeberPackage(user, group.Specie);
         DaMemPackage.InsertMemberPackage(user, group);
     });
 }
Beispiel #5
0
 public void AddMemberPackage(User user, CommissionGroup commGroup)
 {
     DaMemPackage.InsertMemberPackage(user, commGroup);
 }
Beispiel #6
0
 /// <summary>
 /// 添加新佣金组
 /// </summary>
 /// <param name="specie">The specie.</param>
 /// <param name="name">The name.</param>
 /// <param name="comms">The comms.</param>
 public void AddCommGroup(LotterySpecies specie, string name, IEnumerable<ConcreteCommission> comms)
 {
     var group = new CommissionGroup
     {
         Specie = specie,
         GroupName = name
     };
     DaCommGroup.ExecuteWithTransaction(() =>
     {
         DaCommGroup.Insert(group);
         comms = comms.ForEach(it => { it.GroupId = group.GroupId; return it; });
         DaConcreteComm.InsertComms(comms);
     });
 }