Exemple #1
0
        public void pu_Guardar()
        {
            try {
                decimal idPermiso = 0;

                if (PU_VALIDAR())
                {
                    if (getInfo())
                    {
                        if (oRo_permiso_x_empleado_Bus.GuardarDB(_Info, ref idPermiso, ref mensaje))
                        {
                            txtIdPermiso.Text = idPermiso.ToString();
                            if (rbLicencia.Checked == true)
                            {
                                empBus.Modificar_Estado(param.IdEmpresa, Convert.ToInt32(_Info.IdEmpleado), "EST_SUB");
                            }
                            else
                            {
                                empBus.Modificar_Estado(param.IdEmpresa, Convert.ToInt32(_Info.IdEmpleado), "EST_ACT");
                            }
                            MessageBox.Show(Resources.msgConfirmaGrabarOk, Resources.msgTituloGrabar, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            iAccion = Cl_Enumeradores.eTipo_action.grabar;



                            // si teien descuento rol
                            if (rbLicencia.Checked == true)
                            {
                                if (MessageBox.Show("El empleado esta con licencia medica,¿ desea ingresar la novedad por descuento?", "PERMISO" + param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                                {
                                    frmRo_Empleado_Novedad_Mant Frm = new frmRo_Empleado_Novedad_Mant();
                                    Frm.set_Accion(Cl_Enumeradores.eTipo_action.grabar);
                                    Frm.Set_IdEmpleado(Convert.ToInt32(_Info.IdEmpleado), Convert.ToInt32(_Info.IdNomina_Tipo), 2);
                                    Frm.ShowDialog();
                                    int novedad = Frm.IdNonvedad_empleado;
                                }
                            }

                            PU_BLOQUEAR_CONTROLES(false);
                            Limpiar();
                        }
                        else
                        {
                            MessageBox.Show(mensaje, "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
Exemple #2
0
        public void pu_Guardar()
        {
            try {
                decimal idPermiso = 0;

                if (PU_VALIDAR())
                {
                    if (getInfo())
                    {
                        if (oRo_permiso_x_empleado_Bus.GuardarDB(_Info, ref idPermiso, ref mensaje))
                        {
                            txtIdPermiso.Text = idPermiso.ToString();
                            if (rbLicencia.Checked == true)
                            {
                                empBus.Modificar_Estado(param.IdEmpresa, Convert.ToInt32(_Info.IdEmpleado), "EST_SUB");
                            }
                            else
                            {
                                empBus.Modificar_Estado(param.IdEmpresa, Convert.ToInt32(_Info.IdEmpleado), "EST_ACT");
                            }
                            MessageBox.Show(Resources.msgConfirmaGrabarOk, Resources.msgTituloGrabar, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            iAccion = Cl_Enumeradores.eTipo_action.grabar;



                            PU_BLOQUEAR_CONTROLES(false);
                            Limpiar();
                        }
                        else
                        {
                            MessageBox.Show(mensaje, "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }