public bool Guardar_DB(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { bool bandera = false; decimal id_nov = 0; try { if (data.Guardar_DB(info)) { if (Bus_Detalle.Guardar_DB(info.detalle)) { foreach (var item in Get_Novedades(info.detalle)) { bandera = bus_novedad.GrabarDB(item, ref id_nov); } } } return(bandera); } catch (Exception ex) { mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(mensaje); } }
void Get() { try { info_efectividad_entrega = new ro_fectividad_x_empleado_Adm_x_periodo_Info(); info_efectividad_entrega.detalle = new List <ro_fectividad_x_empleado_Adm_x_periodo_Det_Info>(); info_efectividad_entrega.IdEmpresa = param.IdEmpresa; info_efectividad_entrega.IdNomina_Tipo = Convert.ToInt32(cmbnomina.EditValue); info_efectividad_entrega.IdNomina_Tipo_Liq = Convert.ToInt32(cmbnominaTipo.EditValue); info_efectividad_entrega.IdPeriodo = Convert.ToInt32(cmbPeriodos.EditValue); info_efectividad_entrega.Observacion = txt_observacion.Text; info_efectividad_entrega.IdUsuario = param.IdUsuario; info_efectividad_entrega.Fecha_Transaccion = DateTime.Now; info_efectividad_entrega.IdUsuarioUltModi = param.IdUsuario; info_efectividad_entrega.Fecha_UltMod = DateTime.Now; foreach (var item in lista_detalle) { item.IdEmpresa = param.IdEmpresa; item.IdPeriodo = Convert.ToInt32(cmbPeriodos.EditValue); item.IdNomina_Tipo = Convert.ToInt32(cmbnomina.EditValue); item.IdNomina_Tipo_Liq = Convert.ToInt32(cmbnominaTipo.EditValue); item.fechaPago = ro_periodo_info.pe_FechaIni.AddDays(1); } info_efectividad_entrega.detalle = lista_detalle.ToList(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public bool Anular_DB(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { try { using (EntityRoles_FJ db = new EntityRoles_FJ()) { var add = db.ro_fectividad_x_empleado_Adm_x_periodo.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdNomina_Tipo == info.IdNomina_Tipo && v.IdPeriodo == info.IdPeriodo); add.Estado = false; add.Fecha_UltAnu = info.Fecha_UltAnu; add.IdUsuarioUltAnu = info.IdUsuarioUltAnu; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Guardar_DB(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { try { using (EntityRoles_FJ db = new EntityRoles_FJ()) { ro_fectividad_x_empleado_Adm_x_periodo add = new ro_fectividad_x_empleado_Adm_x_periodo(); add.IdEmpresa = info.IdEmpresa; add.IdNomina_Tipo = info.IdNomina_Tipo; add.IdNomina_Tipo_Liq = info.IdNomina_Tipo_Liq; add.IdPeriodo = info.IdPeriodo; add.Observacion = info.Observacion; add.Fecha_Transaccion = info.Fecha_Transaccion; add.IdUsuario = info.IdUsuario; add.Estado = info.Estado; db.ro_fectividad_x_empleado_Adm_x_periodo.Add(add); 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Anular_DB(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { try { return(data.Anular_DB(info)); } catch (Exception ex) { mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(mensaje); } }
public void Set(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { try { txt_observacion.Text = info.Observacion; cmbnomina.EditValue = info.IdNomina_Tipo; cmbnominaTipo.EditValue = info.IdNomina_Tipo_Liq; cmbPeriodos.EditValue = info.IdPeriodo; lista_detalle = new BindingList <ro_fectividad_x_empleado_Adm_x_periodo_Det_Info>(bus_detalle.lista_Efectividad_x_empleado_x_periodod(param.IdEmpresa, info.IdNomina_Tipo, info.IdNomina_Tipo_Liq, info.IdPeriodo)); gridControl_empleados.DataSource = lista_detalle; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public List <ro_fectividad_x_empleado_Adm_x_periodo_Info> lista_Efectividad_x_periodod(int IdEmpresa, DateTime Fecha_Inicio, DateTime Fecha_fin) { try { List <ro_fectividad_x_empleado_Adm_x_periodo_Info> lista = new List <ro_fectividad_x_empleado_Adm_x_periodo_Info>(); using (EntityRoles_FJ db = new EntityRoles_FJ()) { var query = from q in db.ro_fectividad_x_empleado_Adm_x_periodo where q.IdEmpresa == IdEmpresa // && q.pe_FechaIni >= Fecha_Inicio // && q.pe_FechaIni <= Fecha_fin select q; foreach (var item in query) { ro_fectividad_x_empleado_Adm_x_periodo_Info info = new ro_fectividad_x_empleado_Adm_x_periodo_Info(); info.IdEmpresa = item.IdEmpresa; info.IdNomina_Tipo = item.IdNomina_Tipo; info.IdNomina_Tipo_Liq = item.IdNomina_Tipo_Liq; info.Observacion = item.Observacion; info.IdPeriodo = item.IdPeriodo; info.Estado = item.Estado; // info.pe_FechaFin = item.pe_FechaIni; // info.pe_FechaFin = item.pe_FechaFin; lista.Add(info); } } return(lista); } 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()); } }
private void ucGe_Menu_event_btnconsultar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { info = (ro_fectividad_x_empleado_Adm_x_periodo_Info)GridView_RegistroPorcentaje.GetFocusedRow(); if (info == null) { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmRo_Registro_valores_pago_variables_Mant frm = new frmRo_Registro_valores_pago_variables_Mant(); frm.Accion = Cl_Enumeradores.eTipo_action.consultar; frm.MdiParent = this.MdiParent; frm.Set(info); frm.Show(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public bool Modificar_DB(ro_fectividad_x_empleado_Adm_x_periodo_Info info) { bool bandera = false; decimal id_nov = 0; try { if (data.Modificar_DB(info)) { if (Bus_Detalle.Modificar_DB(info.detalle)) { foreach (var item in Get_Novedades(info.detalle)) { info_detalle = bus_detalle_novedad.get_si_existe_novedad(item.IdEmpresa, item.IdEmpleado, item.IdRubro, item.IdCalendario); if (info_detalle != null) { item.IdNovedad = info_detalle.IdNovedad; bandera = bus_novedad.ModificarDB(item); } else { bandera = bus_novedad.GrabarDB(item, ref id_nov); } } } } return(bandera); } catch (Exception ex) { mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(mensaje); } }