Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MySqlMedicineEntry             msme = new MySqlMedicineEntry(txtMedName.Text, txtMedMafName.Text, txtDate.Text, int.Parse(txtPrice.Text));
            MedcineEntryConfirmPopUpWindow widC = new MedcineEntryConfirmPopUpWindow
            {
                Owner = this,
                //Password is going into Password Confirme Window
                passwordForConfirm = confirmentionPassWord.ToString()
            };

            //If Entry Is Valid Then
            if (msme.validateManufactName())
            {
                //Show the Password Confiremation Field
                //If the Password is Correct
                widC.ShowDialog();
                if (widC.isPasswordConfimed == true)
                {
                    //Complete The transaction
                    msme.SaveAndCommit();
                    //Generate another password for next entry.
                    GenateConfirmationPassWord();
                    //Update the items of ListBox
                    MedicineList          = MySqlMedicineEntry.GetMedicineList();
                    medList.ItemsSource   = MedicineList;
                    medList.SelectedIndex = medList.Items.Count;
                }
            }
        }
Ejemplo n.º 2
0
 public MedicinEntryWindow()
 {
     MedicineList = MySqlMedicineEntry.GetMedicineList();
     InitializeComponent();
     DataContext         = this;
     medList.ItemsSource = MedicineList;
     GenateConfirmationPassWord();
 }