public bool Insert(MT model)
 {
     try
     {
         if (db.CheckSMSID(model.SMSID) == 0)
         {
             var modeltelco = new SubTelcoProvider().getSubTelcoByDest(model.Receiver);
             int IdTelco    = 0;
             if (modeltelco != null)
             {
                 IdTelco = modeltelco.IdTelco.Value;
             }
             model.IdTelco = IdTelco;
             db.MTs.InsertOnSubmit(model);
             db.SubmitChanges();
         }
         else
         {
             db.ExecuteCommand("UPDATE MT SET Status = {0} WHERE SMSID = {1}", ConfigType.MT_STATUS_NOT_NOTIFY, model.SMSID);
         }
         return(true);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
         return(false);
     }
 }
 public void DeleteById(int id)
 {
     try
     {
         db.ExecuteCommand("DELETE FROM QueueService WHERE Id={0}", id);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
Beispiel #3
0
 public bool Insert(MTQueueReport model)
 {
     try
     {
         if (db.CheckSMSID(model.SMSID) == 0)
         {
             db.MTQueueReports.InsertOnSubmit(model);
             db.SubmitChanges();
         }
         else
         {
             db.ExecuteCommand("UPDATE MTQueueReport SET Status = {0} WHERE SMSID = {1}", ConfigType.MT_STATUS_NOT_NOTIFY, model.SMSID);
         }
         return(true);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
         return(false);
     }
 }