public List <ro_Participacion_Utilidad_Empleado_Info> Get_nomina_x_utilidades(int idEmpresa, int IdNomina, DateTime fechaInicio, DateTime fechaFin) { try { List <ro_Participacion_Utilidad_Empleado_Info> listado = new List <ro_Participacion_Utilidad_Empleado_Info>(); ro_Rol_Bus oRo_Rol_Bus = new ro_Rol_Bus(); ro_CargaFamiliar_Bus oRo_CargaFamiliar_Bus = new Roles.ro_CargaFamiliar_Bus(); int cnt = 0; DateTime fechaInicial = Convert.ToDateTime("01/01/" + fechaFin.Year.ToString()); DateTime fechaFinal = Convert.ToDateTime("31/12/" + fechaFin.Year.ToString()); listado = oData.Get_nomina_x_utilidades(idEmpresa, IdNomina, fechaInicio, fechaFin); foreach (ro_Participacion_Utilidad_Empleado_Info item in listado) { item.cargas = Convert.ToInt32(oRo_CargaFamiliar_Bus.pu_TotalCargasParaCalculoUtilidad(idEmpresa, item.IdEmpleado, fechaFin)); item.diasTrabajo = Dias_trabajados(item, fechaInicial, fechaFinal); } return(listado); } 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("", "GetListConsultaUtilidad", ex.Message), ex) { EntityType = typeof(ro_Empleado_Bus) }; } }
private void Procesar() { cmbnomina.Focus(); splashScreenManagereEspera.ShowWaitForm(); try{ cmbnomina.Focus(); string msg = ""; bus_rol = new ro_Rol_Bus(inforolEventuales, info_periodo_mensual_eventuales); foreach (var item in lista.Where(v => v.check == true)) { // Actualizando planificacion de ventuales ro_empleado_x_cargo_fuerza_grupo_Info info_ev = new ro_empleado_x_cargo_fuerza_grupo_Info(); info_ev.IdEmpresa = param.IdEmpresa; info_ev.IdNomina = 2; info_ev.IdEmpleado = item.idempleado; info_ev.IdPeriodo = Convert.ToInt32(cmbPeriodos.EditValue); info_ev.IdCargo = Convert.ToInt32(item.IdCargo); if (item.IdCargo == 41) { info_ev.IdGrupo = 5; } else { info_ev.IdGrupo = 2; } if (item.IdFuerza != null) { info_ev.IdFuerza = Convert.ToInt32(item.IdFuerza); } bus_planificacionEventual.GrabarBD(info_ev, ref msg); // Proesando la nomina //InfoEmpleado= bus_empleado.Get_List_Empleado_x_Nomina_Liquidar_Eventuales_Ajuste_MO_Cliente(param.IdEmpresa, info_ev.IdNomina, info_ev.IdPeriodo, info_periodo_mensual_eventuales.pe_FechaIni, info_periodo_mensual_eventuales.pe_FechaFin,Convert.ToInt32( info_ev.IdEmpleado)); bus_rol.procesar(param.IdEmpresa, 2, 5, info_Perioso_x_nominaMensual.IdPeriodo, item.idempleado, "spRo_nomina_liquidacion_cliente", "", param.IdUsuario); //inforolEventuales = bus_rol.GetInfoConsultaPorRol(param.IdEmpresa, 2, 5, info_Perioso_x_nominaMensual.IdPeriodo, ref msg); } MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Se_guardaron_los_datos_correctamente), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); Generar_Excell(); splashScreenManagereEspera.CloseWaitForm(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); splashScreenManagereEspera.CloseWaitForm(); } }
private void pu_ActualizarRubroEmpleado(decimal idEmpleado, string em_status) { try { pu_CargarValores(); ro_Rol_Bus oRo_Rol_Bus = new ro_Rol_Bus(param.IdEmpresa, _idNominaTipo, _idNominaTipoLiqui, oRo_PeriodoInfo); } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
void bw_DoWork(object sender, DoWorkEventArgs e) { try { int i = 0; int numFila = 0; double percent = 0; mensaje = ""; //VALIDACIONES if (pu_Validar()) { //VALIDA SI PUEDO CARGAR CABECERA if (pu_GetInfoCabecera()) { //INSTANCIAR EL OBJETO ROL oRo_Rol_Bus = new ro_Rol_Bus(oRo_Rol_Info, oRo_PeriodoInfo); //GUARDA LA CABECERA EN LA B/D if (oRo_Rol_Bus.GuardarBD(ref mensaje)) { //VERIFICA SI ESTA SELECCIONADO PROCESAR TODOS numFila = oBindingLstEmpleado.Count; i = 0; if (checkTodos.Checked == true) { foreach (ro_Empleado_Info item in oBindingLstEmpleado) { //DETIENE EL PROCESO SOLICTADO POR EL USUARIO if (bw.CancellationPending) { e.Cancel = true; return; } //EJECUTA EL PROCESO DE GENERACION DE ROL if (item.check == true) { oRo_Rol_Bus.pu_ProcesarRol(item); } i++; percent = (Convert.ToDouble(i) / Convert.ToDouble(numFila)) * 100; bw.ReportProgress((int)percent); } } else { foreach (ro_Empleado_Info item in oBindingLstEmpleado) { //DETIENE EL PROCESO SOLICTADO POR EL USUARIO if (bw.CancellationPending) { e.Cancel = true; return; } //SE PROCESAN UNICAMENTE LOS REGISTROS SELECCIONADOS if (item.check == true) { //EJECUTA EL PROCESO DE GENERACION DE ROL oRo_Rol_Bus.pu_ProcesarRol(item); } i++; percent = (Convert.ToDouble(i) / Convert.ToDouble(numFila)) * 100; bw.ReportProgress((int)percent); } } } else { MessageBox.Show(mensaje, "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); } }