Exemplo n.º 1
0
        /// <summary>
        /// 删除一个用户记录
        /// </summary>
        private void bt_deleteonerecordSalary()
        {
            Salary salary = (Salary)UserGrid.SelectedItem;
            int    Id     = salary.Id;

            if (MessageBox.Show("是否删除该用户的信息?", "Tips", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                SalaryBLL salaryBLL = new SalaryBLL();
                salaryBLL.DeletSalary(Id);
            }
            salaryList = SalaryBLL.GetAllSalary();
            SalaryBinding(maxnum, 1);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 批量删除用户记录
 /// </summary>
 private void bt_deletemanySalary()
 {
     if (selectedID.Count != 0)
     {
         if (MessageBox.Show("是否删除所选中的员工信息?", "Tips", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             foreach (int i in selectedID)
             {
                 SalaryBLL salaryBLL = new SalaryBLL();
                 salaryBLL.DeletSalary(i);                         //循环遍历删除里面的记录
             }
         }
         else
         {
             selectedID.Clear();
         }
         salaryList = SalaryBLL.GetAllSalary();
         SalaryBinding(maxnum, 1);                     //刷新页面
     }
     else
     {
         MessageBox.Show("请选择要删除的用户");
     }
 }