コード例 #1
0
        /// <summary>
        /// 校区编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CampusEdit_Click(object sender, RoutedEventArgs e)
        {
            CampusInfoViewModel editcampus = this.CampusdataGrid.Items[CampusdataGrid.SelectedIndex] as CampusInfoViewModel;
            CampusEditWindow    cew        = new CampusEditWindow();

            cew.Campus          = editcampus;
            cew.SelectSchoolNum = editcampus.Schoolnum;
            cew.IsEdit          = true;
            cew.ShowDialog();
            DataBinding();
        }
コード例 #2
0
 /// <summary>
 /// 窗体载入
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (_IsEdit)
     {
         cbschool.IsEnabled = false;
     }
     else
     {
         Campus = new CampusInfoViewModel();
     }
     CBDataBinding();
     cbschool.ItemsSource = Campus.ComBoxItems;
     ShowInfo();
 }
コード例 #3
0
 /// <summary>
 /// 校区删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CampusDelete_Click(object sender, RoutedEventArgs e)
 {
     if (CampusdataGrid.SelectedIndex > -1)
     {
         MessageBoxResult endResult;
         endResult = MessageBox.Show("确认要删除此校区吗?", "删除提示", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (endResult == MessageBoxResult.Yes)
         {
             CampusInfoViewModel deletecampus = this.CampusdataGrid.Items[CampusdataGrid.SelectedIndex] as CampusInfoViewModel;
             if (deletecampus.DeleteCampus())
             {
                 MessageBox.Show("删除成功!");
                 DataBinding();
             }
         }
     }
 }