public void SaveDocTypeTemplate(Shtoda_docTypeTemplates item) { try { _db.SaveDocTypeTemplate(item); } catch (Exception ex) { _debug(ex, new { item }, ""); } }
public Shtoda_docTypeTemplates GetDocTypeTemplate(int id) { var res = new Shtoda_docTypeTemplates(); try { res = _db.GetDocTypeTemplates().FirstOrDefault(x => x.id == id); } catch (Exception ex) { _debug(ex, new { id }, "id"); } return(res); }
public int SaveDocTypeTemplate(Shtoda_docTypeTemplates element, bool withSave = true) { if (element.id == 0) { db.Shtoda_docTypeTemplates.Add(element); } else { db.Entry(element).State = EntityState.Modified; } if (withSave) { Save(); } return(element.id); }