Пример #1
0
        public Mikhailova_docTypes GetDocType(int id)
        {
            var res = new Mikhailova_docTypes();

            res = db.GetDocType(id);
            return(res);
        }
Пример #2
0
 public int SaveDocType(Mikhailova_docTypes item)
 {
     try
     {
         if (item.id == 0)
         {
             db.Mikhailova_docTypes.Add(item);
             db.SaveChanges();
         }
         else
         {
             try
             {
                 db.Entry(item).State = EntityState.Modified;
                 db.SaveChanges();
             }
             catch (OptimisticConcurrencyException ex)
             {
                 RDL.Debug.LogError(ex);
             }
         }
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
     return(item.id);
 }
Пример #3
0
 public void SaveDocType(Mikhailova_docTypes item)
 {
     try
     {
         db.SaveDocType(item);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
Пример #4
0
 public void SaveDocType(Mikhailova_docTypes item)
 {
     try
     {
         _db.SaveDocType(item);
     }
     catch (Exception ex)
     {
         _debug(ex, new { item }, "");
     }
 }
Пример #5
0
        public Mikhailova_docTypes GetDocType(int id)
        {
            var res = new Mikhailova_docTypes();

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