Exemple #1
0
 //单条记录设置隐藏
 void miHidden_Click(object sender, RoutedEventArgs e)
 {
     Model.TB_AthleteInfo selectedAth = dgAthlete.SelectedValue as Model.TB_AthleteInfo;
     try
     {
         if (BLL.TB_Setting.OldPwd == "")
         {
             AddHiddenPwdWindow pwdWindow = new AddHiddenPwdWindow();
             pwdWindow.Owner = Application.Current.MainWindow;
             if (pwdWindow.ShowDialog() == true)
             {
                 athleteBLL.HiddenData(selectedAth.ID.ToString(), true);
                 RefrenshAthleteList();
             }
         }
         else
         {
             athleteBLL.HiddenData(selectedAth.ID.ToString(), true);
             RefrenshAthleteList();
         }
     }
     catch (Exception ee)
     {
         MessageBox.Show("隐藏出错!\r\n" + ee.Message, "系统错误");
     }
 }
        private void btnVisibly_Click(object sender, RoutedEventArgs e)
        {
            string ids = GetSelectedID();

            if (ids == "")
            {
                MessageBox.Show("请至少选择一条信息!", "系统信息");
                return;
            }
            try
            {
                athleteBLL.HiddenData(ids, false);
                RefrenshAthleteList();
            }
            catch (Exception ee) {
                MessageBox.Show("保存到数据库出错!\r\n" + ee.Message, "系统错误");
            }
        }