public int UpdateMaquinaFisica(MaquinaFisica item, string ip) { try { _context.MaquinaFisicas.Update(item); procLog.AddLog(ip, procLog.GetPropertyValues(item, System.Reflection.MethodBase.GetCurrentMethod().Name), "OK", 200); return(_context.SaveChanges()); } catch (Exception ex) { procLog.AddLog(ip, procLog.GetPropertyValues(item, System.Reflection.MethodBase.GetCurrentMethod().Name), ex.InnerException.Message, 400); return(0); } }
public long AddMaquinaFisica(MaquinaFisica item, string ip) { try { var MaquinaFisicaRes = _context.MaquinaFisicas.Add(item); _context.SaveChanges(); procLog.AddLog(ip, procLog.GetPropertyValues(item, System.Reflection.MethodBase.GetCurrentMethod().Name), "OK", 200); return(Int32.Parse(MaquinaFisicaRes.Entity.IdMaquinaFisica.ToString())); } catch (Exception ex) { procLog.AddLog(ip, procLog.GetPropertyValues(item, System.Reflection.MethodBase.GetCurrentMethod().Name), ex.InnerException.Message, 400); var r = ex.Message; return(0); } }