Пример #1
0
 public static  bool AddClientGrounp(ClientGrounp cg)
 {
     int i = 0;
     i=new SqlClientGrounpProvider().AddClientGrounp(cg);
     if (i != 0)
         return true;
     else
         return false;
 }
Пример #2
0
 public bool UpdateClientGrounp(ClientGrounp cg)
 {
     int i = 0;
     i = new SqlClientGrounpProvider().UpdateClientGrounp(cg);
     if (i != 0)
         return true;
     else
         return false;
 }
Пример #3
0
 public List<ClientGrounp> GetClientGrounpByAccountId(string accountId)
 {
     string sql = string.Format("select * from LiveSupport_ClientGrounp where accountId='{0}' order by addDate", accountId);
     List<ClientGrounp> list = new List<ClientGrounp>();
     using (SqlDataReader sdr = DBHelper.GetReader(sql))
     {
         while (sdr.Read())
         {
             ClientGrounp cg = new ClientGrounp(sdr);
             cg.Account = new SqlAccountProvider().GetAccountByAccountId(accountId);
             list.Add(cg);
         }
         return list;
     }
 }
Пример #4
0
 public ClientGrounp GetClientGrounpById(string grounpId)
 {
     string sql = string.Format("select * from LiveSupport_ClientGrounp where Id='{0}' order by addDate", grounpId);
     using (SqlDataReader sdr = DBHelper.GetReader(sql))
     {
         if (sdr.Read())
         {
             ClientGrounp cg = new ClientGrounp(sdr);
             cg.Account = new SqlAccountProvider().GetAccountByAccountId(grounpId);
             return cg;
         }
         else
         {
             return null;
         }
     }
 }
Пример #5
0
 public ClientGrounp CheckClientGrounpByAccountIdAndGrountpName(string accountId, string GrountpName)
 {
     string sql = string.Format("select * from LiveSupport_ClientGrounp where accountId='{0}' and [Name]='{1}' order by addDate", accountId, GrountpName);
     using (SqlDataReader sdr = DBHelper.GetReader(sql))
     {
         if (sdr.Read())
         {
             ClientGrounp cg = new ClientGrounp(sdr);
             cg.Account = new SqlAccountProvider().GetAccountByAccountId(accountId);
             return cg;
         }
         else
         {
             return null;
         }
     }
 }
Пример #6
0
 public int UpdateClientGrounp(ClientGrounp cg)
 {
     string sql = string.Format("update from LiveSupport_ClientGrounp Name='{0}',accountId='{1}' where Id='{2}'",cg.Name,cg.Account.AccountId,cg.Id);
     return DBHelper.ExecuteSql(sql);
 }
Пример #7
0
 public int AddClientGrounp(ClientGrounp cg)
 {
     string sql = string.Format("insert into LiveSupport_ClientGrounp([Id],[Name],accountId,addDate) values('{0}','{1}','{2}','{3}',)", cg.Id, cg.Name, cg.Account.AccountId,cg.AddDate);
     return DBHelper.ExecuteSql(sql);
 }