public Boolean ModificarDB(ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info item, ref string msg) { try { using (EntityRoles_FJ context = new EntityRoles_FJ()) { var contact = context.ro_marcaciones_x_empleado_x_incidentes_falt_Perm.First(obj => obj.IdEmpresa == item.IdEmpresa && obj.IdEmpleado == item.IdEmpleado && obj.IdRegistro == item.IdRegistro); contact.Id_catalogo_Cat = item.Id_catalogo_Cat; 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); throw new Exception(ex.InnerException.ToString()); } }
public Boolean EliminarDB(ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info item, ref string msg) { try { using (EntityRoles_FJ context = new EntityRoles_FJ()) { string sql1 = "delete Fj_servindustrias.ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar where IdEmpresa='" + item.IdEmpresa + "' and IdEmpleado='" + item.IdEmpleado + "' and IdRegistro='" + item.IdRegistro + "'"; context.Database.ExecuteSqlCommand(sql1); string sql = "delete Fj_servindustrias.ro_marcaciones_x_empleado_x_incidentes_falt_Perm where IdEmpresa='" + item.IdEmpresa + "' and IdEmpleado='" + item.IdEmpleado + "' and IdRegistro='" + item.IdRegistro + "'"; context.Database.ExecuteSqlCommand(sql); } 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); throw new Exception(ex.InnerException.ToString()); } }
private void gridView__novedades_x_asistencia_KeyDown(object sender, KeyEventArgs e) { try { string msg = ""; if (e.KeyCode.ToString() == "Delete") { // if (MessageBox.Show("¿ Esta seguro que desea Eliminar el registro?", "HORAS EXTRAS " + param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info info = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info(); info = (ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info)gridView__novedades_x_asistencia.GetFocusedRow(); bus_marcaciones.EliminarDB(info.IdEmpresa, info.IdEmpleado, info.IdRegistro); bus_novedades_x_ingreso.EliminarDB(info, ref msg); gridView__novedades_x_asistencia.DeleteSelectedRows(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); Log_Error_bus.Log_Error(ex.InnerException.ToString()); } }
public List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info> lista_atrasos_faltas_x_empleado(int IdEmpresa, int IdNominaTipo, int IdDivision, DateTime Fecha_Inicio, DateTime FechaFin) { try { Fecha_Inicio = Convert.ToDateTime(Fecha_Inicio.ToShortDateString()); FechaFin = Convert.ToDateTime(FechaFin.ToShortDateString()); List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info> lista = new List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info>(); using (EntityRoles_FJ db = new EntityRoles_FJ()) { var query = from q in db.vwro_marcaciones_x_empleado_x_incidentes_falt_Perm where q.IdEmpresa == IdEmpresa && q.es_fecha_registro >= Fecha_Inicio && q.es_fecha_registro <= FechaFin && q.IdNomina_Tipo == IdNominaTipo && q.IdDivision == IdDivision select q; foreach (var item in query) { ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info add = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info(); add.IdEmpresa = item.IdEmpresa; add.IdEmpleado = item.IdEmpleado; add.IdRegistro = item.IdRegistro; add.es_fecha_registro = Convert.ToDateTime(item.es_fecha_registro); add.Id_catalogo_Cat = item.Id_catalogo_Cat; add.Observacion = ""; add.de_descripcion = item.de_descripcion; add.ca_descripcion = item.ca_descripcion; add.pe_nombre = item.pe_nombre; add.pe_apellido = item.pe_apellido; add.pe_cedulaRuc = item.pe_cedulaRuc; // add.es_Hora = item.es_Hora; if (item.Id_catalogo_Cat == "ATRA") { add.imagen = 1; } if (item.Id_catalogo_Cat == "PER") { add.imagen = 2; } add.check = false; lista.Add(add); } } 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()); } }
public Boolean EliminarDB(ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info item, ref string msg) { try { return(data.EliminarDB(item, ref msg)); } 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 List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info> Get_listaEventuales_con_marcaciones(int IdEmpresa, int idnomina, DateTime Fecha_Inicio, DateTime FechaFin) { try { Fecha_Inicio = Fecha_Inicio.Date; FechaFin = FechaFin.Date; List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info> lista = new List <ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info>(); using (EntityRoles_FJ db = new EntityRoles_FJ()) { var query = from q in db.spro_Eventuales_con_marcaciones(IdEmpresa, idnomina, Fecha_Inicio, FechaFin) //where q.IdEmpresa == IdEmpresa //&& q.es_fecha_registro >= Fecha_Inicio //&& q.es_fecha_registro <= FechaFin select q; foreach (var item in query) { ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info add = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info(); add.IdEmpresa = item.IdEmpresa; add.IdEmpleado = item.IdEmpleado; add.IdNomina_Tipo = item.IdNomina_Tipo; add.ca_descripcion = item.ca_descripcion; add.NombreCompleto = item.NombreCompleto; add.IdCargo = item.IdCargo; add.IdGrupo = item.IdGrupo; lista.Add(add); } } 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 gridView__novedades_x_asistencia_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { try { if (e.Column.Name == "col_imagen") { ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info info = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info(); info = (ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info)gridView__novedades_x_asistencia.GetFocusedRow(); if (info != null) { // SI ES PERMISO if (info.Id_catalogo_Cat == "PER") { frmRo_Permisos_x_Empleado_Mant frm = new frmRo_Permisos_x_Empleado_Mant(); frm.setAccion(Cl_Enumeradores.eTipo_action.grabar); frm.set_IdEmpleado(Convert.ToInt32(info.IdEmpleado)); frm.Show(); } // SI ES ATRAZO if (info.Id_catalogo_Cat == "ATRA") { frmRo_Empleado_Novedad_Mant frm = new frmRo_Empleado_Novedad_Mant(); frm.set_Accion(Cl_Enumeradores.eTipo_action.grabar); frm.SetEmpleado(1, Convert.ToInt32(info.IdEmpleado)); frm.ShowDialog(); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
public bool Grabar_DB(ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info info) { try { using (EntityRoles_FJ db = new EntityRoles_FJ()) { ro_marcaciones_x_empleado_x_incidentes_falt_Perm add = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm(); add.IdEmpresa = info.IdEmpresa; add.IdNomina_Tipo = info.IdNomina_Tipo; add.IdEmpleado = info.IdEmpleado; add.IdRegistro = info.IdRegistro; if (info.IdTurno == 0 || info.IdTurno == null) { add.IdTurno = 1; } else { add.IdTurno = info.IdTurno; } add.es_fecha_registro = info.es_fecha_registro; add.Id_catalogo_Cat = info.Id_catalogo_Cat; add.es_jornada_desfasada = info.es_jornada_desfasada; if (info.IdSala == 0) { add.IdSala = null; } else { add.IdSala = info.IdSala; } if (info.IdRuta == 0) { add.IdRuta = null; } else { add.IdRuta = info.IdRuta; } if (info.IdDisco == 0) { add.IdDisco = null; } else { add.IdDisco = info.IdDisco; } add.Observacion = ""; db.ro_marcaciones_x_empleado_x_incidentes_falt_Perm.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 ro_marcaciones_x_empleado_Info() { info_novedad_x_ingreso = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info(); }
public bool Grabar_DB(ro_marcaciones_x_empleado_x_incidentes_falt_Perm_Info info) { try { using (EntityRoles_FJ db = new EntityRoles_FJ()) { ro_marcaciones_x_empleado_x_incidentes_falt_Perm add = new ro_marcaciones_x_empleado_x_incidentes_falt_Perm(); add.IdEmpresa = info.IdEmpresa; add.IdNomina_Tipo = info.IdNomina_Tipo; add.IdEmpleado = info.IdEmpleado; add.IdRegistro = info.IdRegistro; if (info.IdTurno == 0 || info.IdTurno == null) { add.IdTurno = 1; } else { add.IdTurno = info.IdTurno; } add.es_fecha_registro = info.es_fecha_registro; add.Id_catalogo_Cat = info.Id_catalogo_Cat; add.es_jornada_desfasada = info.es_jornada_desfasada; if (info.IdSala == 0) { add.IdSala = null; } else { add.IdSala = info.IdSala; } if (info.IdRuta == 0) { add.IdRuta = null; } else { add.IdRuta = info.IdRuta; } if (info.IdDisco == 0) { add.IdDisco = null; } else { add.IdDisco = info.IdDisco; } add.Observacion = ""; db.ro_marcaciones_x_empleado_x_incidentes_falt_Perm.Add(add); if (info.Id_catalogo_Cat == "SINLABORAR" && Convert.ToInt32(Convert.ToDateTime(info.es_fecha_registro).DayOfWeek) == 1) { DateTime fdesfazada = info.es_fecha_registro.AddDays(5); db.ro_marcaciones_no_aplica_sobretiempo.Add(new ro_marcaciones_no_aplica_sobretiempo { IdEmpresa = info.IdEmpresa, IdEmpleado = info.IdEmpleado, IdRegistro = info.IdRegistro, es_fecha_registro = fdesfazada, Observacion = "DESFAZADA POR EL DIA " + info.es_fecha_registro.ToString().Substring(0, 10) }); } 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()); } }