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

            try
            {
                res = db.GetMailStatus(id);
            }
            catch (Exception ex)
            {
                _debug(ex);
            }

            return(res);
        }
Пример #2
0
        public vas_mailStatuses CreateMailStatus(string name, string code)
        {
            var res = new vas_mailStatuses()
            {
                name = name, code = code
            };

            try
            {
                db.SaveMailStatus(res);
            }
            catch (Exception ex)
            {
                _debug(ex);
            }

            return(res);
        }
Пример #3
0
 public int SaveMailStatus(vas_mailStatuses item, bool withSave = true)
 {
     if (item.id == 0)
     {
         Db.vas_mailStatuses.Add(item);
         if (withSave)
         {
             Save();
         }
     }
     else
     {
         Db.Entry(item).State = EntityState.Modified;
         if (withSave)
         {
             Save();
         }
     }
     return(item.id);
 }