QueryPayForm.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

//文件名:QueryPayForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Data.SqlClient;
using Microsoft.Office.Interop.Excel;
using System.Reflection;
using Microsoft.Office.Core;


namespace MyPersonnel
{
    public partial class QueryPayForm : Form
    {
        public QueryPayForm()
        {
            InitializeComponent();
        }
        public string MyCompany;
        private void QueryPayForm_Load(object sender, EventArgs e)
        {
            String MySQLConnectionString = global::MyPersonnel.Properties.Settings.Default.MyPersonnelConnectionString;
            SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
            MyConnection.Open();
            //获取公司的部门信息            
            System.Data.DataTable MyDepartmentTable = new System.Data.DataTable();
            string MySQL = "Select 部门名称 From 公司部门";
            SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
            MyAdapter.Fill(MyDepartmentTable);
            foreach (DataRow MyRow in MyDepartmentTable.Rows)
            {
                this.部门ToolStripComboBox.Items.Add(MyRow[0].ToString());
            }
            if (MyConnection.State == ConnectionState.Open)
            {
                MyConnection.Close();
            }
            for (int i = 2006; i < 2100; i++)
            {
                this.年份ToolStripComboBox.Items.Add(i.ToString());
            }
            for (int i = 1; i < 13; i++)
            {
                this.月份ToolStripComboBox.Items.Add(i.ToString());
            }
            if (MyConnection.State == ConnectionState.Open)
            {
                MyConnection.Close();
            }
        }
        private void 查询ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.工资发放表TableAdapter.FillBy(this.myPersonnelDataSet.工资发放表, new System.Nullable<int>(((int)(System.Convert.ChangeType(this.月份ToolStripComboBox.Text, typeof(int))))), this.部门ToolStripComboBox.Text, new System.Nullable<int>(((int)(System.Convert.ChangeType(this.年份ToolStripComboBox.Text, typeof(int))))));
后面还有 210 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。