public Boolean EliminarEmpleadoGastosPersona(ro_empleado_gastos_perso_Info info) { try { using (EntitiesRoles ro = new EntitiesRoles()) { ro_empleado_gastos_perso EmpleadoGastosPerso = ro.ro_empleado_gastos_perso.First(v => v.IdEmpleado == info.IdEmpleado && v.Anio_fiscal == info.Anio_fiscal && v.IdEmpresa == info.IdEmpresa); ro.ro_empleado_gastos_perso.Remove(EmpleadoGastosPerso); ro.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean ModificarBD(ro_empleado_gastos_perso_Info info, ref string msg) { try { using (EntitiesRoles db = new EntitiesRoles()) { ro_empleado_gastos_perso item = (from a in db.ro_empleado_gastos_perso where a.IdEmpresa == info.IdEmpresa && a.IdEmpleado == info.IdEmpleado && a.Anio_fiscal == info.Anio_fiscal select a).FirstOrDefault(); item.fecha = info.fecha; item.observacion = info.observacion; item.Estado = info.Estado; item.Tipo_Iden = info.Tipo_Iden; item.Num_Identificacion = info.Num_Identificacion; item.Apellidos_Nombres = info.Apellidos_Nombres; item.telefono = info.telefono; item.calle_prin = info.calle_prin; item.Numero = info.Numero; item.Intersecion = info.Intersecion; item.IdProvincia = info.IdProvincia; item.IdCidudad = info.IdCidudad; item.IdEmpresa = info.IdEmpresa; db.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = msg = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }