private void button4_Click(object sender, EventArgs e) { if (srcb.Current != null) { DataRowView drv = (DataRowView)srcb.Current; if ((bool)drv["COMPTE"] != true) { try { //CHM_GESTION_COMERCIALE.RESULT_QUERY res = new CHM_GESTION_COMERCIALE.RESULT_QUERY(); CHMGC.RESULT_QUERY res = new CHM_CLIENT_APP.CHMGC.RESULT_QUERY(); //res = CLIENT_APP_PARAM.GEST.P_COMPTE_CLIENT.CREER_COMPTE_CLIENT(drv["CODE_CLIENT"].ToString()); res = CLIENT_APP_PARAM.gcws.CREER_COMPTE_CLIENT(drv["CODE_CLIENT"].ToString()); if (res.OK) { MessageBox.Show(res.MESSAGE, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); //CLIENT_APP_PARAM.GEST.P_CLIENT.UPDATE_ETAT_COMPTE(drv["CODE_CLIENT"].ToString()); CLIENT_APP_PARAM.gcws.UPDATE_ETAT_COMPTE(drv["CODE_CLIENT"].ToString()); CHM_COMPTE_CREDIT_CLIENT fenetre = new CHM_COMPTE_CREDIT_CLIENT(drv["CODE_CLIENT"].ToString()); fenetre.Show(); } else { MessageBox.Show(res.MESSAGE, "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception er) { MessageBox.Show(er.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { CHM_COMPTE_CREDIT_CLIENT fenetre = new CHM_COMPTE_CREDIT_CLIENT(drv["CODE_CLIENT"].ToString()); fenetre.Show(); } } }
private void CHM_REGLEMENT_CLIENT_Shown(object sender, EventArgs e) { if (CODE_FACT != "-1") { try { //dt_facture = CLIENT_APP_PARAM.GEST.P_FACTURE.LOAD_FACTURE_PAR_CODE(CODE_FACT); dt_facture = CLIENT_APP_PARAM.gcws.LOAD_FACTURE_PAR_CODE(CODE_FACT); bs_facture.DataSource = dt_facture; DataRowView drv_facture = (DataRowView)bs_facture.Current; CODE_CLIENT = drv_facture["CODE_CLIENT"].ToString(); NP.Value = (decimal)drv_facture["CREDIT"]; CODE_FACTURE.Text = drv_facture["CODE_FACTURE"].ToString(); //dt_clt = CLIENT_APP_PARAM.GEST.P_FACTURE.LOAD_CLIENT_FACTURE(CODE_CLIENT); dt_clt = CLIENT_APP_PARAM.gcws.LOAD_CLIENT_FACTURE(CODE_CLIENT); bs_clt.DataSource = dt_clt; DataRowView drv_clt = (DataRowView)bs_clt.Current; RS_CLIENT.Text = drv_clt["RS_CLIENT"].ToString(); if (bs_clt.Current != null) { if ((bool)drv_clt["COMPTE"] != true) { try { //CHM_GESTION_COMERCIALE.RESULT_QUERY res = new CHM_GESTION_COMERCIALE.RESULT_QUERY(); CHMGC.RESULT_QUERY res = new CHM_CLIENT_APP.CHMGC.RESULT_QUERY(); //res = CLIENT_APP_PARAM.GEST.P_COMPTE_CLIENT.CREER_COMPTE_CLIENT(drv_clt["CODE_CLIENT"].ToString()); res = CLIENT_APP_PARAM.gcws.CREER_COMPTE_CLIENT(drv_clt["CODE_CLIENT"].ToString()); if (res.OK) { MessageBox.Show(res.MESSAGE, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); //CLIENT_APP_PARAM.GEST.P_CLIENT.UPDATE_ETAT_COMPTE(drv_clt["CODE_CLIENT"].ToString()); CLIENT_APP_PARAM.gcws.UPDATE_ETAT_COMPTE(drv_clt["CODE_CLIENT"].ToString()); CHM_COMPTE_CREDIT_CLIENT fenetre = new CHM_COMPTE_CREDIT_CLIENT(drv_clt["CODE_CLIENT"].ToString()); fenetre.Show(); } else { MessageBox.Show(res.MESSAGE, "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception er) { MessageBox.Show(er.Message, "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } //dt_compte = CLIENT_APP_PARAM.GEST.P_COMPTE_CLIENT.LOAD_COMPTE_CLIENT(drv_clt["CODE_CLIENT"].ToString()); dt_compte = CLIENT_APP_PARAM.gcws.LOAD_COMPTE_CLIENT(drv_clt["CODE_CLIENT"].ToString()); bs_compte.DataSource = dt_compte; DataRowView drv_compte = (DataRowView)bs_compte.Current; NUM_COMPTE_CLIENT.Text = drv_compte["NUM_COMPTE_CLIENT"].ToString(); } catch (Exception er) { MessageBox.Show(er.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void NUM_COMPTE_CLIENT_Click(object sender, EventArgs e) { CHM_COMPTE_CREDIT_CLIENT c = new CHM_COMPTE_CREDIT_CLIENT(CODE_CLIENT); c.ShowDialog(); }