Exemple #1
0
 private void Btn_Remove_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Bạn có muốn xóa quán này ko?", "Thông báo", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         DataXML.Remove(List_Quan.SelectedIndex, (string)Cb_Quan.SelectedItem);
         Set_Result_ListView((string)Cb_Quan.SelectedItem);
     }
 }
Exemple #2
0
        void Set_Result_ListView(string key)
        {
            List <QuanAn> LQA   = DataXML.Read_QuanAn_XML(key);
            Binding       bd    = new Binding();
            string        xpath = string.Format("/QLQA/QUANAN[@Quan='{0}']", key);

            bd.XPath = xpath;
            List_Quan.DataContext = ContentData();
            List_Quan.SetBinding(ListView.ItemsSourceProperty, bd);
        }
Exemple #3
0
        void Init_For_ComboBox()
        {
            List <string> Item_Combo = new List <string>();

            Item_Combo = DataXML.Read_DataXML();
            for (int i = 0; i < Item_Combo.Count; i++)
            {
                Cb_Quan.Items.Add(Item_Combo[i]);
            }
        }
Exemple #4
0
        private void Btn_Add_Click(object sender, RoutedEventArgs e)
        {
            OtherWork OW = new OtherWork(0, (string)Cb_Quan.SelectedItem);

            if (OW.ShowDialog() == true)
            {
                DataXML.Add_Node_Data(OW.NewValue);
                MessageBox.Show("Thêm quán thành công!", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
                Set_Result_ListView((string)Cb_Quan.SelectedItem);
            }
            else
            {
                MessageBox.Show("Thêm quán không thành công!", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Exemple #5
0
        private void Btn_Update_Click(object sender, RoutedEventArgs e)
        {
            OtherWork OW = new OtherWork();
            QuanAn    QA = new QuanAn();

            QA = DataXML.Get_Node_Data(List_Quan.SelectedIndex, (string)Cb_Quan.SelectedItem);
            OW.SetValue(QA);
            if (OW.ShowDialog() == true)
            {
                DataXML.Update_Data(QA, OW.NewValue);
                MessageBox.Show("Cập nhật quán thành công!", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
                Set_Result_ListView((string)Cb_Quan.SelectedItem);
            }
            else
            {
                MessageBox.Show("Cập nhật quán không thành công!", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }