public int SaveMail(rosh_mails res) { try { if (res.id == 0) { db.rosh_mails.Add(res); db.SaveChanges(); } else { try { db.Entry(res).State = EntityState.Modified; db.SaveChanges(); } catch (OptimisticConcurrencyException ex) { RDL.Debug.LogError(ex); } } } catch (Exception ex) { RDL.Debug.LogError(ex); } return(res.id); }
public rosh_mails GetMail(int id) { var res = new rosh_mails(); res = db.rosh_mails.FirstOrDefault(o => o.id == id); return(res); }
public void SaveMail(rosh_mails res) { try { db.SaveMail(res); } catch (Exception ex) { RDL.Debug.LogError(ex); } }
public rosh_mails GetMail(int id) { var res = new rosh_mails(); try { res = db.GetMail(id); } catch (Exception ex) { _debug(ex, new { id }, ""); } return(res); }