public IHttpActionResult GuardarModificacionFicha(Ficha_PEspecial objF) { try { EspecialBl obj = new EspecialBl(); obj.GuardarModificacionFicha(objF); return(Ok(new { success = true })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public void GuardarModificacionFicha(Ficha_PEspecial obj) { var Datos = (from i in entity.Ficha_PEspecial where i.Id == obj.Id select i).FirstOrDefault(); Datos.Num_Ficha = obj.Num_Ficha; Datos.Programa = obj.Programa; Datos.Num_Aprendices = obj.Num_Aprendices; Datos.Fecha_Inicio = obj.Fecha_Inicio; Datos.Fecha_Fin = obj.Fecha_Fin; Datos.Caracterizacion = obj.Caracterizacion; entity.SaveChanges(); }
public bool GuardarFicha(Ficha_PEspecial obj) { var datos = (from i in entity.Ficha_PEspecial where i.Num_Ficha == obj.Num_Ficha select i).FirstOrDefault(); if (datos == null) { entity.Ficha_PEspecial.Add(obj); entity.SaveChanges(); return(true); } else { return(false); } }
public IHttpActionResult GuardarFicha(Ficha_PEspecial objF) { try { EspecialBl obj = new EspecialBl(); var Datos = obj.GuardarFicha(objF); if (Datos) { return(Ok(new { success = true })); } else { return(Ok(new { success = false })); } } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }