Beispiel #1
0
        public Int32 UpdateData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "UPDATE \"Facture\" SET \"Date_Recu\"=:dater, \"Date_Livraison\"=:datel, \"Prix_Total\"=:prixt, \"Prix_Partiel\"=:prixp, \"Code_Client\"=:codec, \"Mode_Payement\"=:modep, \"Etat\"=:etat," +
                                  " \"Livree\"=:livree, \"Date_Sortie\"=:datesortie, \"Date_Payement\"=:datepayement" +
                                  " WHERE \"Code\"=:code";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":dater", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":datel", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixt", DbType.Double));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixp", DbType.Double));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":codec", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":modep", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":etat", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":livree", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":datesortie", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":datepayement", DbType.DateTime));
            command.Parameters[0].Value  = this.Code;
            command.Parameters[1].Value  = this.Date_Recu;
            command.Parameters[2].Value  = this.Date_livraison;
            command.Parameters[3].Value  = this.Prix_Total;
            command.Parameters[4].Value  = this.Prix_Partiel;
            command.Parameters[5].Value  = this.Client.Code;
            command.Parameters[6].Value  = this.Mode_Payement;
            command.Parameters[7].Value  = this.Etat;
            command.Parameters[8].Value  = this.Livree;
            command.Parameters[9].Value  = this.Date_Sortie;
            command.Parameters[10].Value = this.Date_Payement;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #2
0
        public Int32 SaveData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "INSERT INTO \"Facture\" (\"Code\", \"Date_Recu\", \"Date_Livraison\", \"Prix_Total\", \"Prix_Partiel\", \"Code_Client\", \"Mode_Payement\", \"Etat\", \"Livree\", \"Date_Sortie\", \"Date_Payement\" )" +
                                  "VALUES(:code,:date_recu,:date_livraison,:prix_total,:prix_partiel,:code_client,:mode_payement,:etat,:livree,:datesortie,:datepayement)";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":date_recu", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":date_livraison", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prix_total", DbType.Double));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prix_partiel", DbType.Double));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code_client", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":mode_payement", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":etat", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":livree", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":datesortie", DbType.DateTime));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":datepayement", DbType.DateTime));
            command.Parameters[0].Value  = this.Code;
            command.Parameters[1].Value  = this.Date_Recu;
            command.Parameters[2].Value  = this.Date_livraison;
            command.Parameters[3].Value  = this.Prix_Total;
            command.Parameters[4].Value  = this.Prix_Partiel;
            command.Parameters[5].Value  = this.Client.Code;
            command.Parameters[6].Value  = this.Mode_Payement;
            command.Parameters[7].Value  = this.Etat;
            command.Parameters[8].Value  = this.Livree;
            command.Parameters[9].Value  = this.Date_Sortie;
            command.Parameters[10].Value = this.Date_Payement;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #3
0
        public Int32 UpdateData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "UPDATE \"Articles\" SET \"Libelle\"=:libelle," +
                                  " \"N_Pieces\"=:npieces," +
                                  " \"Description\"=:description," +
                                  " \"Prix_Pressing\"=:prixpressing," +
                                  " \"Prix_Repassage\"=:prixrepassage," +
                                  " \"Prix_Tenture\"=:prixtenture," +
                                  " \"Prix_Autre\"=:prixautre," +
                                  " \"Code_Famille\"=:codef," +
                                  " \"Photo\"=:photo," +
                                  " \"Pressing\"=:pressing," +
                                  " \"Repassage\"=:repassage," +
                                  " \"Tenture\"=:tenture," +
                                  " \"Autre\"=:autre," +
                                  " \"Print\"=:print" +
                                  " WHERE \"Code\"=:cde";

            command.Parameters.Add(new Npgsql.NpgsqlParameter(":cde", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":libelle", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":npieces", DbType.Decimal));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":description", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixpressing", DbType.Decimal));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixrepassage", DbType.Decimal));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixtenture", DbType.Decimal));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prixautre", DbType.Decimal));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":codef", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":photo", DbType.Binary));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":pressing", DbType.Boolean));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":repassage", DbType.Boolean));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":tenture", DbType.Boolean));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":autre", DbType.Boolean));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":print", DbType.Boolean));
            command.Parameters[0].Value  = this.Code;
            command.Parameters[1].Value  = this.Libelle;
            command.Parameters[2].Value  = this.N_Pieces;
            command.Parameters[3].Value  = this.Description;
            command.Parameters[4].Value  = this.Prix_Pressing;
            command.Parameters[5].Value  = this.Prix_Repassage;
            command.Parameters[6].Value  = this.Prix_Tenture;
            command.Parameters[7].Value  = this.Prix_Autre;
            command.Parameters[8].Value  = this.Code_Famille;
            command.Parameters[9].Value  = this.Photo;
            command.Parameters[10].Value = this.Pressing;
            command.Parameters[11].Value = this.Repassage;
            command.Parameters[12].Value = this.Tenture;
            command.Parameters[13].Value = this.Autre;
            command.Parameters[14].Value = this.Print;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #4
0
        public Int32 UpdateData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "UPDATE \"Famille\" SET \"Libelle\"=:libelle, \"Description\"=:description WHERE \"Code\"=:code";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":libelle", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":description", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters[0].Value = this.Libelle;
            command.Parameters[1].Value = this.Description;
            command.Parameters[2].Value = this.Code;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #5
0
        public Int32 SaveData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "INSERT INTO \"Famille\" (\"Code\", \"Libelle\", \"Description\")" +
                                  "VALUES(:code,:libelle,:description)";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":libelle", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":description", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters[0].Value = this.Libelle;
            command.Parameters[1].Value = this.Description;
            command.Parameters[2].Value = this.Code;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #6
0
 private void buttonOk_Click(object sender, EventArgs e)
 {
     if (VerifierChamo())
     {
         DB_PostgreSQL        dataBase = new DB_PostgreSQL();
         Npgsql.NpgsqlCommand command  = new Npgsql.NpgsqlCommand();
         command.CommandText = "INSERT INTO \"Cheque\" (\"Banque\", \"Montant\", \"Date\", \"Num\", \"Code_Facture\") " +
                               "Values('" + comboBox1.Text + "','" + textBox1.Text + "',:date,'" + textBox2.Text + "','" + CodeFacture + "')";
         command.Parameters.Add(new Npgsql.NpgsqlParameter(":date", DbType.DateTime));
         command.Parameters[0].Value = dateTimePicker1.Value;
         dataBase.ExecuteCommand(command);
         ((Payement)Owner).regle = true;
         this.Close();
     }
 }
Beispiel #7
0
        public Int32 UpdateData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "UPDATE \"User\" SET \"Password\"=:password, \"Tel\"=:tel, \"Photo\"=:photo, \"Role\"=:role WHERE \"Login\"='" + this.Login + "'";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":nom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":password", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":tel", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":photo", DbType.Binary));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":role", DbType.Int16));
            command.Parameters[0].Value = this.Login;
            command.Parameters[1].Value = this.Password;
            command.Parameters[2].Value = this.Tel;
            command.Parameters[3].Value = this.Photo;
            command.Parameters[4].Value = this.Role;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #8
0
        public Int32 UpdateData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "UPDATE \"Client\" SET \"Nom\"=:nom, \"Prenom\"=:prenom, \"Tel\"=:tel, \"Adresse\"=:adresse WHERE \"Code\"=:code";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":nom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prenom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":tel", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":adresse", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters[0].Value = this.Nom;
            command.Parameters[1].Value = this.Prenom;
            command.Parameters[2].Value = this.NTel;
            command.Parameters[3].Value = this.Adresse;
            command.Parameters[4].Value = this.Code;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #9
0
        public void saveData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "INSERT INTO \"Ar_Fac\" (\"Code_Article\", \"Code_Facture\", \"Operation\", \"Quantite\", \"Prix\")" +
                                  " VALUES(:codeA,:codeF,:oper,:qua,:prix)";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":codeA", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":codeF", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":oper", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":qua", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prix", DbType.String));
            command.Parameters[0].Value = this.Code_Article;
            command.Parameters[1].Value = this.Code_Facture;
            command.Parameters[2].Value = this.Operation;
            command.Parameters[3].Value = this.Quantite;
            command.Parameters[4].Value = this.Prix;
            dataBase.ExecuteCommand(command);
        }
Beispiel #10
0
        public Int32 SaveData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "INSERT INTO \"User\" (\"Login\",\"Password\",\"Tel\",\"Photo\", \"Role\")" +
                                  "VALUES(:nom,:password,:tel,:photo,:role)";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":nom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":password", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":tel", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":photo", DbType.Binary));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":role", DbType.Int16));
            command.Parameters[0].Value = this.Login;
            command.Parameters[1].Value = this.Password;
            command.Parameters[2].Value = this.Tel;
            command.Parameters[3].Value = this.Photo;
            command.Parameters[4].Value = this.Role;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #11
0
        public Int32 SaveData()
        {
            DB_PostgreSQL dataBase = new DB_PostgreSQL();

            Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
            command.CommandText = "INSERT INTO \"Client\" (\"Code\", \"Nom\", \"Prenom\", \"Tel\", \"Adresse\")" +
                                  "VALUES(:code,:nom,:prenom,:tel,:adresse)";
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":nom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":prenom", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":tel", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":adresse", DbType.String));
            command.Parameters.Add(new Npgsql.NpgsqlParameter(":code", DbType.String));
            command.Parameters[0].Value = this.Nom;
            command.Parameters[1].Value = this.Prenom;
            command.Parameters[2].Value = this.NTel;
            command.Parameters[3].Value = this.Adresse;
            command.Parameters[4].Value = this.Code;
            return(dataBase.ExecuteCommand(command));
        }
Beispiel #12
0
 public Int32 SaveData()
 {
     Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand();
     if (!this.existe)
     {
         command.CommandText = "INSERT INTO \"Info_Societe\" (\"Nom\",\"Adresse\",\"Tel\",\"Fax\",\"Logo\")" +
                               "VALUES(:nom,:adresse,:tel,:fax,:logo)";
     }
     else
     {
         command.CommandText = "UPDATE \"Info_Societe\" SET \"Nom\" =:nom,\"Adresse\"=:adresse, \"Logo\"=:logo, \"Tel\"=:tel, \"Fax\"=:fax";
     }
     command.Parameters.Add(new Npgsql.NpgsqlParameter(":nom", DbType.String));
     command.Parameters.Add(new Npgsql.NpgsqlParameter(":adresse", DbType.String));
     command.Parameters.Add(new Npgsql.NpgsqlParameter(":tel", DbType.String));
     command.Parameters.Add(new Npgsql.NpgsqlParameter(":fax", DbType.String));
     command.Parameters.Add(new Npgsql.NpgsqlParameter(":logo", DbType.Binary));
     command.Parameters[0].Value = this.nom;
     command.Parameters[1].Value = this.adresse;
     command.Parameters[2].Value = this.tel;
     command.Parameters[3].Value = this.fax;
     command.Parameters[4].Value = this.logo;
     return(dataBase.ExecuteCommand(command));
 }