Ejemplo n.º 1
0
        public vas_docTypes GetDocType(int id)
        {
            var res = new vas_docTypes();

            try
            {
                res = db.GetDocType(id);
            }
            catch (Exception ex)
            {
                _debug(ex, new { docTypeID = id });
                res = null;
            }
            return(res);
        }
Ejemplo n.º 2
0
        public vas_docTypes CreateDocType(string name, string code)
        {
            var res = new vas_docTypes();

            try
            {
                res.name = name;
                res.code = code;
                db.SaveDocType(res);
            }
            catch (Exception ex)
            {
                _debug(ex, new { docTypeName = name, docTypeCode = code });
                res = null;
            }

            return(res);
        }
Ejemplo n.º 3
0
 public int SaveDocType(vas_docTypes item, bool withSave = true)
 {
     if (item.id == 0)
     {
         Db.vas_docTypes.Add(item);
         if (withSave)
         {
             Save();
         }
     }
     else
     {
         Db.Entry(item).State = EntityState.Modified;
         if (withSave)
         {
             Save();
         }
     }
     return(item.id);
 }