Beispiel #1
0
        public Boolean GrabarBD(ro_presupuesto_x_fuerza_x_cargo_Info info, ref string msg)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var contact = (from a in db.ro_presupuesto_x_fuerza_x_cargo
                                   where a.IdEmpresa == info.IdEmpresa &&
                                   a.IdNomina == info.IdNomina &&
                                   a.IdFuerza == info.IdFuerza &&
                                   a.Anio == info.Anio &&
                                   a.Mes == info.Mes &&
                                   a.IdCargo == info.IdCargo
                                   select a).FirstOrDefault();
                    if (contact != null)
                    {
                        contact.CantidadEmpleados  = info.CantidadEmpleados;
                        contact.Presupuesto        = info.Presupuesto;
                        contact.Observacion        = info.Observacion;
                        contact.diasEfectivos      = info.diasEfectivos;
                        contact.Dias_SyD_y_Feriado = info.Dias_SyD_y_Feriado;
                        contact.BaseVariable       = info.BaseVariable;
                        db.SaveChanges();
                    }

                    else
                    {
                        ro_presupuesto_x_fuerza_x_cargo add = new ro_presupuesto_x_fuerza_x_cargo();

                        add.IdEmpresa          = info.IdEmpresa;
                        add.IdNomina           = info.IdNomina;
                        add.Anio               = info.Anio;
                        add.Mes                = info.Mes;
                        add.IdFuerza           = info.IdFuerza;
                        add.IdCargo            = info.IdCargo;
                        add.Presupuesto        = info.Presupuesto;
                        add.Observacion        = info.Observacion;
                        add.CantidadEmpleados  = info.CantidadEmpleados;
                        add.diasEfectivos      = info.diasEfectivos;
                        add.Dias_SyD_y_Feriado = info.Dias_SyD_y_Feriado;
                        add.BaseVariable       = info.BaseVariable;

                        db.ro_presupuesto_x_fuerza_x_cargo.Add(add);
                        db.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Beispiel #2
0
        public bool Modificar_DB(ro_Grupo_empleado_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_Grupo_empleado.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdGrupo == info.IdGrupo);

                    add.Nombre_Grupo               = info.Nombre_Grupo;
                    add.Max_num_horas_sab_dom      = info.Max_num_horas_sab_dom;
                    add.Calculo_Horas_extras_Sobre = info.Calculo_Horas_extras_Sobre;
                    add.Valor_bono      = info.Valor_bono;
                    add.Fecha_UltMod    = DateTime.Now;
                    add.IdUsuarioUltMod = info.IdUsuarioUltMod;
                    add.IdRubro_Alim    = info.IdRubro_Alim;
                    add.IdRubro_Trans   = info.IdRubro_Trans;
                    add.Valor_Alimen    = info.Valor_Alimen;
                    add.Valor_Transp    = info.Valor_Transp;
                    add.Sueldo          = info.Sueldo;

                    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());
            }
        }
Beispiel #3
0
        public bool Cerrar_Planificacion(ro_planificacion_x_jornada_desfasada_Info Info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_planificacion_x_jornada_desfasada.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdPeriodo == Info.IdPeriodo && v.IdNomina_Tipo == Info.IdNomina_Tipo);
                    add.Esta_Proceso    = "CERRADO";
                    add.Fecha_UltMod    = DateTime.Now;
                    add.IdUsuarioUltMod = Info.IdUsuarioUltMod;
                    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());
            }
        }
Beispiel #4
0
        public bool Guardar_DB(ro_fectividad_Entrega_x_Periodo_Empleado_Info info, ref int IdEfectividad)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    ro_fectividad_Entrega_x_Periodo_Empleado add = new ro_fectividad_Entrega_x_Periodo_Empleado();
                    add.IdEmpresa         = info.IdEmpresa;
                    add.IdNomina_Tipo     = info.IdNomina_Tipo;
                    add.IdNomina_tipo_Liq = info.IdNomina_tipo_Liq;
                    add.IdEfectividad     = getId(info.IdEmpresa);
                    add.IdPeriodo         = info.IdPeriodo;
                    add.Observacion       = info.Observacion;
                    add.FechaTransac      = DateTime.Now;
                    add.IdUsuario         = info.IdUsuario;
                    add.Estado            = info.Estado;

                    db.ro_fectividad_Entrega_x_Periodo_Empleado.Add(add);
                    db.SaveChanges();
                    IdEfectividad = add.IdEfectividad;
                    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());
            }
        }
Beispiel #5
0
        public bool Anular_DB(List <ro_empleado_x_turno_Info> lista)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    foreach (var item in lista)
                    {
                        var add = db.ro_empleado_x_turno.FirstOrDefault(v => v.IdEmpresa == item.IdEmpresa &&
                                                                        v.IdPeriodo == item.IdPeriodo && v.IdEmpleado == item.IdEmpleado);
                        add.Estado = "I";
                        db.ro_empleado_x_turno.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());
            }
        }
Beispiel #6
0
 public bool Modificar_DB(List <ro_Grupo_empleado_det_Info> lista)
 {
     try
     {
         int sec = 0;
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             foreach (var info in lista)
             {
                 if (sec == 0)
                 {
                     db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_Grupo_empleado_det where IdEmpresa='" + info.IdEmpresa + "' and IdGrupo='" + info.IdGrupo + "' ");
                 }
                 sec++;
                 ro_Grupo_empleado_det add = new ro_Grupo_empleado_det();
                 add.IdEmpresa          = info.IdEmpresa;
                 add.IdGrupo            = info.IdGrupo;
                 add.cod_Pago_Variable  = info.cod_Pago_Variable;
                 add.Porcentaje_calculo = info.Porcentaje_calculo;
                 db.ro_Grupo_empleado_det.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 AnularDB(ro_Calculo_Pago_Variable_Porcentaje_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_Calculo_Pago_Variable_Porcentaje contact = Context.ro_Calculo_Pago_Variable_Porcentaje.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdTipo_Nomina == Info.IdTipo_Nomina && q.IdTipoServicio == Info.IdTipoServicio);
                    if (contact != null)
                    {
                        contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                        contact.Fecha_UltAnu    = Info.Fecha_UltAnu;
                        contact.MotivoAnulacion = Info.MotivoAnulacion;
                        contact.Estado          = false;

                        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 mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Beispiel #8
0
        public bool ModificarDB(List <ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar_Info> lista)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    foreach (var item in lista)
                    {
                        var modifi = db.ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar.FirstOrDefault(v => v.IdEmpresa == item.IdEmpresa && v.IdEmpleado == item.IdEmpleado && v.IdRegistro == item.IdRegistro);
                        if (modifi != null)
                        {
                            modifi.Estado_aprobacion = true;
                            db.SaveChanges();
                        }
                    }
                }

                return(true);
            }
            catch (DbEntityValidationException ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public bool Anular_DB(ro_parametro_x_pago_variable_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_parametro_x_pago_variable.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdNomina_Tipo == info.IdNomina_Tipo && v.Id_Tipo_Pago_Variable == info.Id_Tipo_Pago_Variable);

                    add.Fecha_UltAnu    = DateTime.Now;
                    add.IdUsuarioUltAnu = info.IdUsuario;
                    add.MotivoAnulacion = info.MotivoAnulacion;
                    add.Estado          = false;
                    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 Modificar_DB(List <ro_parametro_x_pago_variable_tipo_Info> lista)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    foreach (var info in lista)
                    {
                        var contact = db.ro_parametro_x_pago_variable_tipo.First(obj => obj.IdEmpresa == info.IdEmpresa &&
                                                                                 obj.cod_Pago_Variable == info.cod_Pago_Variable);

                        contact.IdRubro           = info.IdRubro;
                        contact.nom_Pago_Variable = info.nom_Pago_Variable;
                        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 ModificarDB(ro_Calculo_Pago_Variable_Porcentaje_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_Calculo_Pago_Variable_Porcentaje contact = Context.ro_Calculo_Pago_Variable_Porcentaje.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdTipo_Nomina == Info.IdTipo_Nomina);
                    if (contact != null)
                    {
                        contact.Efec_Entrega_Rango   = Info.Efec_Entrega_Rango;
                        contact.Efec_Entrega_Aplica  = Info.Efec_Entrega_Aplica;
                        contact.Efec_Volumen_Rango   = Info.Efec_Volumen_Rango;
                        contact.Efec_Volumen_Aplica  = Info.Efec_Volumen_Aplica;
                        contact.Recup_Cartera_Rango  = Info.Recup_Cartera_Rango;
                        contact.Recup_Cartera_Aplica = Info.Recup_Cartera_Aplica;
                        contact.IdUsuarioUltModi     = Info.IdUsuarioUltModi;

                        contact.Fecha_UltMod = DateTime.Now;
                        contact.nom_pc       = Info.nom_pc;
                        contact.ip           = Info.ip;
                        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 mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Beispiel #12
0
        public bool Modificar_DB(ro_descuento_no_planificados_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_descuento_no_planificados.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa &&
                                                                             v.IdEmpleado == info.IdEmpleado &&
                                                                             v.IdNomina_Tipo == info.IdNomina_Tipo &&
                                                                             v.IdDescuento == info.IdDescuento);

                    add.IdRubro         = info.IdRubro;
                    add.Observacion     = info.Observacion;
                    add.Valor           = info.Valor;
                    add.Fecha_Incidente = info.Fecha_Incidente;
                    add.IdNovedad       = info.IdNovedad;
                    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());
            }
        }
Beispiel #13
0
 public bool Guardar_DB(ro_descuento_no_planificados_Info info, ref int idgrupo)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_descuento_no_planificados add = new ro_descuento_no_planificados();
             add.IdEmpresa         = info.IdEmpresa;
             add.IdNomina_Tipo     = info.IdNomina_Tipo;
             add.IdEmpleado        = info.IdEmpleado;
             add.IdDescuento       = info.IdDescuento = GetId(info.IdEmpresa);
             add.IdRubro           = info.IdRubro;
             add.Observacion       = info.Observacion;
             add.Valor             = info.Valor;
             add.Estado            = true;
             add.Fecha_Transaccion = info.Fecha_Transaccion;
             add.IdUsuario         = info.IdUsuario;
             add.Fecha_Incidente   = info.Fecha_Incidente;
             db.ro_descuento_no_planificados.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());
     }
 }
Beispiel #14
0
 public bool ModificarDB(ro_fuerza_Info Info, ref string mensaje)
 {
     try
     {
         using (EntityRoles_FJ Context = new EntityRoles_FJ())
         {
             ro_fuerza contact = Context.ro_fuerza.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdFuerza == Info.IdFuerza);
             if (contact != null)
             {
                 contact.fu_descripcion   = Info.fu_descripcion;
                 contact.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                 contact.Fecha_UltMod     = DateTime.Now;
                 contact.nom_pc           = Info.nom_pc;
                 contact.ip                = Info.ip;
                 contact.IdCentroCosto     = Info.IdCentroCosto;
                 contact.IdSuccentroCosto  = Info.IdSuccentroCosto;
                 contact.cedula_gasto      = Info.cedula_gasto;
                 contact.descripcion_gasto = Info.descripcion_gasto;
                 contact.valor_gasto       = Info.valor_gasto;
                 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 mensaje);
         mensaje = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
        public bool Anular_DB(ro_planificacion_x_jornada_desfasada_Info Info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_planificacion_x_jornada_desfasada.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdPeriodo == Info.IdPeriodo);
                    add.Estado = "I";
                    db.ro_planificacion_x_jornada_desfasada.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());
            }
        }
Beispiel #16
0
 public bool ModificarDB(ro_placa_Info Info, ref string mensaje)
 {
     try
     {
         using (EntityRoles_FJ Context = new EntityRoles_FJ())
         {
             ro_placa contact = Context.ro_placa.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdPlaca == Info.IdPlaca);
             if (contact != null)
             {
                 contact.Placa            = Info.Placa;
                 contact.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                 contact.Fecha_UltMod     = DateTime.Now;
                 contact.nom_pc           = Info.nom_pc;
                 contact.ip = Info.ip;
                 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 mensaje);
         mensaje = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
        public bool ModificarDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_fectividad_Entrega_tipoServicio contact = Context.ro_fectividad_Entrega_tipoServicio.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdServicio == Info.IdServicio);
                    if (contact != null)
                    {
                        contact.ts_Descripcion = Info.ts_Descripcion;
                        contact.ts_codigo      = Info.ts_codigo;
                        contact.Porcentaje     = Info.Porcentaje;

                        contact.Efectividad_entrega  = Info.Efectividad_entrega;
                        contact.Efectividad_volumen  = Info.Efectividad_volumen;
                        contact.Recuperacion_cartera = Info.Recuperacion_cartera;
                        contact.Genera_novedad       = Info.Genera_novedad;

                        contact.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                        contact.Fecha_UltMod     = DateTime.Now;
                        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 mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Beispiel #18
0
        public bool Anular_DB(ro_Remplazo_x_emplado_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_Remplazo_x_emplado.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdEmpleado == info.IdEmpleado && v.Id_remplazo == info.Id_remplazo);

                    add.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    add.Fecha_UltAnu    = info.Fecha_UltAnu;
                    add.MotiAnula       = info.MotiAnula;
                    add.Estado          = "I";
                    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());
            }
        }
Beispiel #19
0
 public bool GuardarDB(ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar_Info info)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar add = new ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar();
             add.IdEmpleado        = info.IdEmpleado;
             add.IdNomina_Tipo     = info.IdNomina;
             add.IdEmpresa         = info.IdEmpresa;
             add.IdRegistro        = info.IdRegistro;
             add.IdRubro           = info.IdRubro;
             add.es_fecha_registro = info.es_fecha_registro;
             add.Num_horasExtras   = info.Num_horasExtras;
             add.Observacion       = info.Observacion;
             add.Estado_aprobacion = false;
             db.ro_empleado_Novedad_x_horasExtras_Pendiente_Aprobar.Add(add);
             db.SaveChanges();
             return(true);
         }
     }
     catch (DbEntityValidationException ex)
     {
         string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Beispiel #20
0
        public bool Modificar_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.Observacion      = info.Observacion;
                    add.Fecha_UltMod     = info.Fecha_UltMod;
                    add.IdUsuarioUltModi = info.IdUsuarioUltModi;

                    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());
            }
        }
Beispiel #21
0
 public bool Guardar_DB(List <ro_Grupo_empleado_det_Info> lista)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             foreach (var item in lista)
             {
                 ro_Grupo_empleado_det add = new ro_Grupo_empleado_det();
                 add.IdEmpresa         = item.IdEmpresa;
                 add.IdGrupo           = item.IdGrupo;
                 add.cod_Pago_Variable = item.cod_Pago_Variable;
                 //add.Valor = item.Valor;
                 //  add.Observacion = item.Observacion;
                 db.ro_Grupo_empleado_det.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 ModificarDB(ro_Parametro_calculo_Horas_Extras_Info info)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             var modific = db.ro_Parametro_calculo_Horas_Extras.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa);
             modific.Se_calcula_horas_Extras_al100 = info.Se_calcula_horas_Extras_al100;
             modific.Se_calcula_horas_Extras_al50  = info.Se_calcula_horas_Extras_al50;
             modific.Se_calcula_horas_Extras_al25  = info.Se_calcula_horas_Extras_al25;
             modific.Corte_Horas_extras            = info.Corte_Horas_extras;
             modific.Se_Crea_reverso_h_extras_si_Emp_tiene_remplazo = info.Se_Crea_reverso_h_extras_si_Emp_tiene_remplazo;
             modific.IdRubro_rev_Horas                   = info.IdRubro_rev_Horas;
             modific.IdRubro_Rebaja_Desahucio            = info.IdRubro_Rebaja_Desahucio;
             modific.considera_fecha_corte_dias_efectivo = info.considera_fecha_corte_dias_efectivo;
             modific.solo_graba_dias_efectivos           = info.solo_graba_dias_efectivos;
             modific.dias_integrales = info.dias_integrales;
             modific.MinutosLunch    = info.MinutosLunch;
             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());
     }
 }
Beispiel #23
0
 public bool Guardar_DB(ro_empleado_x_turno_Info info)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_empleado_x_turno add = new ro_empleado_x_turno();
             add.IdEmpresa     = info.IdEmpresa;
             add.IdNomina_Tipo = info.IdNomina_Tipo;
             add.IdEmpleado    = info.IdEmpleado;
             add.IdPeriodo     = info.IdPeriodo;
             add.IdTurno       = info.IdTurno;
             add.Observacion   = info.Observacion;
             add.IdUsuario     = info.IdUsuario;
             add.Fecha_Transac = DateTime.Now;
             add.Estado        = "A";
             db.ro_empleado_x_turno.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());
     }
 }
Beispiel #24
0
 public bool Guardar_DB(ro_empleado_x_parametro_x_pago_variable_Info info)
 {
     try
     {
         if (!si_Existe(info.IdEmpresa, info.IdNomina_Tipo, info.IdEmpleado))
         {
             using (EntityRoles_FJ db = new EntityRoles_FJ())
             {
                 ro_empleado_x_parametro_x_pago_variable add = new ro_empleado_x_parametro_x_pago_variable();
                 add.IdEmpresa         = info.IdEmpresa;
                 add.IdNomina_Tipo     = info.IdNomina_Tipo;;
                 add.IdEmpleado        = info.IdEmpleado;
                 add.IdUsuario         = info.IdUsuario;
                 add.Fecha_Transaccion = DateTime.Now;
                 add.Estado            = true;
                 db.ro_empleado_x_parametro_x_pago_variable.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());
     }
 }
Beispiel #25
0
        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());
            }
        }
Beispiel #26
0
 public bool Guardar_DB(ro_empleado_x_Activo_Fijo_Info info)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_empleado_x_Activo_Fijo add = new ro_empleado_x_Activo_Fijo();
             add.IdEmpresa        = info.IdEmpresa;
             add.IdNomina_tipo    = info.IdNomina_tipo;
             add.IdPeriodo        = info.IdPeriodo;
             add.IdActivo_fijo    = info.IdActivo_fijo;
             add.IdEmpleado       = info.IdEmpleado;
             add.Fecha_Asignacion = info.Fecha_Asignacion;
             add.Fecha_Hasta      = info.Fecha_Hasta;
             db.ro_empleado_x_Activo_Fijo.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());
     }
 }
Beispiel #27
0
        public bool Anular_DB(ro_fectividad_Entrega_x_Periodo_Empleado_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_planificacion_x_ruta_x_empleado.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdNomina_Tipo == info.IdNomina_Tipo && v.IdPeriodo == info.IdPeriodo);

                    add.Estado          = false;
                    add.Fecha_UltAnu    = DateTime.Now;
                    add.IdUsuarioUltAnu = info.IdUsuarioAnu;

                    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(List <ro_parametro_x_pago_variable_Det_Info> lista)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             foreach (var info in lista)
             {
                 ro_parametro_x_pago_variable_Det add = new ro_parametro_x_pago_variable_Det();
                 add.Idempresa             = info.Idempresa;
                 add.IdNomina_Tipo         = info.IdNomina_Tipo;
                 add.Id_Tipo_Pago_Variable = info.Id_Tipo_Pago_Variable;
                 add.Meta = info.Meta;
                 add.cod_Pago_Variable = info.cod_Pago_Variable;
                 add.Variable_porcentaje_prorrateado = info.Variable_porcentaje_prorrateado;
                 db.ro_parametro_x_pago_variable_Det.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());
     }
 }
Beispiel #29
0
        public bool Modificar_DB(ro_planificacion_x_jornada_desfasada_Info Info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var add = db.ro_planificacion_x_jornada_desfasada.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdPeriodo == Info.IdPeriodo && v.IdDivision == Info.IdDivision);
                    if (add != null)
                    {
                        add.Observación     = Info.Observación;
                        add.Fecha_UltMod    = DateTime.Now;
                        add.IdDivision      = Info.IdDivision;
                        add.IdUsuarioUltMod = Info.IdUsuarioUltMod;
                        db.SaveChanges();
                        Info.IdPlanificacion = add.IdPlanificacion;
                    }


                    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());
            }
        }
Beispiel #30
0
        public bool GuardarDB(ro_placa_Info Info, ref int IdPlaca, ref string mensaje)
        {
            try
            {
                IdPlaca = Get_Id(Info.IdEmpresa, ref mensaje);

                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_placa contact = new ro_placa();

                    contact.IdEmpresa         = Info.IdEmpresa;
                    contact.IdPlaca           = Info.IdPlaca = IdPlaca;
                    contact.Placa             = Info.Placa;
                    contact.Estado            = Info.Estado;
                    contact.IdUsuario         = Info.IdUsuario;
                    contact.Fecha_Transaccion = Info.Fecha_Transaccion;
                    contact.nom_pc            = Info.nom_pc;
                    contact.ip = Info.ip;

                    Context.ro_placa.Add(contact);
                    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 mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }