示例#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);
 }