Example #1
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("你确定要执行重置操作?这将会删除除“教师信息”外的所有数据!", "警告!!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                try
                {
                    SqlHelper help = new SqlHelper();
                    help.delete("Logs_Data", "");
                    help.delete("Placement_Data", "");
                    help.delete("SpareTime_Data", "");
                    help.delete("Classes_Data", "");
                    help.delete("Conf", "");

                    Main.fm.flashListview();
                    MessageBox.Show("操作成功");
                }
                catch { MessageBox.Show("操作失败"); }
            }
        }
Example #2
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            if (listView1.CheckedItems.Count != 0)
            {
                SqlHelper help = new SqlHelper();
                string condition = " where " + "Teacher='" + listView1.CheckedItems[0].SubItems[1].Text + "'";

                if (help.delete("Teachers_Data", condition) > 0)
                {
                    MessageBox.Show("删除成功");
                }
                else
                {
                    MessageBox.Show("删除失败");
                }

                listView1.Items.Clear();
                setTbEnable();
                clear_listview();
                totalpage = pageshow.totalpage("select * from Teachers_Data", pagesize, "Teachers_Data");
                labPageAll.Text = totalpage + "";
                textBoxNow.Text = currentpage.ToString();
                DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data");
                UIShow show = new UIShow();
                show.teachers_listview_write(dt, listView1);

                groupBox1.SendToBack();
            }
        }
Example #3
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("你确定要执行删除操作?这将会删除当前的所有数据!", "警告!!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                try
                {

                    SqlHelper help = new SqlHelper();
                    help.delete("Classes_Data", " ");
                    frmPlan_Load(sender, e);

                }
                catch (Exception)
                {

                }
            }
        }