public List <ROL_002_Info> get_list_detalle_prestamos(int IdEmpresa, int IdNominaTipo, int IdPeriodo, int IdEmpleado) { try { List <ROL_002_Info> ListaPrestamos; ro_periodo_Data periodo_data = new ro_periodo_Data(); var info_periodo = periodo_data.get_info(IdEmpresa, IdPeriodo); using (Entities_reportes Context = new Entities_reportes()) { ListaPrestamos = (from q in Context.VWROL_002_detallle_prestamos where (q.IdEmpresa == IdEmpresa && q.IdEmpleado == IdEmpleado && q.FechaPago >= info_periodo.pe_FechaIni && q.FechaPago <= info_periodo.pe_FechaFin ) orderby q.ru_descripcion, q.IdPrestamo select new ROL_002_Info { IdPrestamo = q.IdPrestamo, ru_descripcion = q.ru_descripcion, NumCuota = q.NumCuota, NumCuotas = q.NumCuotas, TotalCuota = q.TotalCuota }).ToList(); } return(ListaPrestamos); } catch (Exception) { throw; } }
public Boolean ExistePeriodo(int idempresa, DateTime Finicia, DateTime Ffin) { try { ro_periodo_Data data = new ro_periodo_Data(); return(data.ExistePeriodo(idempresa, Finicia, Ffin)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ExistePeriodo", ex.Message), ex) { EntityType = typeof(ro_periodo_Bus) }; } }
public Boolean GuardarPeriodos(List <ro_periodo_Info> Lst, ref string mensaje) { try { ro_periodo_Data data = new ro_periodo_Data(); return(data.GuardarPeriodos(Lst, ref mensaje)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarPeriodos", ex.Message), ex) { EntityType = typeof(ro_periodo_Bus) }; } }
public int getId(int IdPeriodo) { try { ro_periodo_Data data = new ro_periodo_Data(); return(data.getId(IdPeriodo)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "getId", ex.Message), ex) { EntityType = typeof(ro_periodo_Bus) }; return(0); } }
public List <ro_periodo_Info> ObtenerPeriodo(int idcompany, int IdPeriodo) { List <ro_periodo_Info> lm = new List <ro_periodo_Info>(); ro_periodo_Data data = new ro_periodo_Data(); try { lm = data.ObtenerPeriodo(idcompany, IdPeriodo); return(lm); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ObtenerPeriodo", ex.Message), ex) { EntityType = typeof(ro_periodo_Bus) }; } }
public bool Modificar_DB(ro_fectividad_Entrega_servicio_Info info) { try { ro_periodo_Data odata_perido = new ro_periodo_Data(); var infoperiodo = odata_perido.ObtenerPeriodo(info.IdEmpresa, info.IdPeriodo).FirstOrDefault(); #region variables EntitiesRoles context = new EntitiesRoles(); EntityRoles_FJ db = new EntityRoles_FJ(); decimal IdNovedad = 0; var info_calculado = odata_calculado.get_info(info.IdEmpresa); #endregion var add = db.ro_fectividad_Entrega_servicio.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdNivelServicio == info.IdNivelServicio); //add.Observacion = info.Observacion; add.FechaUltModi = DateTime.Now; add.IdUsuarioUltModi = info.IdUsuarioUltModi; string idcalendario = info.IdPeriodo.ToString() + info.IdNivelServicio.ToString(); string DeteNov = "delete ro_empleado_novedad_det where idempresa='" + info.IdEmpresa + "' and IdCalendario = '" + idcalendario + "'"; string CabeNov = "delete ro_empleado_novedad where idempresa='" + info.IdEmpresa + "' and IdCalendario = '" + idcalendario + "'"; string detalle = "delete Fj_servindustrias.ro_fectividad_Entrega_servicio_det where IdEmpresa='" + info.IdEmpresa + "' and IdNivelServicio='" + info.IdNivelServicio + "' "; db.Database.ExecuteSqlCommand(DeteNov); db.Database.ExecuteSqlCommand(CabeNov); db.Database.ExecuteSqlCommand(detalle); foreach (var item in info.lst) { #region servicio db.ro_fectividad_Entrega_servicio_det.Add(new ro_fectividad_Entrega_servicio_det { IdEmpresa = item.IdEmpresa, IdNivelServicio = info.IdNivelServicio, Secuencia = item.Secuencia, IdRuta = item.IdRuta, IdEmpleado = item.IdEmpleado, Efe_car_bebi = item.Efe_car_bebi, Efe_car_bebi_apl = item.Efe_car_bebi_apl, Efe_vol_bebi = item.Efe_vol_bebi, Efe_vol_bebi_apl = item.Efe_vol_bebi_apl, Efe_ent_bebi = item.Efe_ent_bebi, Efe_ent_bebi_apl = item.Efe_ent_bebi_apl, Efe_car_alim = item.Efe_car_alim, Efe_car_alim_ap = item.Efe_car_alim_ap, Efe_vol_alim = item.Efe_vol_alim, Efe_vol_alim_apl = item.Efe_vol_alim_apl, Efe_ent_alim = item.Efe_ent_alim, Efe_ent_alim_apl = item.Efe_ent_alim_apl, Efe_serv = item.Efe_serv, Efe_ser_apl = item.Efe_ser_apl, Nivel_servicio = item.Nivel_servicio, Valor_volumen = item.Valor_volumen, Valor_servicio = item.Valor_servicio }); #endregion #region novedades IdNovedad = odata.GetIdNovedad(item.IdEmpresa, item.IdEmpleado); #region servicio if (item.Valor_servicio > 0) { context.ro_empleado_Novedad.Add(new ro_empleado_Novedad { IdNovedad = IdNovedad, IdEmpresa = info.IdEmpresa, IdEmpleado = item.IdEmpleado, TotalValor = item.Valor_servicio, Fecha = infoperiodo.pe_FechaFin, IdNomina_Tipo = info.IdNomina_Tipo, IdNomina_TipoLiqui = info.IdNomina_tipo_Liq, IdUsuario = info.IdUsuario, Fecha_Transac = info.FechaTransac = DateTime.Now, nom_pc = "", ip = "", Estado = "A", IdCalendario = info.IdCalendario, }); context.ro_empleado_novedad_det.Add(new ro_empleado_novedad_det { IdEmpresa = info.IdEmpresa, IdNovedad = IdNovedad, IdEmpleado = item.IdEmpleado, Secuencia = item.Secuencia = 1, FechaPago = infoperiodo.pe_FechaFin, Valor = item.Valor_servicio, EstadoCobro = "PEN", Estado = "A", Observacion = info.Observacion, IdRubro = info_calculado.IdRubro_servicio, IdCalendario = info.IdPeriodo.ToString() + info.IdNivelServicio.ToString(), Num_Horas = 0, IdNomina_tipo = info.IdNomina_Tipo, IdNomina_Tipo_Liq = info.IdNomina_tipo_Liq, IdPeriodo = info.IdPeriodo }); } #endregion #region cartera if (item.Valor_volumen > 0) { IdNovedad++; context.ro_empleado_Novedad.Add(new ro_empleado_Novedad { IdNovedad = IdNovedad, IdEmpresa = info.IdEmpresa, IdEmpleado = item.IdEmpleado, TotalValor = item.Valor_volumen, Fecha = infoperiodo.pe_FechaFin, IdNomina_Tipo = info.IdNomina_Tipo, IdNomina_TipoLiqui = info.IdNomina_tipo_Liq, IdUsuario = info.IdUsuario, Fecha_Transac = info.FechaTransac = DateTime.Now, nom_pc = "", ip = "", Estado = "A", IdCalendario = info.IdCalendario, }); context.ro_empleado_novedad_det.Add(new ro_empleado_novedad_det { IdEmpresa = info.IdEmpresa, IdNovedad = IdNovedad, IdEmpleado = item.IdEmpleado, Secuencia = item.Secuencia = 1, FechaPago = infoperiodo.pe_FechaFin, Valor = item.Valor_volumen, EstadoCobro = "PEN", Estado = "A", Observacion = info.Observacion, IdRubro = info_calculado.IdRubro_beb_car, IdCalendario = info.IdPeriodo.ToString() + info.IdNivelServicio.ToString(), Num_Horas = 0, IdNomina_tipo = info.IdNomina_Tipo, IdNomina_Tipo_Liq = info.IdNomina_tipo_Liq, IdPeriodo = info.IdPeriodo }); } #endregion #endregion } context.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 MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }