Exemplo n.º 1
0
        public AddEditVisits(Visit visit, Doctor doctor, Patient patient, Servise servise, Treatment treatment)
        {
            InitializeComponent();
            this.Text = "Редактировать запись";
            FillComboBoxPatients(Patients.Records().Get());
            FillComboBoxServises(Servises.Records().Get());
            FillComboBoxServises(Doctors.Records().Get());
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme          = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme    = new ColorScheme(Primary.Blue400, Primary.Blue700, Primary.BlueGrey500, Accent.LightBlue100, TextShade.WHITE);
            clientsNameComboBox.SelectedIndex  = visit.Pasport_ID - 1;
            comboBoxServisesName.SelectedIndex = visit.Servise_number - 1;
            comboBoxDoctorsName.SelectedIndex  = visit.Employee_number - 1;
            hours.Text            = Convert.ToString(visit.Date.Hour);
            minutes.Text          = Convert.ToString(visit.Date.Minute);
            seconds.Text          = Convert.ToString(visit.Date.Second);
            dateTimePicker1.Value = visit.Date;
            button1.Text          = "Редактировать";
            _Doctor    = doctor;
            _Servise   = servise;
            _Visit     = visit;
            _Treatment = treatment;
            _Patient   = patient;
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (_Servise == null)
     {
         Servise servise = new Servise()
         {
             Cost         = int.Parse(textBox2.Text),
             Servise_name = textBox3.Text
         };
         servise.onValidationError += Servise_onValidationError;
         if (servise.Save() > 0)
         {
             MessageBox.Show("Услуга добавлена");
         }
         else
         {
             MessageBox.Show("Ошибка в добавлении");
         }
     }
     else
     {
         _Servise.Cost         = int.Parse(textBox2.Text);
         _Servise.Servise_name = textBox3.Text;
         if (_Servise.Save() > 0)
         {
             MessageBox.Show("Услуга изменена");
         }
     }
     this.Close();
 }
Exemplo n.º 3
0
 public AddEditServises(Servise servise)
 {
     InitializeComponent();
     textBox2.Text = Convert.ToString(servise.Cost);
     textBox3.Text = servise.Servise_name;
     button1.Text  = "Обновление";
     _Servise      = servise;
     _Servise.onValidationError += Servise_onValidationError;
 }
        public void TestRecalculateBallance()
        {
            var srv = new Servise();

            srv.RecalculateBallance("5111111111111111");
            srv.RecalculateBallance("5111111111111112");

            using (var ctx = new Bank1Entities())
            {
                var card1 = ctx.Card.Single(c => c.CadrID == "5111111111111111");
                var card2 = ctx.Card.Single(c => c.CadrID == "5111111111111112");

                Assert.AreEqual(0, card1.Ballance + card2.Ballance);
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            const int cPaymentMethods = 2; //Количество способов оплаты
            const int cBusTypes       = 3; //Количество типов автобусов
            const int cTariff         = 3; //Количество тарифов
            const int cNonCashMethods = 3; //Количество тарифов

            Console.WriteLine("Введите тип автобуса: ");
            for (int i = 1; i <= cBusTypes; i++)
            {
                Console.WriteLine($"{i}.{(BusTypes)i}");
            }
            int.TryParse(Console.ReadLine(), out int Choose);

            BusTypes bysType = (BusTypes)Choose;

            Console.WriteLine("Введите Тариф: ");
            for (int i = 1; i <= cTariff; i++)
            {
                Console.WriteLine($"{i}.{(Tariff)i}");
            }
            int.TryParse(Console.ReadLine(), out Choose);

            Tariff tariff = (Tariff)Choose;


            Console.WriteLine("Введите метод оплаты: ");
            for (int i = 1; i <= 2; i++)
            {
                Console.WriteLine($"{i}.{(PaymentMethods)i}");
            }
            int.TryParse(Console.ReadLine(), out Choose);

            PaymentMethods paymentMethod = (PaymentMethods)Choose;

            Tiket tiket = new Tiket()
            {
                Date        = DateTime.Now,
                TiketNumbet = Servise.GetRandomNumber(),
                Bus         = new BusClass()
                {
                    Id      = Servise.GetRandomNumber(),
                    BusPark = Servise.GetRandomPark(),
                    Type    = bysType
                },
                Tariff        = tariff,
                paymentMethod = PaymentMethods.CashMethod
            };

            switch ((int)paymentMethod)
            {
            case 1:
                tiket.paymentMethod = PaymentMethods.CashMethod;
                PayService.showTiket(tiket);
                break;

            case 2:
                Console.WriteLine("Введите вид безналичной оплаты: ");
                for (int i = 1; i <= cNonCashMethods; i++)
                {
                    Console.WriteLine($"{i}.{(NonCashMethods)i}");
                }
                int.TryParse(Console.ReadLine(), out Choose);

                NonCashMethods NonCashMethod = (NonCashMethods)Choose;

                tiket.paymentMethod = PaymentMethods.NonCashMethods;
                PayService.showTiket(tiket);
                Console.WriteLine("Было оплачено через: " + NonCashMethod);
                break;
            }
        }