Пример #1
0
 public void SaveDocType(Shtoda_docTypes item)
 {
     try
     {
         _db.SaveDocType(item);
     }
     catch (Exception ex)
     {
         _debug(ex, new { item }, "");
     }
 }
Пример #2
0
        public Shtoda_docTypes GetDocType(int id)
        {
            var res = new Shtoda_docTypes();

            try
            {
                res = _db.GetDocTypes().FirstOrDefault(x => x.id == id);
            }
            catch (Exception ex)
            {
                _debug(ex, new { id }, "");
            }
            return(res);
        }
Пример #3
0
 public int SaveDocType(Shtoda_docTypes element, bool withSave = true)
 {
     if (element.id == 0)
     {
         db.Shtoda_docTypes.Add(element);
     }
     else
     {
         db.Entry(element).State = EntityState.Modified;
     }
     if (withSave)
     {
         Save();
     }
     return(element.id);
 }