public bool Modificar_DB(ro_parametro_x_pago_variable_Info info)
        {
            bool bandera = true;

            try
            {
                if (data.Modificar_DB(info))
                {
                    foreach (var item in info.detalle)
                    {
                        item.Idempresa             = info.IdEmpresa;
                        item.IdNomina_Tipo         = info.IdNomina_Tipo;
                        item.Id_Tipo_Pago_Variable = info.Id_Tipo_Pago_Variable;
                    }
                    bandera = data_detalle.Modificar_DB(info.detalle);
                }

                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);
            }
        }
        private void ucGe_Menu_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                info = (ro_parametro_x_pago_variable_Info)gridView_parametros_variables.GetFocusedRow();
                if (info.Estado == false)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.El_registro_se_encuentra_anulado), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (info == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                frmRo_Parametro_Pago_Variable_Adm_Mant frm = new frmRo_Parametro_Pago_Variable_Adm_Mant();
                frm.Accion    = Cl_Enumeradores.eTipo_action.Anular;
                frm.MdiParent = this.MdiParent;
                frm.Set(info);
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log_Error_bus.Log_Error(ex.Message);
            }
        }
        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 Guardar_DB(ro_parametro_x_pago_variable_Info info, ref int idgrupo)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_parametro_x_pago_variable add = new ro_parametro_x_pago_variable();
             add.IdEmpresa             = info.IdEmpresa;
             add.IdNomina_Tipo         = info.IdNomina_Tipo;
             add.Id_Tipo_Pago_Variable = GetId(info.IdEmpresa);
             add.Nombre            = info.Nombre;
             add.IdUsuario         = info.IdUsuario;
             add.Fecha_Transaccion = DateTime.Now;
             add.Estado            = true;
             db.ro_parametro_x_pago_variable.Add(add);
             db.SaveChanges();
             idgrupo = add.Id_Tipo_Pago_Variable;
             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
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (lista_empleados_x_parametros.Count() == 0)
                {
                    MessageBox.Show("No existe ningun empleado seleccionado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    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;
                    }
                }

                ro_empleado_x_parametro_x_pago_variable_Det_Info info_parametrso_x_empleado = new ro_empleado_x_parametro_x_pago_variable_Det_Info();

                ro_parametro_x_pago_variable_Info info = (ro_parametro_x_pago_variable_Info)cmb_parametros_variable.Properties.View.GetFocusedRow();
                if (info != null)
                {
                    var query = Detalle.Where(v => v.Id_Tipo_Pago_Variable == info.Id_Tipo_Pago_Variable);
                    if (query.Count() > 0)
                    {
                        MessageBox.Show("El registro seleccionado ya se encuebtra en la lsita", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        ro_empleado_x_parametro_x_pago_variable_Det_Info info_de = new ro_empleado_x_parametro_x_pago_variable_Det_Info();
                        info_de.IdEmpresa             = info.IdEmpresa;
                        info_de.Nombre                = info.Nombre;
                        info_de.Id_Tipo_Pago_Variable = info.Id_Tipo_Pago_Variable;
                        info_de.icono_eliminar        = true;
                        Detalle.Add(info_de);
                    }
                }


                gridControl_parametros_variables.DataSource = Detalle;
                gridControl_parametros_variables.RefreshDataSource();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public bool Anular_DB(ro_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 void Set(ro_parametro_x_pago_variable_Info info_)
 {
     try
     {
         Info = info_;
         cmbnomina.EditValue             = Info.IdNomina_Tipo;
         txtNombre.EditValue             = Info.Nombre;
         txtid.EditValue                 = Info.Id_Tipo_Pago_Variable;
         lista_detalle                   = new BindingList <ro_parametro_x_pago_variable_Det_Info>(bus_detalle.Get_lista_oaram_pago_variable(info_.IdEmpresa, info_.IdNomina_Tipo, info_.Id_Tipo_Pago_Variable));
         gridControl_Variable.DataSource = lista_detalle;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString());
     }
 }
        public List <ro_parametro_x_pago_variable_Info> listado_parametro_pago_variable(int IdEmpresa)
        {
            try
            {
                List <ro_parametro_x_pago_variable_Info> lista = new List <ro_parametro_x_pago_variable_Info>();
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var query = from q in db.ro_parametro_x_pago_variable
                                where
                                q.IdEmpresa == IdEmpresa

                                select q;

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

                        info.Nombre                = item.Nombre;
                        info.Estado                = item.Estado;
                        info.IdNomina_Tipo         = item.IdNomina_Tipo;
                        info.IdEmpresa             = item.IdEmpresa;
                        info.Id_Tipo_Pago_Variable = item.Id_Tipo_Pago_Variable;

                        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());
            }
        }