コード例 #1
0
 public int SaveContragentSource(rosh_contragentSources source)
 {
     try
     {
         if (source.id == 0)
         {
             db.rosh_contragentSources.Add(source);
             db.SaveChanges();
         }
         else
         {
             try
             {
                 db.Entry(source).State = EntityState.Modified;
                 db.SaveChanges();
             }
             catch (OptimisticConcurrencyException ex)
             {
                 RDL.Debug.LogError(ex);
             }
         }
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
     return(source.id);
 }
コード例 #2
0
        public rosh_contragentSources GetContragentSource(int id)
        {
            var source = new rosh_contragentSources();

            source = db.rosh_contragentSources.FirstOrDefault(c => c.id == id);
            return(source);
        }
コード例 #3
0
 public void SaveContragentSource(rosh_contragentSources res)
 {
     try
     {
         db.SaveContragentSource(res);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
コード例 #4
0
        public rosh_contragentSources GetContragentSource(int id)
        {
            var res = new rosh_contragentSources();

            try
            {
                res = db.GetContragentSource(id);
            }
            catch (Exception ex)
            {
                _debug(ex, new { id }, "");
            }
            return(res);
        }