Пример #1
0
        static void Main(string[] args)
        {
            CarBrand model = new CarBrand();

            model = new CarBrand("Bmw", 2010, "Germany", 3, "x5", "hatchback");
            model.setValues("black", 15000);


            model.Notify += DisplayMessage;
            model.PriceIncrease(1000);
            model.PriceReduction(5000);
            model.PriceReduction(17000);

            Console.WriteLine("\n\n");

            CarBrandColor color1 = (CarBrand exemple, string color) => ColorCmp(model, "green");

            if (color1(model, "green"))
            {
                Console.WriteLine("машина зеленого цвета");
            }
            else
            {
                Console.WriteLine("машина другого цвета");
            }
            Console.WriteLine("\n\n");

            model.GetInfo();

            CarName carName;

            carName = SetCarName;
            // ковар.
            Car model2 = carName("Ford");

            Console.WriteLine(model2.Name);

            //контр.
            CBName   cbname = GetCarName;
            CarBrand model3 = new CarBrand {
                Name = "Ferrari"
            };

            cbname(model3);
        }
Пример #2
0
        public void UpdateWorkAssignment()
        {
            if (string.IsNullOrEmpty(CBName.Text))
            {
                MessageBox.Show("Please select an employee.");
            }
            else
            {
                int nameIndex = Employee.EmployeeList.FindIndex(n => n.Name == CBName.Text);
                Employee.EmployeeList[nameIndex].DayOneAssignment   = CBDayOne.Text;
                Employee.EmployeeList[nameIndex].DayTwoAssignment   = CBDayTwo.Text;
                Employee.EmployeeList[nameIndex].DayThreeAssignment = CBDayThree.Text;
                Employee.EmployeeList[nameIndex].DayFourAssignment  = CBDayFour.Text;
                Employee.EmployeeList[nameIndex].DayFiveAssignment  = CBDayFive.Text;

                CBName.ResetText();
                CBDayOne.ResetText();
                CBDayTwo.ResetText();
                CBDayThree.ResetText();
                CBDayFour.ResetText();
                CBDayFive.ResetText();
            }
        }