private void lblQuery_MouseDown(object sender, MouseButtonEventArgs e) { try { dataList = DataOperate.query(this.cbxIsMistaken.IsChecked); this.lswData.ItemsSource = Filter.searchList(dataList, txtFilter.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 由ChecBox的Click事件修改是否已处罚 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CheckBox_Click(object sender, RoutedEventArgs e) { CheckBox cbx = sender as CheckBox; string guid = cbx.Tag.ToString(); try { DataOperate.singedData(guid, (bool)cbx.IsChecked); } catch (Exception ex) { throw ex; } }
private void lblModify_MouseDown(object sender, MouseButtonEventArgs e) { try { //((IEditableObject)DataContext).EndEdit(); DataOperate.CharacterToData(data); data = DataOperate.modifyData(data); //data = (Data)this.DataContext; this.DialogResult = true; } catch (Exception ex) { MessageBox.Show(Messages.MODIFY_ERROR); throw ex; } this.Close(); }
/// <summary> /// 删除选中行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; foreach (Data data in dataList) { if (button.Tag.Equals(data.Guid)) { dataList.Remove(data); this.lswData.ItemsSource = Filter.searchList(dataList, txtFilter.Text); if (!DataOperate.deleteData(data)) { MessageBox.Show("删除失败"); } break; } } }
private void lblImport_MouseDown(object sender, MouseButtonEventArgs e) { try { bool autoCalculate = (bool)cbxAutoCalculate.IsChecked; if (cbxTown.SelectedIndex != 0) { foreach (Data data in ExcelOperate.getDataList(tbxPath.Text, cbxTown.Text, autoCalculate)) { DataOperate.insertData(data); } MessageBox.Show(Messages.IMPORT_COMPLETE); } else { MessageBox.Show(Messages.IMPORT_NOTIFY); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { string name = cbxNames.Text; string password = Security.Security.getMD5(pbxPassword.Password); if (Common.sshConnected) { if (DataOperate.login(name, password)) { MessageBox.Show(Messages.LOGIN_SUCCESS); Common.table = name; this.Close(); } else { MessageBox.Show(Messages.LOGIN_ERROR); } } else { MessageBox.Show(Messages.SSH_ERROR); } }
private void lswData_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Data data = (Data)lswData.SelectedItem; if (data != null) { DataModify dm = new DataModify(data); if (dm.ShowDialog() == true) { try { //lswData.ItemsSource = Filter.searchList(dataList, txtFilter.Text); dataList = DataOperate.query(this.cbxIsMistaken.IsChecked); this.lswData.ItemsSource = Filter.searchList(dataList, txtFilter.Text); }catch (Exception ex) { throw ex; } } else { dataList = DataOperate.query(this.cbxIsMistaken.IsChecked); this.lswData.ItemsSource = Filter.searchList(dataList, txtFilter.Text); } } }