Example #1
0
 public int UpdateClient(Client client)
 {
     try
     {
         string sql = string.Format("update LiveSupport_Client set [Name]='{0}',Job='{1}',Unit='{2}',[Phone]='{3}',[Email]='{4}',GrounpId='{5}',Address='{6}',Age={7},Sex={8},QQ='{9}',Remark='{10}' where [Id]='{11}'", client.Name, client.Job, client.Unit, client.Phone, client.Email, client.ClientGrounp.Id, client.Address, client.Age, client.Sex, client.Qq, client.Remark, client.Id);
         return DBHelper.ExecuteSql(sql);
     }
     catch (Exception ex)
     {
         return 0;
     }
 }
Example #2
0
 public int AddClient(Client client)
 {
     try
     {
         string sql = string.Format("insert into LiveSupport_Client([Id],[Name],Job,Unit,[Phone],[Email],GrounpId,Address,Age,Sex,QQ,Remark) "
         + "values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}',{8},{9},'{10}','{11}')", client.Id, client.Name, client.Job, client.Unit, client.Phone, client.Email, client.ClientGrounp.Id, client.Address, client.Age, client.Sex, client.Qq, client.Remark);
         return DBHelper.ExecuteSql(sql);
     }
     catch (Exception ex)
     {
         return 0;
     }
 }