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 bool Insert(LogCallVTB model) { try { model.CreateDate = DateTime.Now; db.LogCallVTBs.InsertOnSubmit(model); db.SubmitChanges(); return(true); } catch (Exception ex) { logger.Error(ex); return(false); } }
public bool Insert(QueueService model) { try { //if (db.CheckSMSID(model.SMSID) == 0) //{ db.QueueServices.InsertOnSubmit(model); db.SubmitChanges(); //} return(true); } catch (Exception ex) { logger.Error(ex); return(false); } }
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); } }