Beispiel #1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            AgentForm form = new AgentForm(-1);

            form.ShowDialog();
            fillGrid();
        }
 public void Print()
 {
     if (CurrentAgent.Id != 0 && CurrentAgent != null)
     {
         ReportedAgent reportedAgent = new ReportedAgent(CurrentAgent.PrenomNom, CurrentAgent.Adresse, CurrentAgent.Telephone, CurrentAgent.ComissionTotale);
         reportedAgent.ReportedVentes = new List <VenteReport>();
         //ListeVentes lv;
         List <VenteReport> liste = new List <VenteReport>();
         foreach (Vente v in CurrentAgent.Ventes)
         {
             ReportedVente reportedVente = new ReportedVente(v.DateVenteFormated, v.NomVente, v.ComissionAgent);
             reportedVente.reportingOffre = new ReportingOffre(v.Offre.NomOffre, v.Offre.Adresse, v.Offre.Prix, v.Offre.Surface);
             VenteReport vr = new VenteReport(reportedVente);
             liste.Add(vr);
             reportedAgent.ReportedVentes.Add(vr);
         }
         //lv = new ListeVentes(liste);
         AgentForm report = new AgentForm(new AgentReporting(reportedAgent));
         report.ShowDialog();
     }
     else
     {
         MessageBox.Show("D'abord choisissez un Agent", "Avertissement", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Beispiel #3
0
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            DataGridView gv = dataGridView1;

            if (gv.SelectedCells.Count > 0)
            {
                DataGridViewColumn col = gv.Columns[gv.SelectedCells[0].ColumnIndex];

                if (col.DataGridView.SelectedCells.Count > 0 && gv.SelectedCells[0].Selected)
                {
                    DataGridViewRow dr = gv.SelectedCells[0].OwningRow;
                    int             id = -1;
                    id = int.Parse(dr.Cells[AgentEntity.FIELD_ID].Value.ToString());
                    AgentForm form = new AgentForm(id, _readOnly);
                    form.ShowDialog();
                    fillGrid();
                }
            }
        }
Beispiel #4
0
        public void login(string username, string password)
        {
            AgentController agentController = new AgentController(server, username, appContext, form);

            try
            {
                if (server.login(username, password, agentController))
                {
                    AgentForm agentForm = new AgentForm(agentController);
                    this.appContext.MainForm = agentForm;
                    appContext.MainForm.Show();
                    form.Hide();
                }
            }
            catch (ServicesException e)
            {
                MessageBox.Show(e.Message);
            }
        }
Beispiel #5
0
 public AddAppointmentForm(AppointmentService appointmentService, AgentForm agentForm)
 {
     _appointmentService = appointmentService;
     _agentForm          = agentForm;
     InitializeComponent();
 }