Example #1
0
 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);
     }
 }
Example #2
0
        /// <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;
            }
        }
Example #3
0
        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();
        }
Example #4
0
        /// <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;
                }
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
        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);
            }
        }
Example #7
0
        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);
                }
            }
        }