示例#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;
                }
            }
        }
示例#2
0
 public MedicinEntryWindow()
 {
     MedicineList = MySqlMedicineEntry.GetMedicineList();
     InitializeComponent();
     DataContext         = this;
     medList.ItemsSource = MedicineList;
     GenateConfirmationPassWord();
 }
示例#3
0
 private void RefreshCounters()
 {
     if (ct.Ping())
     //Refresh all the counter
     {
         txtLogedInUser.Text = mySqlConnection.globalUser;
         Sicon.Fill          = new SolidColorBrush(Color.FromRgb(20, 255, 30));
         onlineStatus.Text   = "Online";
         UCMedi.text         = MySqlMedicineEntry.MediCineCount().ToString();
         UCStock.text        = MySqlUtil.MediCineCount().ToString();
         UCCompany.text      = ManufacturerInfo.GetAllManufacturerName().Count.ToString();
     }
     else
     {
         MessageBox.Show("Not Connected!");
     }
 }