Пример #1
0
        public void Get()
        {
            try
            {
                if (lista_empleados_x_parametros.Where(v => v.check == true).Count() == 0)
                {
                    MessageBox.Show("No existe ningun empleado seleccionado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    Info_ro_empleado_x_parametro_x_pago_variable = new ro_empleado_x_parametro_x_pago_variable_Info();

                    Info_ro_empleado_x_parametro_x_pago_variable               = lista_empleados_x_parametros.Where(v => v.check == true).FirstOrDefault();
                    Info_ro_empleado_x_parametro_x_pago_variable.IdEmpresa     = param.IdEmpresa;
                    Info_ro_empleado_x_parametro_x_pago_variable.IdNomina_Tipo = Get_idemNomina(Info_ro_empleado_x_parametro_x_pago_variable.IdEmpleado);
                    Info_ro_empleado_x_parametro_x_pago_variable.Lista         = Detalle;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void gridView_Empleados_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            try
            {
                if (e.HitInfo.Column.Name == "check")
                {
                    gridView_Empleados.SetFocusedRowCellValue(Colicono_eliminar, true);
                    if ((bool)gridView_Empleados.GetFocusedRowCellValue(Col_check))
                    {
                        gridView_Empleados.SetFocusedRowCellValue(Col_check, false);
                    }
                }
                if (e.HitInfo.Column.Name == "Colicono_eliminar")
                {
                    DialogResult dialogResult = MessageBox.Show("¿Esta seguro de querer eliminar el registro?", param.Nombre_sistema, MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        Info_ro_empleado_x_parametro_x_pago_variable = (ro_empleado_x_parametro_x_pago_variable_Info)gridView_Empleados.GetFocusedRow();
                        gridView_Empleados.DeleteSelectedRows();

                        bus_empleado_x_parametro_pago_variable.Anular_DB(Info_ro_empleado_x_parametro_x_pago_variable);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
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());
     }
 }
        public bool Guardar_DB(ro_empleado_x_parametro_x_pago_variable_Info info)
        {
            bool bandera = false;

            try
            {
                if (data.Guardar_DB(info))
                {
                    int sec = 0;
                    foreach (var item in info.Lista)
                    {
                        sec++;
                        item.IdEmpleado    = info.IdEmpleado;
                        item.IdEmpresa     = info.IdEmpresa;
                        item.IdNomina_Tipo = info.IdNomina_Tipo;
                        item.Secuencia     = sec;
                    }
                    bandera = bus_detalle.Guardar_DB(info.Lista);
                }

                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);
            }
        }
 public bool Anular_DB(ro_empleado_x_parametro_x_pago_variable_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 List <ro_empleado_x_parametro_x_pago_variable_Info> listado_empleado_x_parametro_variables(int IdEmpresa)
        {
            try
            {
                List <ro_empleado_x_parametro_x_pago_variable_Info> lista = new List <ro_empleado_x_parametro_x_pago_variable_Info>();
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var query = from q in db.vwro_empleado_x_parametro_x_pago_variable
                                where
                                q.IdEmpresa == IdEmpresa

                                select q;

                    foreach (var item in query)
                    {
                        ro_empleado_x_parametro_x_pago_variable_Info info = new ro_empleado_x_parametro_x_pago_variable_Info();

                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdNomina_Tipo     = item.IdNomina_Tipo;;
                        info.IdEmpleado        = item.IdEmpleado;
                        info.pe_cedulaRuc      = item.pe_cedulaRuc;
                        info.pe_nombre         = item.pe_nombre;
                        info.pe_apellido       = item.pe_apellido;
                        info.pe_nombreCompleto = item.pe_apellido + " " + item.pe_nombre;
                        info.IdFuerza          = item.IdFuerza;
                        info.icono_eliminar    = true;
                        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());
            }
        }
Пример #7
0
        private void repositoryItemCheckEdit1_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
        {
            try
            {
                gridView_Empleados.SetFocusedRowCellValue(Colicono_eliminar, true);
                foreach (var item in lista_empleados_x_parametros)
                {
                    item.check = false;
                }
                Info_ro_empleado_x_parametro_x_pago_variable = (ro_empleado_x_parametro_x_pago_variable_Info)gridView_Empleados.GetFocusedRow();
                Detalle = bus_empleado_x_parametro_pago_variable_detalle.lista_paramatrso_x_empleados(Info_ro_empleado_x_parametro_x_pago_variable.IdEmpresa, Info_ro_empleado_x_parametro_x_pago_variable.IdNomina_Tipo, Convert.ToInt32(Info_ro_empleado_x_parametro_x_pago_variable.IdEmpleado));
                gridControl_parametros_variables.DataSource = Detalle;
                gridControl_Empleados.RefreshDataSource();
            }

            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #8
0
        public bool Anular_DB(ro_empleado_x_parametro_x_pago_variable_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_empleado_x_parametro_x_pago_variable_Det where IdEmpresa='" + info.IdEmpresa + "' and IdNomina_Tipo= '" + info.IdNomina_Tipo + "' and IdEmpleado='" + info.IdEmpleado + "'");

                    db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_empleado_x_parametro_x_pago_variable where IdEmpresa='" + info.IdEmpresa + "' and IdNomina_Tipo= '" + info.IdNomina_Tipo + "' and IdEmpleado='" + info.IdEmpleado + "'");
                    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());
            }
        }