コード例 #1
0
        private void GenererLicence_Click(object sender, EventArgs e)
        {
            if (ProgramManager.DetecteurErreurSaisieNewClient(NomClient, CodeClient, CodePostale, Adresse1) == true)
            {
                FixRadioGroup();
                string licences = GetLicences.GetSeriale(NomClient, CodeClient, CodePostale, Adresse1, GropLicences);
                ImputLicences.Text     = licences;
                DateDebutLicenece.Text = DateTime.Today.ToString("dd-MM-yyyy");
                DateFin.Text           = Convert.ToDateTime(LicenceDelaisManager.FinLicence(DateTime.Today, LicenceDelaisManager.LicenceLength(GropLicences.Properties.Items[GropLicences.SelectedIndex].Description))).ToString("dd-MM-yyyy");
                NombreDeJour.Text      = LicenceDelaisManager.LicenceLength(GropLicences.Properties.Items[GropLicences.SelectedIndex].Description).ToString();
                ProgramManager.InserstionData(CmdLicenceLoad.UpdateDataClient(NomClient, CodeClient, CodePostale, VilleClient, Adresse1, Adresse2, GropLicences));

                ProgramManager.InserstionData(CmdLicenceLoad.LoadDataToDataBase(DateDebutLicenece.Text, DateFin.Text, ImputLicences.Text, NombreDeJour.Text, CodeClient.Text, GropLicences.Properties.Items[GropLicences.SelectedIndex].Description));
                AlimenterGrid.FillDataGridView <Client>(GcLicence, ProgramManager.Chargementreader(CmdClient.RequetteCaracteristiqueClient()), ProgramManager.Chargement(ProgramManager.Chargementreader(CmdClient.RequetteCaracteristiqueClient())));
                FindInGridControl(CodeClient.Text);
                NomClient.ResetText(); CodeClient.ResetText(); CodePostale.ResetText();
                VilleClient.ResetText(); Adresse1.ResetText(); Adresse2.ResetText();
                DateDebutLicenece.ResetText(); DateFin.ResetText();
                ImputLicences.ResetText(); NombreDeJour.ResetText();
                MsgBox.Show(this, MessagesSystem.ModifSaved);
            }
            else
            {
                MsgBox.Show(this, MessagesSystem.ErreurAjoutClientExpress);
            }
        }
コード例 #2
0
 private void BoutonDetails_Click(object sender, EventArgs e)
 {
     try
     {
         if (IsLicenced)
         {
             if (CodeClient.Text != String.Empty)
             {
                 FrmDetails Details = new FrmDetails();
                 Details.ShowInTaskbar = false;
                 Details.ClientCode    = CodeClient.Text;
                 if (Details.ClientCode != "")
                 {
                     Details.Dialog = true;
                     Details.ShowDialog();
                     Details.ClientCode = "";
                     AlimenterGrid.FillDataGridView <Client>(GcLicence, ProgramManager.Chargementreader(CmdClient.RequetteCaracteristiqueClient()), ProgramManager.Chargement(ProgramManager.Chargementreader(CmdClient.RequetteCaracteristiqueClient())));
                     FindInGridControl(CodeClient.Text);
                     NomClient.ResetText(); CodeClient.ResetText(); CodePostale.ResetText();
                     VilleClient.ResetText(); Adresse1.ResetText(); Adresse2.ResetText();
                 }
                 else
                 {
                     CodeClient.BackColor = Color.Red;
                     Details.Dispose();
                     return;
                 }
             }
             else
             {
                 MsgBox.Show(this, MessagesSystem.ErreurAjoutClientExpress);
                 CodeClient.BackColor = Color.Red;
             }
         }
         else
         {
             MsgBox.Show(this, "User Not Licenced !!!");
             return;
         }
     }
     catch (Exception ex)
     {
         MsgBox.Show(this, ex.Message);
     }
 }