private void annule() { if (curligne > -1) { gv_article.Rows[curligne].Selected = true; gv_article.CurrentCell = gv_article.Rows[curligne].Cells[1]; } if (gv_article.RowCount > 0 && gv_article.CurrentRow.Index > -1) { uf.afficherInfo(this, reqdon.Replace("ORDER", "AND idarticle =" + gv_article.CurrentRow.Cells["g_idarticle"].Value.ToString() + " ORDER"), comrealvista, null, ""); chargerprix(gv_article.CurrentRow.Cells["g_idarticle"].Value.ToString()); chargerrabais(gv_article.CurrentRow.Cells["g_idarticle"].Value.ToString()); } else { uf.initcontrol(p_affiche, "", codearticle); } uf.enablemulticontrol(p_button, "1", "2"); uf.enablecontrol(p_affiche, "2", false); if (gv_article.RowCount == 0) { bt_modif.Enabled = bt_suppr.Enabled = false; } etat = 0; }
private void chargertypeadr(bool nouveau, string idclient, string iddelta) { string idc = ""; if (idclient != "") { idc = idclient; } else if (iddelta != "") { idc = iddelta; } string reqtypeadr = "SELECT typefonction.nomfonction, typefonction.idfonction " + "from " + Fmain.baseInit + ".typefonction left join " + "(SELECT typef.idfonction, typef.nomfonction, typef.typefonction from " + "fact_entreprise client " + "LEFT JOIN fact_entreprisefonction fonccli ON fonccli.identreprise = client.identreprise " + "LEFT JOIN " + Fmain.baseInit + ".clientfonction foncdel ON foncdel.idclient = client.iddeltareal " + "left join " + Fmain.baseInit + ".typefonction typef on(typef.idfonction = (if (client.iddeltareal > 0, foncdel.idfonctiondelta, fonccli.idfonction)) and typef.typefonction = 'Deltareal') " + "where client.identreprise = " + idc + ") typeff ON typeff.idfonction = typefonction.idfonction where typefonction.typefonction = 'Deltareal'"; if (nouveau) { reqtypeadr += " AND typeff.nomfonction is null "; } else { reqtypeadr += " AND typeff.nomfonction is NOT null "; } uf.RemplirCombo(l_adresses, reqtypeadr, comrealvistamod, mySqlDataAdapter1); uf.enablecontrol(p_client, "8", false); uf.initcontrol(p_client, "8", m_mttde); }
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); } }
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; }