Exemple #1
0
        public Mikhailova_contagents GetContagent(int id)
        {
            var res = new Mikhailova_contagents();

            res = db.GetContagent(id);
            return(res);
        }
Exemple #2
0
 public int SaveContagent(Mikhailova_contagents item)
 {
     try
     {
         if (item.id == 0)
         {
             db.Mikhailova_contagents.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);
 }
Exemple #3
0
 public void SaveContagent(Mikhailova_contagents item)
 {
     try
     {
         db.SaveContagent(item);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
Exemple #4
0
 public void SaveContagent(Mikhailova_contagents item)
 {
     try
     {
         _db.SaveContagent(item);
     }
     catch (Exception ex)
     {
         _debug(ex, new { item }, "");
     }
 }
Exemple #5
0
        public Mikhailova_contagents GetContagent(int id)
        {
            var res = new Mikhailova_contagents();

            try
            {
                res = _db.GetContagents().FirstOrDefault(x => x.id == id);
            }
            catch (Exception ex)
            {
                _debug(ex, new { id }, "");
            }
            return(res);
        }
Exemple #6
0
 public int SaveContagent(Mikhailova_contagents element, bool withSave = true)
 {
     if (element.id == 0)
     {
         db.Mikhailova_contagents.Add(element);
     }
     else
     {
         db.Entry(element).State = EntityState.Modified;
     }
     if (withSave)
     {
         Save();
     }
     return(element.id);
 }