Example #1
0
        private void btnCalc_Click(object sender, EventArgs e)
        {
            int k = int.Parse(txtBxK.Text); //кол-во планшетов
            int m = int.Parse(txtBxM.Text); //объем памяти
            int r = int.Parse(txtBxR.Text); //рейтинг

            decimal sum = 0;

            var chipTablets = ChoiceManager.GetChipsTablet(_tablets, k, m, r, out sum);

            dataGridView2.DataSource = chipTablets;
            txtBxTotal.Text          = sum.ToString("C2");
        }
Example #2
0
        static void Choice()
        {
            decimal sum = 0;

            Console.Write("K = ");
            int k = int.Parse(Console.ReadLine());

            Console.Write("M = ");
            int m = int.Parse(Console.ReadLine());

            Console.Write("R = ");
            int r = int.Parse(Console.ReadLine());

            var chipTablets = ChoiceManager.GetChipsTablet(_tablets, k, m, r, out sum);

            Show(chipTablets);
            Console.WriteLine("Сумма = " + sum);
        }