public object UpdateB_EmailByIdSetMail_IsSee(string id, string mailIsSee, string userid, string emailType) { var tran = Utility.Database.BeginDbTransaction(); try { B_Email email = new B_Email(); email.Condition.Add("ID=" + id); email = Utility.Database.QueryObject<B_Email>(email); email.Mail_IsSee = mailIsSee; email.Condition.Add("ID=" + email.ID); Utility.Database.Update<B_Email>(email, tran); CounntModel countModel = new CounntModel(); //刷新已读未读 countModel = GetUnReadEmailCount(userid, tran, emailType); Utility.Database.Commit(tran); return new { countModel = countModel }; } catch (Exception e) { Utility.Database.Rollback(tran); ComBase.Logger(e.Message); throw (new Exception("保存失败!", e)); } }
public string UpdateB_EmailByIdSetMail_IsSee(string id, string mailIsSee, string userid, string emailType) { var tran = Utility.Database.BeginDbTransaction(); try { B_Email email = new B_Email(); email.Condition.Add("ID=" + id); email = Utility.Database.QueryObject<B_Email>(email); email.Mail_IsSee = mailIsSee; email.Condition.Add("ID=" + email.ID); Utility.Database.Update<B_Email>(email, tran); CounntModel countModel = new CounntModel(); //刷新已读未读 countModel = GetUnReadEmailCount(userid, tran, emailType); Utility.Database.Commit(tran); return JsonConvert.SerializeObject(countModel); } catch (Exception ex) { ComBase.Logger(ex.Message); return Utility.JsonMsg(false, ex.Message); } }