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