Exemplo n.º 1
0
        private void BtnImpriOv_Click(object sender, RoutedEventArgs e)
        {
            string          query = "select IP,MAC from users where UserName='******' and IdUser='******'";
            MySqlDataReader rdr   = null;
            MySqlConnection con   = null;
            MySqlCommand    cmd   = null;

            con = new MySqlConnection(Database.ConnectionString());
            con.Open();
            cmd            = new MySqlCommand(query);
            cmd.Connection = con;
            rdr            = cmd.ExecuteReader();
            bool oneTime = true;

            while (rdr.Read())
            {
                ip  = rdr["IP"].ToString();
                mac = rdr["MAC"].ToString();
            }

            if (GetIpAdress.GetLocalIPAddress() != ip)
            {
                msh.ExecuteQuery("update users set IP='" + GetIpAdress.GetLocalIPAddress() + "' where IdUser='******'");
            }

            else if (GetMacAdresse.GetMacAdress() != mac)
            {
                msh.ExecuteQuery("update users set MAC='" + GetMacAdresse.GetMacAdress() + "' where IdUser='******'");
            }


            OrdreVerssementR OVR = new OrdreVerssementR(tempNumOV.ToString(), id);

            OVR.ShowDialog();
        }
Exemplo n.º 2
0
        private void BtnImpriML_Click(object sender, RoutedEventArgs e)
        {
            string          query4 = "select IP,MAC from users where UserName='******' and IdUser='******'";
            MySqlDataReader rdr    = null;
            MySqlConnection con    = null;
            MySqlCommand    cmd    = null;

            con = new MySqlConnection(Database.ConnectionString());
            con.Open();
            cmd            = new MySqlCommand(query4);
            cmd.Connection = con;
            rdr            = cmd.ExecuteReader();
            bool oneTime4 = true;

            while (rdr.Read())
            {
                ip  = rdr["IP"].ToString();
                mac = rdr["MAC"].ToString();
            }

            if (GetIpAdress.GetLocalIPAddress() != ip)
            {
                msh.ExecuteQuery("update users set IP='" + GetIpAdress.GetLocalIPAddress() + "' where IdUser='******'");
            }

            else if (GetMacAdresse.GetMacAdress() != mac)
            {
                msh.ExecuteQuery("update users set MAC='" + GetMacAdresse.GetMacAdress() + "' where IdUser='******'");
            }

            string query  = "select COUNT(NumDeci) AS countcnl from cnl where NumPayement = '" + inputCodeP.Text + "'";
            string query2 = "select COUNT(NumFNPOS) AS countfnpos from fnpos where NumPayement='" + inputCodeP.Text + "'";
            string query3 = "select COUNT(NumConvBan) AS countconv from creditb where NumPayement='" + inputCodeP.Text + "'";

            MySqlDataReader rdrcnl = null;
            MySqlConnection concnl = null;
            MySqlCommand    cmdcnl = null;

            concnl = new MySqlConnection(Database.ConnectionString());
            concnl.Open();
            cmdcnl            = new MySqlCommand(query);
            cmdcnl.Connection = concnl;
            rdrcnl            = cmdcnl.ExecuteReader();
            bool oneTime = true;

            while (rdrcnl.Read())
            {
                tempNumCNL = rdrcnl["countcnl"].ToString();
            }
            concnl.Close();

            MySqlDataReader rdrfn = null;
            MySqlConnection confn = null;
            MySqlCommand    cmdfn = null;

            confn = new MySqlConnection(Database.ConnectionString());
            confn.Open();
            cmdfn            = new MySqlCommand(query2);
            cmdfn.Connection = confn;
            rdrfn            = cmdfn.ExecuteReader();
            bool oneTime2 = true;

            while (rdrfn.Read())
            {
                tempNumFNPOS = rdrfn["countfnpos"].ToString();
            }
            confn.Close();

            MySqlDataReader rdrconv = null;
            MySqlConnection conconv = null;
            MySqlCommand    cmdconv = null;

            conconv = new MySqlConnection(Database.ConnectionString());
            conconv.Open();
            cmdconv            = new MySqlCommand(query3);
            cmdconv.Connection = conconv;
            rdrconv            = cmdconv.ExecuteReader();
            bool oneTime3 = true;

            while (rdrconv.Read())
            {
                tempNumConv = rdrconv["countconv"].ToString();
            }
            confn.Close();


            VSPViwer VSPV = new VSPViwer(int.Parse(inputCodeVSP.Text), tempNumCNL, tempNumFNPOS, tempNumConv, int.Parse(inputCodeP.Text), id);

            VSPV.Show();
        }