⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmequipmentclearfind.cs

📁 C#编的 英文的 带报告 上学期的作业 分数还不错
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EquipmentMS.Equipment
{
    public partial class frmEquipmentClearFind : Form
    {
        EquipmentMS.BaseClass.Operation oper = new EquipmentMS.BaseClass.Operation();
        string P_str_type = "";
        string P_str_BH = "";
        public frmEquipmentClearFind()
        {
            InitializeComponent();
        }

        private void frmEquipmentClearFind_Load(object sender, EventArgs e)
        {
            toolStripButton2_Click(sender, e);
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (tlcmbFind.Text == "")
            {
                MessageBox.Show("Please choose query condition!", "System Prompt", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataSet ds = null;
            ds = oper.GetDataSetzcClear(P_str_type, tltxtContent.Text);
            dgvEquipment.DataSource = ds.Tables[0].DefaultView;
        }

        private void tlcmbFind_TextChanged(object sender, EventArgs e)
        {
            
        }

        private void tlcmbFind_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (tlcmbFind.Text)
            {
                case "Equipment No":
                    P_str_type = "BH";
                    break;
                case "Equipment Name":
                    P_str_type = "MC";
                    break;
                case "Dept":
                    P_str_type = "SYBM";
                    break;
                case "Place":
                    P_str_type = "CFDD";
                    break;
                case "Cleaner":
                    P_str_type = "QLR";
                    break;
                case "Custodian":
                    P_str_type = "BGRY";
                    break;
                case "Approver":
                    P_str_type = "PZR";
                    break;
            }
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            DataSet ds = null;
            ds = oper.GetDataSetzcClear();
            dgvEquipment.DataSource = ds.Tables[0].DefaultView;
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            if (dgvEquipment.SelectedRows.Count > 0)
            {
                if (dgvEquipment.SelectedCells[0].Value.ToString() == "")
                {
                    MessageBox.Show("Please choose data which need delete!", "System Prompt", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                int i = oper.DeletezcClear(dgvEquipment.SelectedCells[0].Value.ToString());
                DataSet ds = null;
                if (tlcmbFind.Text == "")
                {
                    ds = oper.GetDataSetzcClear("BH", tltxtContent.Text);
                }
                else
                {
                    ds = oper.GetDataSetzcClear(P_str_type, tltxtContent.Text);
                }
                dgvEquipment.DataSource = ds.Tables[0].DefaultView;
                MessageBox.Show("Delete succeed!", "System Prompt", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void dgvEquipment_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            P_str_BH = dgvEquipment[0, e.RowIndex].Value.ToString();
        }

        private void dgvEquipment_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -