Exemple #1
0
 private void btnaceptar_Click(object sender, EventArgs e)
 {
     Infragistics.Win.Misc.Validation val;
     db.ejecutar("select if(usupassword=md5('" + this.txtanterior.Text + "'),'1','0') from ste_usuario where usuuser='******'");
     if (db.getvalor().ToString() == "0")
     {
         uv.GetValidationSettings(this.txtanterior).Condition = new Infragistics.Win.OperatorCondition(Infragistics.Win.ConditionOperator.Match, this.txtuser.Text + db.getvalor());
     }
     else
     {
         uv.GetValidationSettings(this.txtanterior).Condition = new Infragistics.Win.OperatorCondition(Infragistics.Win.ConditionOperator.Match, this.txtanterior.Text);
     }
     uv.GetValidationSettings(this.txtpass2).Condition = new Infragistics.Win.OperatorCondition(Infragistics.Win.ConditionOperator.Match, this.txtpass1.Text);
     val = uv.Validate(true, false);
     if (val.IsValid)
     {
         MySqlCommand cm = new MySqlCommand();
         db.begin_transaction();
         cm.Parameters.Add("@user", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = this.txtuser.Text;
         cm.Parameters.Add("@pass", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = this.txtpass1.Text;
         cm.CommandText = "update ste_usuario set usupassword=md5(@pass) where usuuser=@user";
         db.ejecutar(cm);
         db.commit_transaction();
         MessageBox.Show("El cambio de contraseña fue efectuado con éxito", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
 }
Exemple #2
0
        private void carga_datos()
        {
            String sql = "select idste_clijuridico,jurrazonsocial,cliruc,jurrepresentante from ste_cliente inner join ste_clijuridico on ste_clijuridico.idste_clijuridico=ste_cliente.idcliente";

            db.ejecutar(sql);
            dtmaestro         = db.gettabla();
            grilla.DataSource = null;
            grilla.DataSource = dtmaestro;
            grilla.DisplayLayout.Bands[0].Columns[0].Hidden = true;
            grilla.DisplayLayout.Bands[0].Columns["jurrazonsocial"].Header.Caption   = "Razon Social";
            grilla.DisplayLayout.Bands[0].Columns["cliruc"].Header.Caption           = "RUC";
            grilla.DisplayLayout.Bands[0].Columns["jurrepresentante"].Header.Caption = "Representante";
            foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn cc in grilla.DisplayLayout.Bands[0].Columns)
            {
                cc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
            }
        }