示例#1
0
 public int SaveMail(rosh_mails res)
 {
     try
     {
         if (res.id == 0)
         {
             db.rosh_mails.Add(res);
             db.SaveChanges();
         }
         else
         {
             try
             {
                 db.Entry(res).State = EntityState.Modified;
                 db.SaveChanges();
             }
             catch (OptimisticConcurrencyException ex)
             {
                 RDL.Debug.LogError(ex);
             }
         }
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
     return(res.id);
 }
示例#2
0
        public rosh_mails GetMail(int id)
        {
            var res = new rosh_mails();

            res = db.rosh_mails.FirstOrDefault(o => o.id == id);
            return(res);
        }
示例#3
0
 public void SaveMail(rosh_mails res)
 {
     try
     {
         db.SaveMail(res);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
示例#4
0
        public rosh_mails GetMail(int id)
        {
            var res = new rosh_mails();

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