Пример #1
0
        private void addPlanifiedBikesToDB(object sender, EventArgs e)
        {
            //dataGridView2.Rows.Clear();
            message = "Save changes ? ";
            DialogResult dialogResult = MessageBox.Show(message, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.Yes)
            {
                string weekName = textBox1.Text;
                Manager.SetNewPlanning(user.planningCart, Int32.Parse(weekName));
                message = "Your changes has been saved ";
                MessageBox.Show(message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                comboBox1.DataSource = Manager.GetPlanifiedWeekName().Select(x => x[0]).ToList();
                Manager_Make_Planning_Load(sender, e);
                user.planningCart = new List <List <string> >();
            }
            else
            {
                message = "You have choosed to unsave your changes !";
                MessageBox.Show(message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)//update schedule
        {
            updateButton = true;
            if (newWeekToAssign.Text.ToString() == string.Empty)
            {
                message = "Choose a week id from the calendar !";
                MessageBox.Show(message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int    id          = Int32.Parse(idBike.Text.ToString());
                string newWeek     = newWeekToAssign.Text.ToString();
                string currentWeek = weekToModify.Text.ToString();
                Manager.UpdateSchedule(id, newWeek, currentWeek);
                comboBox1.DataSource = Manager.GetPlanifiedWeekName().Select(x => x[0]).ToList();
                dataGridView1.Rows.Clear();
                message = "Bike successfully modified";
                MessageBox.Show(message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }


            updateButton = false;
        }
Пример #3
0
 private void loadWeeksOfWork(object sender, EventArgs e)
 {
     comboBox1.DataSource = Manager.GetPlanifiedWeekName().Select(x => x[0]).ToList();
 }