示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CHM_NOUVEAU_CLIENT nv = new CHM_NOUVEAU_CLIENT("-1");

            nv.ENREG_EV += new CHM_NOUVEAU_CLIENT.ENREG_DEL(nv_ENREG_EV);
            nv.ShowDialog();
        }
示例#2
0
        private void CMS_NV_CLT_Click(object sender, EventArgs e)
        {
            CHM_NOUVEAU_CLIENT nv_clt = new CHM_NOUVEAU_CLIENT("-1");

            nv_clt.ENREG_EV += new CHM_NOUVEAU_CLIENT.ENREG_DEL(nv_clt_ENREG_EV);
            nv_clt.ShowDialog();
        }
示例#3
0
 private void btn_modif_clt_Click(object sender, EventArgs e)
 {
     if (srcb.Current != null)
     {
         DataRowView        drv    = (DataRowView)srcb.Current;
         CHM_NOUVEAU_CLIENT nv_clt = new CHM_NOUVEAU_CLIENT(drv["CODE_CLIENT"].ToString());
         nv_clt.ShowDialog();
     }
 }
示例#4
0
 private void CMS_MODIFIER_CLT_Click(object sender, EventArgs e)
 {
     if (srcb.Current != null)
     {
         DataRowView        drv    = (DataRowView)srcb.Current;
         CHM_NOUVEAU_CLIENT nv_clt = new CHM_NOUVEAU_CLIENT(drv["CODE_CLIENT"].ToString());
         nv_clt.ENREG_EV += new CHM_NOUVEAU_CLIENT.ENREG_DEL(nv_clt_ENREG_EV);
         nv_clt.ShowDialog();
     }
 }
示例#5
0
        private void btn_ajout_clt_Click(object sender, EventArgs e)
        {
            CHM_NOUVEAU_CLIENT nv_clt = new CHM_NOUVEAU_CLIENT("-1");

            nv_clt.ShowDialog();
        }
示例#6
0
        private void BTN_ENREG_NV_CLT_Click(object sender, EventArgs e)
        {
            #region Test
            errorProvider1.SetError(NV_REF_CLIENT, "");
            if (NV_RS_CLIENT.Text.Trim() == "")
            {
                errorProvider1.SetError(NV_REF_CLIENT, "Reference client requise.");
                NV_REF_CLIENT.Focus();
                NV_REF_CLIENT.SelectAll();
                return;
            }
            errorProvider1.SetError(NV_RS_CLIENT, "");
            if (NV_RS_CLIENT.Text.Trim() == "")
            {
                errorProvider1.SetError(NV_RS_CLIENT, "Raison sociale manquante");
                NV_RS_CLIENT.Focus();
                NV_RS_CLIENT.SelectAll();
                return;
            }
            errorProvider1.SetError(NV_MAX_CREDIT, "");
            if (NV_MAX_CREDIT.Text == "")
            {
                errorProvider1.SetError(NV_RS_CLIENT, "ÇáÑÌÇÁ ÅÏÎÇá ÇáÍÏ ÇáÃÞÕì ááÏíä");
                NV_MAX_CREDIT.Focus();
                NV_MAX_CREDIT.SelectAll();
                return;
            }

            #endregion
            try
            {
                //CHM_GESTION_COMERCIALE.RESULT_QUERY res = new CHM_GESTION_COMERCIALE.RESULT_QUERY();
                CHMGC.RESULT_QUERY res = new CHM_CLIENT_APP.CHMGC.RESULT_QUERY();

                if (CODE_CLIENT == "-1")
                {
                    Application.DoEvents();
                    //this.nv_clt_titre.Text = "Ajout de client";
                    //res = CLIENT_APP_PARAM.GEST.P_CLIENT.INSERT_CLIENT(CODE_CLIENT, NV_REF_CLIENT.Text,
                    //    NV_RS_CLIENT.Text, NV_ADRESSE_CLIENT.Text, NV_CP_CLIENT.Text, NV_VILLE_CLIENT.Text,
                    //    NV_PAYS_CLIENT.Text, NV_TEL_CLIENT.Text, NV_TEL2_CLIENT.Text, NV_FAX_CLIENT.Text,
                    //    NV_EMAIL_CLIENT.Text + "@" + NV_DOMAINE_EMAIL.Text, NV_EXO_CLIENT.Checked,
                    //    NV_ATTEST_EXO_CLIENT.Text, NV_CODE_DOUANE_CLIENT.Text, NV_CODE_TVA_CLIENT.Text,
                    //    NV_ETAT_CLIENT.Checked, false, Convert.ToDecimal( NV_MAX_CREDIT.Text));
                    res = CLIENT_APP_PARAM.gcws.INSERT_CLIENT(CODE_CLIENT, NV_REF_CLIENT.Text,
                                                              NV_RS_CLIENT.Text, NV_ADRESSE_CLIENT.Text, NV_CP_CLIENT.Text, NV_VILLE_CLIENT.Text,
                                                              NV_PAYS_CLIENT.Text, NV_TEL_CLIENT.Text, NV_TEL2_CLIENT.Text, NV_FAX_CLIENT.Text,
                                                              NV_EMAIL_CLIENT.Text + "@" + NV_DOMAINE_EMAIL.Text, NV_EXO_CLIENT.Checked,
                                                              NV_ATTEST_EXO_CLIENT.Text, NV_CODE_DOUANE_CLIENT.Text, NV_CODE_TVA_CLIENT.Text,
                                                              NV_ETAT_CLIENT.Checked, false, Convert.ToDecimal(NV_MAX_CREDIT.Text), txtResponsableClient.Text);
                    CODE_CLIENT = res.CODE;
                    ((DataRowView)bs.Current)["CODE_CLIENT"] = CODE_CLIENT;


                    if (res.OK)
                    {
                        bs.EndEdit();
                        client_param.AcceptChanges();
                        if (ENREG_EV != null)
                        {
                            ENREG_EV((DataRowView)bs.Current, true);
                        }
                        if (MessageBox.Show(res.MESSAGE + "\nVoulez vous ajouter un autre client?", "Nouveau client", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            this.Close();
                        }
                        else
                        {
                            this.Close();
                            CHM_NOUVEAU_CLIENT f = new CHM_NOUVEAU_CLIENT("-1");
                            f.ShowDialog();
                        }
                    }
                    else
                    {
                        MessageBox.Show(res.MESSAGE, CLIENT_APP_PARAM.Fenetre_principale.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        client_param.RejectChanges();
                        return;

                        MessageBox.Show(res.MESSAGE, "New client", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    Application.DoEvents();

                    //res = CLIENT_APP_PARAM.GEST.P_CLIENT.UPDATE_CLIENT(CODE_CLIENT, NV_REF_CLIENT.Text, NV_RS_CLIENT.Text, NV_ADRESSE_CLIENT.Text,
                    //    NV_CP_CLIENT.Text, NV_VILLE_CLIENT.Text, NV_PAYS_CLIENT.Text, NV_TEL_CLIENT.Text, NV_TEL2_CLIENT.Text, NV_FAX_CLIENT.Text,
                    //    NV_EMAIL_CLIENT.Text + "@" + NV_DOMAINE_EMAIL.Text, NV_EXO_CLIENT.Checked, NV_ATTEST_EXO_CLIENT.Text, NV_CODE_DOUANE_CLIENT.Text,
                    //    NV_CODE_TVA_CLIENT.Text, NV_ETAT_CLIENT.Checked, Convert.ToDecimal(NV_MAX_CREDIT.Text));
                    res = CLIENT_APP_PARAM.gcws.UPDATE_CLIENT(CODE_CLIENT, NV_REF_CLIENT.Text, NV_RS_CLIENT.Text, NV_ADRESSE_CLIENT.Text,
                                                              NV_CP_CLIENT.Text, NV_VILLE_CLIENT.Text, NV_PAYS_CLIENT.Text, NV_TEL_CLIENT.Text, NV_TEL2_CLIENT.Text, NV_FAX_CLIENT.Text,
                                                              NV_EMAIL_CLIENT.Text + "@" + NV_DOMAINE_EMAIL.Text, NV_EXO_CLIENT.Checked, NV_ATTEST_EXO_CLIENT.Text, NV_CODE_DOUANE_CLIENT.Text,
                                                              NV_CODE_TVA_CLIENT.Text, NV_ETAT_CLIENT.Checked, Convert.ToDecimal(NV_MAX_CREDIT.Text), txtResponsableClient.Text);


                    if (res.OK)
                    {
                        bs.EndEdit();
                        client_param.AcceptChanges();
                        if (ENREG_EV != null)
                        {
                            ENREG_EV((DataRowView)bs.Current, false);
                        }
                        MessageBox.Show(res.MESSAGE, CLIENT_APP_PARAM.Fenetre_principale.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                    else
                    {
                        client_param.RejectChanges();
                        MessageBox.Show(res.MESSAGE, CLIENT_APP_PARAM.Fenetre_principale.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }