/// <summary>
 /// Saves the specified client.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 /// 创建人:李允智
 /// 创建时间:2016/1/28
 /// 描述:保存一个客户端
 public string Save(Clients client,string id,bool isnew)
 {
     try
     {
         if (isnew)
         {
             client.isenabled = true;
             client.createtime = DateTime.Now;
             ClientsCore.GetInstance().InsertClient(client);
         }
         else
         {
             Clients editClient = ClientsCore.GetInstance().GetClient(id);
             editClient.clientname = client.clientname;
             editClient.reqip = client.reqip;
             ClientsCore.GetInstance().UpdateClient(editClient);
         }
         comm.success = true;
         comm.message = "保存成功";
     }
     catch (Exception)
     {
         comm.success = false;
         comm.message = "保存失败";
     }
     return JsonHelper.SerializeObject(comm);
 }
 public void UpdateClient(Clients client)
 {
     MongodbHelper.UpdateOne<Clients>("Clients", client);
 }
 public void InsertClient(Clients client)
 {
     MongodbHelper.InsertOne<Clients>("Clients",client);
 }