Beispiel #1
0
 private void affichedonnees()
 {
     /*string sz = "select idarticle, socligne as client, client.idclient as id_client, codearticle, descriptif_ligne1, descriptif_ligne2, descriptif_ligne3, descriptif_ligne4, descriptif_ligne5, remarque, concat(unitecode, ' ', unitelibelle) as unite, fact_unite.idunite as id_unite, prix FROM fact_articles " +
      *  "LEFT JOIN fact_entreprise entreprise ON entreprise.identreprise = fact_articles.identreprise LEFT JOIN fact_unite ON fact_unite.idunite = fact_articles.idunite ORDER BY codearticle";
      * uf.afficherInfo(this, sz, comrealvista, gv_article, "");
      *
      * sz = sz.Replace("ORDER", "WHERE idarticle =" + gv_article.Rows[0].Cells["g_idarticle"].Value.ToString() + " ORDER");
      *
      * uf.afficherInfo(this, sz, comrealvista, null, "");*/
     uf.afficherInfo(this, reqdon, comrealvista, gv_article, "");
     if (gv_article.RowCount > 0)
     {
         uf.afficherInfo(this, reqdon.Replace("ORDER", "AND idarticle =" + gv_article.Rows[0].Cells["g_idarticle"].Value.ToString() + " ORDER"), comrealvista, null, "");
         chargerprix(gv_article.Rows[0].Cells["g_idarticle"].Value.ToString());
         chargerrabais(gv_article.Rows[0].Cells["g_idarticle"].Value.ToString());
     }
     uf.enablemulticontrol(p_button, "1", "2");
     uf.enablecontrol(p_affiche, "2", false);
     Program.variableglobale   = "azerty";
     util_fact.variableglobale = "kjgkjgkjkj";
     if (gv_article.RowCount == 0)
     {
         bt_modif.Enabled = bt_suppr.Enabled = false;
     }
 }
Beispiel #2
0
 private void annule() //affichage du client en cours
 {
     bt_recherche.Text = "recherche";
     p_button.Enabled  = true;
     refclient.Enabled = false;
     uf.enablecontrol(p_button, "2", false);
     uf.enablecontrol(p_button, "1", false);
     bt_ajout.Enabled = true;
     if (curligne > gv_client.RowCount - 1)
     {
         curligne = gv_client.RowCount - 1;
     }
     if (curligne > -1 && bt_recherche.Text == "recherche")
     {
         gv_client.Rows[curligne].Selected = true;
         gv_client.CurrentCell             = gv_client.Rows[curligne].Cells[1];
     }
     if (gv_client.RowCount > 0 && gv_client.CurrentRow.Index > -1)
     {
         uf.afficherInfo(p_affiche, reqdon.Replace("ORDER", "WHERE cli.idclient =" + gv_client.CurrentRow.Cells["g_refclient"].Value.ToString() + " ORDER"), comrealvista, null, "");
         uf.enablemulticontrol(p_button, "1", "2");
     }
     else
     {
         uf.initcontrol(p_affiche, "", raisonsociale);
     }
     p_button.Focus();
     if (refclient.Text.Trim() != "")
     {
         valclient = prendrevaleurclient();
     }
     uf.enablecontrol(p_affiche, "2", false);
     bt_recherche.Enabled = true;
     remplirarchive();
     etat = 0;
 }
        public int typemod = 0; //1=ajout 2=modif

        private void f_paiement_Load(object sender, EventArgs e)
        {
            uf.initialisation(p_frais);
            uf.initcontrol(p_frais, "");
            uf.enablecontrol(p_frais, "", false);
            uf.enablecontrol(p_payeur, "", false);
            typetransfert.SelectedIndex = 0;
            foreach (DataGridViewColumn dd in gv_import.Columns)
            {
                dd.ReadOnly = false;
            }
            ck_poste.Checked           = true;
            typepaiement.SelectedIndex = 0;
            if (typefen == 1) //liste paiement d'une facture sélectionnée.
            {
                gv_listepaiement.Visible = bt_pmodif.Visible = bt_psuppr.Visible = true;
                p_payeur.Visible         = true;
                bt_valid.Visible         = true;
                this.Height  = 520;
                bt_annul.Top = 435;
                string s = " select reffacturedeltareal as reffacture, montantapayer as totfacture, if(isnull(paie.totalpaye), 0, paie.totalpaye) as totalpaye, (montantapayer - if(isnull(paie.totalpaye), 0, paie.totalpaye)) as solde FROM fact_facturation fact LEFT JOIN (select sum(montant) as totalpaye, numfacture, identreprise FROM fact_paiement group by identreprise, numfacture) paie on paie.identreprise = fact.identreprise and paie.numfacture = fact.reffacturedeltareal WHERE fact.reffacturedeltareal ='" + numfact + "'";

                uf.afficherInfo(p_solde, s, comrech, null);
                chargerpaiement();
                bt_valid.Enabled = false;
                if (typemod == 1) // ajout paiement
                {
                    uf.enablecontrol(p_payeur, "", true);
                    uf.enablecontrol(p_frais, "", true);
                    bt_valid.Enabled = true;
                }
            }
            else
            {
                button1.Visible     = gv_import.Visible = bt_valider.Visible = bt_impsuppr.Visible = bt_impverif.Visible = true;
                bt_impverif.Enabled = bt_impsuppr.Enabled = false;
                uf.enablecontrol(p_frais, "", true);
            }
        }
Beispiel #4
0
        private void afficheadresse(string idclient, string iddelta)
        {
            uf.enablemulticontrol(p_adresse, "6", "4,5");

            string idfonction = "";

            if (l_adresses.Items.Count > 0)
            {
                idfonction = l_adresses.SelectedValue.ToString();
            }
            else
            {
                idfonction = "-1";
            }
            reqadresse = "SELECT if (client.iddeltareal > 0, foncdel.idfonctiondelta, fonccli.idfonction) as idfonction, langclient.idlanguage, langclient.language, " +
                         "polclient.idpolitesse, polclient.politesse, if(client.iddeltareal > 0, foncdel.nomprenom, fonccli.nomprenom) as nomprenom, " +
                         "if(client.iddeltareal > 0, foncdel.adresse1, fonccli.adresse1) as adresse1, if(client.iddeltareal > 0, foncdel.co, fonccli.co) as co, if(client.iddeltareal > 0, foncdel.adresse2, fonccli.adresse2) as adresse2, clicity.zip as npa, clicity.cityname as ville, " +
                         "clicity.idcity as idville, if(client.iddeltareal > 0, foncdel.teldirect, fonccli.telpro) as telpro, if(client.iddeltareal > 0, foncdel.mobile, fonccli.telmob) as telmob, " +
                         "if(client.iddeltareal > 0, foncdel.fax, fonccli.fax) as fax, if(client.iddeltareal > 0, foncdel.email, fonccli.email) as email, if(client.iddeltareal > 0, foncdel.adresseweb, fonccli.siteweb) as siteweb, " +
                         "if(client.iddeltareal > 0, foncdel.idbanque, fonccli.idbanque) as idbanque, if(client.iddeltareal > 0, foncdel.comptebanque, fonccli.comptebanque) as comptebanque, " + //if(client.iddeltareal > 0, foncdel.ccp, fonccli.ccp) as ccp,
                         "if(client.iddeltareal > 0, foncdel.ccp, fonccli.noccp) as noccp, if(client.iddeltareal > 0, '', fonccli.nobvr) as nobvr, if(client.iddeltareal > 0, '', fonccli.noremiseadherent) as noremiseadherent, " +
                         "concat(banque.nombanque, ' - ', banque.adresse, ', ', banque.npa, ' ', banque.ville)  as banque " +
                         "FROM fact_entreprise client " +
                         "LEFT JOIN fact_entreprisefonction fonccli ON fonccli.identreprise = client.identreprise AND fonccli.idfonction = " + idfonction + " " +
                         "LEFT JOIN " + Fmain.baseInit + ".clientfonction foncdel ON foncdel.idclient = client.iddeltareal AND foncdel.idfonctiondelta = " + idfonction + " " +
                         "LEFT join " + Fmain.baseInit + ".typepolitesse polclient ON polclient.idpolitesse = if (client.iddeltareal > 0, foncdel.idpolitesse, fonccli.idpolitesse) " +
                         "LEFT join " + Fmain.baseInit + ".language langclient ON langclient.idlanguage = polclient.idlangue " + //if (client.iddeltareal > 0, foncdel.idlanguage, fonccli.idlanguage) " +
                         "left join " + Fmain.baseInit + ".city clicity ON clicity.idcity = if (client.iddeltareal > 0, foncdel.idville, fonccli.idville) " +
                         "LEFT JOIn " + Fmain.baseInit + ".cpta_banque banque ON banque.idbanque = if (client.iddeltareal > 0, foncdel.idbanque, fonccli.idbanque) " +
                         "ORDER by client.identreprise"; // iddeltareal> 0 asc, iddeltareal, client.idclient";"
            string sz = "";

            if (iddelta == "")
            {
                sz = reqadresse.Replace("ORDER", "WHERE client.identreprise =" + idclient + " ORDER");
            }
            else
            {
                sz = reqadresse.Replace("ORDER", "WHERE foncdel.idclient =" + idclient + " ORDER");
            }

            uf.afficherInfo(p_adresse, sz, comrealvista, null, "");
            uf.enablecontrol(p_adresse, "2", false);
            if (g_client.RowCount > 0 && l_adresses.Items.Count > 0 && g_client.CurrentRow.Cells["g_iddeltareal"].Value.ToString() == "")
            {
                uf.enablemulticontrol(p_adresse, "4", "5");
            }
            if (l_adresses.Items.Count == 0 && g_client.CurrentRow.Cells["g_iddeltareal"].Value.ToString() == "")
            {
                bt_adrajout.Enabled = true;
            }
        }