Beispiel #1
0
        private void PharmacyDetails_Load(object sender, EventArgs e)
        {
            daneNazwaTextBox.Text = pharmacy.Name;
            daneTelefonTextBox.Text = pharmacy.Phone;
            daneAdresTextBox.Text = pharmacy.Address;

            MainForm owner = Owner as MainForm;
            client = owner.client;

            loadMedicines();
        }
Beispiel #2
0
        private void MedicineDetails_Load(object sender, EventArgs e)
        {
            MainForm owner = Owner as MainForm;
            client = owner.client;

            var pharmacy = new QueryRequestOfProductQueryVmy3cGwc();
            pharmacy.Query = new ProductQuery()
            {
                ByMedicineId = medicineDto.MedicineId
            };
            var responsePharmacy = client.GetMatchingProducts(pharmacy);

            foreach (var product in responsePharmacy.Data)
            {
                medicinesDataGridView.Rows.Add();
                int rowIndex = medicinesDataGridView.Rows.Count - 1;
                DataGridViewRow newRow = medicinesDataGridView.Rows[rowIndex];
                newRow.Cells["aptekaColumn"].Value = medicineDto.CommercialName;
                newRow.Cells["cenaColumn"].Value = product.Price;
                newRow.Cells["iloscColumn"].Value = product.OnStock;
                newRow.Tag = product;
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nawiązywanie połączenia z usługą...");
            client = new AptekaNETServiceClient();
            client.Open();
            int selection = int.MaxValue;
            while (selection != 0)
            {
                Console.WriteLine("Wybierz opcję");
                Console.WriteLine("1 - Login \n2 - Rejestracja \n3 - Logout \n4 - Znajdz apteke \n5 - Znajdz Produkt \n6 - Znajdz Lek \n7 - Zloz zamowienie\n");

                try
                {
                    selection = int.Parse(Console.ReadLine());
                }
                catch (Exception)
                {
                    continue;
                }

                Console.WriteLine("Wybrano: {0}", selection);
                switch (selection)
                {
                    case 0:
                        return;
                    case 1:
                        Login();
                        break;
                    case 2:
                        Registration();
                        break;
                    case 3:
                        Logout();
                        break;
                    case 4:
                        FindPharmacy();
                        break;
                    case 5:
                        FindProduct();
                        break;
                    case 6:
                        FindMedicine();
                        break;
                    case 7:
                        PlaceOrder();
                        break;
                }
            }

            Console.ReadKey();
            client.Close();
        }
Beispiel #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // Main window.
            WindowState = FormWindowState.Maximized;

            // Appearance
            lekiDataGridView.BackgroundColor = Color.LightGray;
            listaAptekDataGridView.BackgroundColor = Color.LightGray;
            lekiTabPage.BackColor = Color.SlateGray;
            listaAptekTabPage.BackColor = Color.SlateGray;
            m_wylogujButton.Visible = false;
            m_wylogujButton2.Visible = false;
            zamowienieTabPage.Visible = false;

            // DataGridView
            lekiDataGridView.AllowUserToAddRows = false;
            lekiDataGridView.MultiSelect = false;
            listaAptekDataGridView.AllowUserToAddRows = false;
            listaAptekDataGridView.MultiSelect = false;
            listaAptekDataGridView.MouseDoubleClick += listaAptekDataGridView_MouseDoubleClick;
            updatePriceLabel();

            // Content
            client = new AptekaNETServiceClient();
            client.Open();

            // Order
            addPharmaciesToListView();
        }
Beispiel #5
0
 public RegistrationForm(AptekaNETServiceClient _client)
 {
     InitializeComponent();
     client = _client;
 }
Beispiel #6
0
 public LoginForm(AptekaNETServiceClient _client)
 {
     InitializeComponent();
     client = _client;
 }
 public void Initialize()
 {
     _aptekaNetServiceClient = new AptekaNETServiceClient();
     _aptekaNetServiceClient.Open();
 }