예제 #1
0
        private void editSalesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DailySalesDialog d = new DailySalesDialog();

            d.ShowDialog(this);
        }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (employees.Count != 0)
     {
         if (predictedSales == null)
         {
             DailySalesDialog dsd = new DailySalesDialog();
             if (dsd.ShowDialog(this) == DialogResult.OK)
             {
                 SchedulerConfig mainConfig = new SchedulerConfig(seRatio, predictedSales, schedulingDays);
                 if (mainConfig.isPossibleSchedule())
                 {
                     int        a        = 0;
                     int        b        = 0;
                     Employee[] employee = mainConfig.createScheduleByWeekVolume();//Employee[] employee = mainConfig.createSchedule2();
                     if (employee != null)
                     {
                         Console.WriteLine("Succeeded " + ++a + " times.");
                         createCustomColumns();
                         employees = new List <Employee>(employee);
                         displaySchedule(employees.ToArray());
                     }
                     else
                     {
                         MessageBox.Show("Failed " + ++b + " times.");
                     }
                 }
                 else
                 {
                     MessageBox.Show("Schedule Not Possible", "Not Possible");
                 }
             }
         }
         else
         {
             SchedulerConfig mainConfig = new SchedulerConfig(seRatio, predictedSales, schedulingDays);
             if (mainConfig.isPossibleSchedule())
             {
                 int        a        = 0;
                 int        b        = 0;
                 Employee[] employee = mainConfig.createSchedule2();
                 if (employee != null)
                 {
                     Console.WriteLine("Succeeded " + ++a + " times.");
                     createCustomColumns();
                     employees = new List <Employee>(employee);
                     displaySchedule(employees.ToArray());
                 }
                 else
                 {
                     MessageBox.Show("Failed " + ++b + " times.");
                 }
             }
             else
             {
                 MessageBox.Show("Schedule Not Possible", "Not Possible");
             }
         }
     }
     else
     {
         if (MessageBox.Show("No employees loaded. Would you like to load the employee file?", "No Employees Found",
                             MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             sid = new SalesInfoDialogue();
             if (sid.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
             {
                 loadEmployees(fileLocation);
             }
         }
     }
 }