Beispiel #1
0
        private void ucGe_Menu_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                info = (ro_descuento_no_planificados_Info)gridView_descuento.GetFocusedRow();
                if (info == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (info.Estado == false)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Ya_se_encuentra_anulado), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                frm           = new frm_Ro_Planificacion_Descuento_Mant();
                frm.Accion    = Cl_Enumeradores.eTipo_action.Anular;
                frm.MdiParent = this.MdiParent;
                frm.Set(info);
                frm.Show();
                //  frm.event_frm_Ro_Planificacion_Descuento_Mant_FormClosing += frm_event_frm_Ro_Planificacion_Descuento_Mant_FormClosing;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log_Error_bus.Log_Error(ex.Message);
            }
        }
Beispiel #2
0
 private void Get()
 {
     try
     {
         if (!Validar())
         {
             return;
         }
         info_descuento                   = new ro_descuento_no_planificados_Info();
         info_descuento.IdEmpresa         = param.IdEmpresa;
         info_descuento.IdNomina_Tipo     = info_empleado.IdNomina_Tipo;
         info_descuento.IdEmpleado        = info_empleado.IdEmpleado;
         info_descuento.Observacion       = txt_observacion.EditValue.ToString();
         info_descuento.IdRubro           = cmb_rubro.EditValue.ToString();
         info_descuento.Valor             = Convert.ToDouble(txt_multa.EditValue);
         info_descuento.IdUsuario         = param.IdUsuario;
         info_descuento.Fecha_Transaccion = DateTime.Now;
         if (txtid.EditValue != null && txtid.EditValue != "")
         {
             info_descuento.IdDescuento = Convert.ToInt32(txtid.EditValue);
         }
         info_descuento.Fecha_Incidente = dtp_es_fecha_registro.Value;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Log_Error_bus.Log_Error(ex.Message);
     }
 }
Beispiel #3
0
        public bool Anular_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.IdNomina_Tipo == info.IdNomina_Tipo &&
                                                                             v.IdEmpleado == info.IdEmpleado &&
                                                                             v.IdDescuento == info.IdDescuento);

                    add.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    add.Fecha_UltAnu    = info.Fecha_UltAnu;
                    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());
            }
        }
        private void ucGe_Menu_Mantenimiento_x_usuario1_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                info = (ro_descuento_no_planificados_Info)gridView_descuento.GetFocusedRow();
                if (info == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (info.check == true)
                {
                    MessageBox.Show("No se puede modificar un descuento plaificado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                frm           = new frm_Ro_Registro_Descuento_Mant();
                frm.Accion    = Cl_Enumeradores.eTipo_action.actualizar;
                frm.MdiParent = this.MdiParent;
                frm.Set(info);
                frm.Show();
                frm.event_frm_Ro_Registro_Descuento_Mant_FormClosing += frm_event_frm_Ro_Registro_Descuento_Mant_FormClosing;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log_Error_bus.Log_Error(ex.Message);
            }
        }
Beispiel #5
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 #6
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 #7
0
        private ro_Empleado_Novedad_Info Get_Novedad(ro_descuento_no_planificados_Info info)
        {
            try
            {
                int secuencia = 0;
                ro_Empleado_Novedad_Info info_novedad = new ro_Empleado_Novedad_Info();

                info_novedad.IdEmpresa     = info.IdEmpresa;
                info_novedad.IdEmpleado    = info.IdEmpleado;
                info_novedad.IdNomina_Tipo = info.IdNomina_Tipo;
                if (info.lista.Count() > 0)
                {
                    info_novedad.IdNomina_TipoLiqui = info.lista.FirstOrDefault().IdNomina_Tipo_Liq;
                }
                if (info.IdNovedad != null)
                {
                    info_novedad.IdNovedad = Convert.ToDecimal(info.IdNovedad);
                }
                info_novedad.IdUsuario        = info.IdUsuario;
                info_novedad.Fecha            = info.Fecha_Incidente;
                info_novedad.Fecha_Transac    = DateTime.Now;
                info_novedad.TotalValor       = info.Valor;
                info_novedad.Fecha_PrimerPago = info.Fecha_Incidente;
                info_novedad.NumCoutas        = info.lista.Count();
                info_novedad.Estado           = "A";

                foreach (var item in info.lista)
                {
                    ro_Empleado_Novedad_Det_Info info_det = new ro_Empleado_Novedad_Det_Info();
                    secuencia++;
                    info_det.IdEmpresa     = item.IdEmpresa;
                    info_det.IdNomina      = item.IdNomina_Tipo;
                    info_det.IdNominaLiqui = item.IdNomina_Tipo_Liq;
                    info_det.IdEmpleado    = item.IdEmpleado;
                    info_det.IdNovedad     = info_novedad.IdNovedad;
                    info_det.IdRubro       = item.IdRubro;
                    info_det.FechaPago     = item.Fecha_Descuento;
                    info_det.EstadoCobro   = "PEN";
                    info_det.Valor         = item.Valor;
                    info_det.Observacion   = info.Observacion;
                    info_det.Estado        = "A";
                    info_det.Secuencia     = secuencia;
                    info_novedad.LstDetalle.Add(info_det);
                }



                return(info_novedad);
            }
            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);
            }
        }
Beispiel #8
0
        public List <ro_descuento_no_planificados_Info> listado_Descuento_sin_planificacion(int IdEmpresa, DateTime Fecha_inicio, DateTime Fecha_Fin)
        {
            try
            {
                List <ro_descuento_no_planificados_Info> lista = new List <ro_descuento_no_planificados_Info>();
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var query = from q in db.vwro_descuento_sin_planificacion
                                where
                                q.IdEmpresa == IdEmpresa &&
                                q.Fecha_Transaccion >= Fecha_inicio &&
                                q.Fecha_Transaccion <= Fecha_Fin &&
                                q.Estado == true
                                select q;

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

                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdNomina_Tipo     = item.IdNomina_Tipo;
                        info.IdEmpleado        = item.IdEmpleado;
                        info.IdDescuento       = item.IdDescuento;
                        info.IdRubro           = item.IdRubro;
                        info.Observacion       = item.Observacion;
                        info.Valor             = item.Valor;
                        info.Estado            = item.Estado;
                        info.Fecha_Incidente   = item.Fecha_Incidente;
                        info.pe_nombreCompleto = item.pe_nombreCompleto;
                        info.ru_descripcion    = item.ru_descripcion;
                        info.pe_cedulaRuc      = item.pe_cedulaRuc;
                        info.Observacion       = item.Observacion;
                        info.IdUsuario         = item.IdUsuario;
                        if (item.Planificado != null)
                        {
                            info.check = true;
                        }
                        else
                        {
                            info.check = false;
                        }
                        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());
            }
        }
Beispiel #9
0
        public List <ro_descuento_no_planificados_Info> listado_Descuento(int IdEmpresa, int IdNomina_Tipo, int IdEmpleado)
        {
            try
            {
                List <ro_descuento_no_planificados_Info> lista = new List <ro_descuento_no_planificados_Info>();
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var query = from q in db.vwro_descuento_no_planificados
                                where
                                q.IdEmpresa == IdEmpresa &&
                                q.IdNomina_Tipo == IdNomina_Tipo &&
                                q.IdEmpleado == IdEmpleado
                                select q;

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

                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdNomina_Tipo     = item.IdNomina_Tipo;
                        info.IdEmpleado        = item.IdEmpleado;
                        info.IdDescuento       = item.IdDescuento;
                        info.IdNovedad         = Convert.ToInt32(item.IdNovedad);
                        info.IdRubro           = item.IdRubro;
                        info.IdNovedad         = Convert.ToInt32(item.IdNovedad);
                        info.Observacion       = item.Observacion;
                        info.Valor             = item.Valor;
                        info.Estado            = item.Estado;
                        info.Fecha_Incidente   = item.Fecha_Incidente;
                        info.pe_nombreCompleto = item.pe_nombreCompleto;
                        info.ru_descripcion    = item.ru_descripcion;
                        info.pe_cedulaRuc      = item.pe_cedulaRuc;
                        info.Observacion       = item.Observacion;
                        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());
            }
        }
 public bool Anular_DB(ro_descuento_no_planificados_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);
     }
 }
Beispiel #11
0
 public void Set(ro_descuento_no_planificados_Info info)
 {
     try
     {
         _idEmpleado                 = info.IdEmpleado;
         cmb_rubro.EditValue         = info.IdRubro;
         cmbEmpleado.EditValue       = info.IdEmpleado;
         txt_multa.EditValue         = info.Valor;
         txtid.EditValue             = info.IdDescuento;
         txt_observacion.EditValue   = info.Observacion;
         dtp_es_fecha_registro.Value = info.Fecha_Incidente;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Log_Error_bus.Log_Error(ex.Message);
     }
 }
        public void Set(ro_descuento_no_planificados_Info info)
        {
            try
            {
                info_descuento          = info;
                _idEmpleado             = info.IdEmpleado;
                cmbEmpleado.EditValue   = info.IdEmpleado;
                cmb_descuento.EditValue = info.IdRubro;
                txt_valor.EditValue     = info.Valor;
                info_descuento          = info;


                lista_descuento_Det = new BindingList <ro_descuento_no_planificados_Det_Info>(bus_detalle.listado_Descuento(info_descuento.IdEmpresa, info_descuento.IdNomina_Tipo, info_descuento.IdEmpleado, info_descuento.IdDescuento));
                gridControl_descuento_planificado.DataSource = lista_descuento_Det.ToList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log_Error_bus.Log_Error(ex.Message);
            }
        }
        public bool Guardar_DB(ro_descuento_no_planificados_Info info)
        {
            try
            {
                string  msg       = "";
                decimal idNovedad = 0;
                int     sec       = 0;
                bool    ba        = false;
                if (info.IdNovedad == null || info.IdNovedad == 0)
                {
                    foreach (var item in Get_Novedad(info))
                    {
                        if (bus_novedad.GrabarDB(item, ref idNovedad))
                        {
                            info.IdNovedad = Convert.ToInt32(idNovedad);
                            if (data.Modificar_DB(info))
                            {
                            }
                        }
                    }

                    foreach (var item_ in info.lista)
                    {
                        sec = sec + 1;
                        item_.IdDescuento = info.IdDescuento;
                        item_.Secuencia   = sec;
                    }
                    ba = bus_detalle.Guardar_DB(info.lista);
                }
                else// modificar
                {
                    foreach (var item in Get_Novedad(info))
                    {
                        if (bus_novedad.ModificarDB(item))
                        {
                            if (bus_novedad_Det.EliminarDB(item.IdEmpresa, item.IdNomina_Tipo, item.IdEmpleado, Convert.ToDecimal(item.IdNovedad)))
                            {
                                foreach (var itemN in item.LstDetalle)
                                {
                                    bus_novedad_Det.GrabarDB(itemN, ref msg);
                                }
                                info.IdNovedad = Convert.ToInt32(info.IdNovedad);
                                if (data.Modificar_DB(info))
                                {
                                }
                            }
                        }
                    }



                    foreach (var item_ in info.lista)
                    {
                        item_.IdDescuento = info.IdDescuento;
                        item_.Secuencia   = 1;
                    }
                    ba = bus_detalle.Guardar_DB(info.lista);
                }

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