Example #1
0
 public bool Delete(string guid)
 {
     try
     {
         using var sql = new SqliteContext();
         var store = sql.Storages.FirstOrDefault(x => x.Guid == guid);
         sql.Storages.Remove(store);
         sql.SaveChanges();
         MailServiceProvider.SendConfirmation(store);
         return(true);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
         return(false);
     }
 }
Example #2
0
 public static void SendFareError(FareErrorLog fare, decimal price)
 {
     try
     {
         IMailServiceProvider mail         = new MailServiceProvider();
         string       receptionMailAddress = SystemParamService.QueryString(SystemParamType.SystemReceptionMailAddress);
         string       serviceMailAdderess  = SystemParamService.QueryString(SystemParamType.SystemServiceMailAddress);
         string       serviceMailPassword  = SystemParamService.QueryString(SystemParamType.SystemServiceMailPassword);
         string       title   = "记录价格变动信息";
         string       content = B3BEmailSender.GetFareCOnetnt(fare, price);
         MailMessages message = new MailMessages("B3b系统邮件", receptionMailAddress, title, content, serviceMailAdderess, serviceMailPassword, "QQ");
         mail.SendMessage(message);
     }
     catch (Exception ex)
     {
         Service.LogService.SaveExceptionLog(ex, "发送邮件异常");
     }
 }