Example #1
0
 private void TxtPrNombre_Validating(object sender, CancelEventArgs e)
 {
     if (string.IsNullOrEmpty((TxtPrNombre.Text)))
     {
         errorP1.SetError(TxtPrNombre, "Debe ingresar el primer nombre.");
         TxtPrNombre.Focus();
     }
     else
     {
         errorP1.SetError(TxtPrNombre, "");
     }
 }
Example #2
0
        private void FrmGetAlumnos_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = f.GetTipoUsurios(ConexionDB.getInstancia().Conexion(null, null)).Tables[0];

                LueTipoUsuario.Properties.DataSource    = dt;
                LueTipoUsuario.Properties.DisplayMember = "Nombre";
                LueTipoUsuario.Properties.ValueMember   = "Codigo";

                DevExpress.XtraEditors.Controls.LookUpColumnInfo col;
                col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Nombre", "Nombre", 100);
                //col.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
                LueTipoUsuario.Properties.Columns.Add(col);
                LueTipoUsuario.ItemIndex = -1;
                LueTipoUsuario.EditValue = "03";
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2);
                return;
            }

            CursoAñoElectivo curAe = new CursoAñoElectivo();

            curAe.AñoElectivo = Año;

            DataTable dt2 = CtrlCursoAñoElectivo.GetCursoAñoElectivo(curAe).Tables[0];

            LueCurso.Properties.DataSource    = dt2;
            LueCurso.Properties.DisplayMember = "Nombre";
            LueCurso.Properties.ValueMember   = "CodigoCurso";

            DevExpress.XtraEditors.Controls.LookUpColumnInfo col1;
            col1 = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Nombre", "Nombre", 100);
            LueCurso.Properties.Columns.Add(col1);
            LueCurso.ItemIndex = -1;


            TxtPrNombre.Focus();
            if (Modo == "E" && Id > 0)
            {
                CargarDatos(Id);
                panel3.Visible         = false;
                acceptCancel1.Location = new Point(229, 337);
                this.Size = new Size(631, 382);
            }
        }
Example #3
0
        private void FrmGetProfesores_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = f.GetTipoUsurios(ConexionDB.getInstancia().Conexion(null, null)).Tables[0];

                LueTipoUsuario.Properties.DataSource    = dt;
                LueTipoUsuario.Properties.DisplayMember = "Nombre";
                LueTipoUsuario.Properties.ValueMember   = "Codigo";

                DevExpress.XtraEditors.Controls.LookUpColumnInfo col;
                col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Nombre", "Nombre", 100);
                //col.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
                LueTipoUsuario.Properties.Columns.Add(col);
                LueTipoUsuario.ItemIndex = -1;
                LueTipoUsuario.EditValue = "02";
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2);
                return;
            }

            TxtPrNombre.Focus();
            if (Modo == "E" && Id > 0)
            {
                CargarDatos(Id);
                panel3.Visible         = false;
                panelControl1.Location = new Point(18, 288);
                GctrlMaterias.Location = new Point(18, 317);
                acceptCancel1.Location = new Point(219, 469);
                PrgBuscar2.Location    = new Point(198, 376);
                this.Size = new Size(610, 515);
            }
            else
            {
                codProfesor = "";
                if (!BkgwBuscarMat.IsBusy)
                {
                    PrgBuscar2.Visible = true;
                    BkgwBuscarMat.RunWorkerAsync();
                }
            }

            TxtPrNombre.Focus();
        }
Example #4
0
        public bool ValidarPersona()
        {
            bool retorno = true;

            if (string.IsNullOrEmpty((TxtPrNombre.Text)))
            {
                errorP1.SetError(TxtPrNombre, "Debe ingresar el primer nombre.");
                TxtPrNombre.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPrNombre, "");
            }

            if (string.IsNullOrEmpty((TxtPrApellido.Text)))
            {
                errorP1.SetError(TxtPrApellido, "Debe ingresar el primer apellido.");
                TxtPrApellido.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPrApellido, "");
            }

            if (string.IsNullOrEmpty((TxtIdentificacion.Text)))
            {
                errorP1.SetError(TxtIdentificacion, "Debe ingresar la identificación.");
                TxtIdentificacion.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtIdentificacion, "");
            }


            return(retorno);
        }