private void ButtonCancel_Click(object sender, RoutedEventArgs e) { UserWindow1 UserWindow = new UserWindow1(); //loginWindow.Show(); UserWindow.WindowStartupLocation = WindowStartupLocation.Manual; UserWindow.Left = this.Left; UserWindow.Top = this.Top; UserWindow.Show(); this.Close(); }
private void ButtonCancel_Click(object sender, RoutedEventArgs e) { UserWindow1 UserWindow = new UserWindow1(); UserWindow.WindowStartupLocation = WindowStartupLocation.Manual; UserWindow.Left = this.Left; UserWindow.Top = this.Top; UserWindow.Show(); BookStore.BLL.UserBLL user = new UserBLL(); UserWindow.dataGrid.ItemsSource = user.GetAllUsers(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { string ID = Txt_ID.Text.Trim(); string Birthday = Txt_birthday.Text.Trim(); string email = Txt_email.Text.Trim(); string Type = Txt_type.Text.Trim(); int count = 0; UserBLL userbll = new UserBLL(); if (ID == "" || Birthday == "" || email == "" || Type == "") { // 有信息未填 MessageBox.Show("所有信息不能为空!"); return; } int id = int.Parse(ID); DateTime birthday = DateTime.Parse(Birthday); int type = int.Parse(Type); count = userbll.Updateinform(id, birthday, email, type); if (count > 0) { MessageBoxResult boxResult = MessageBox.Show("数据修改成功!", "提示:", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.No); if (boxResult == MessageBoxResult.Yes) { UserWindow1 UserWindow = new UserWindow1(); UserWindow.WindowStartupLocation = WindowStartupLocation.Manual; UserWindow.Left = this.Left; UserWindow.Top = this.Top; UserWindow.Show(); UserBLL user = new UserBLL(); UserWindow.dataGrid.ItemsSource = user.GetAllUsers(); this.Close(); } else { MessageBox.Show("查无此人!"); } } }
private void Button_Click(object sender, RoutedEventArgs e) { string Id = this.txtId.Text.Trim(); string name = this.txtName.Text.Trim(); string Mail = this.txtMail.Text.Trim(); string Type = this.txtType.Text.Trim(); if (Type == "" || name == "" || Id == "" || Mail == "") { // 有信息未填 MessageBox.Show("所有信息不能为空!"); return; } User user = null; BookStore.BLL.UserBLL bll = new UserBLL(); int flag = 0; /*user.Id = Convert.ToInt32(this.txtId.Text.Trim());//int.Parse(ID); * user.Name = name; * user.Email = this.txtMail.Text.Trim(); * user.Type = Convert.ToInt32(this.txtType.Text.Trim());*/ flag = bll.Softdelete(Id); if (flag == 1) { MessageBoxResult boxResult = MessageBox.Show("删除成功!", "提示:", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.No); if (boxResult == MessageBoxResult.Yes) { UserWindow1 UserWindow = new UserWindow1(); UserWindow.WindowStartupLocation = WindowStartupLocation.Manual; UserWindow.Left = this.Left; UserWindow.Top = this.Top; UserWindow.Show(); this.Close(); } } }