LeaveForm.cs

(开头部分) 4KB

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

//文件名:LeaveForm.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;

namespace MyPersonnel
{
    public partial class LeaveForm : Form
    {
        public LeaveForm()
        {
            InitializeComponent();
        }

        private void 离职管理BindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.离职管理BindingSource.EndEdit();
            this.离职管理TableAdapter.Update(this.myPersonnelDataSet.离职管理);

        }

        private void LeaveForm_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“myPersonnelDataSet.离职管理”中。您可以根据需要移动或移除它。
            this.离职管理TableAdapter.Fill(this.myPersonnelDataSet.离职管理);            
        }

        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            //自动计算离职管理自编号
            String MySQLConnectionString = global::MyPersonnel.Properties.Settings.Default.MyPersonnelConnectionString;
            SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
            MyConnection.Open();
            SqlCommand MyCommand = MyConnection.CreateCommand();
            MyCommand.CommandText = "Select max(自编号) 最大编号 From 离职管理";
            object MyResult = MyCommand.ExecuteScalar();
            Int64 MyID = 1;
            if (MyResult != System.DBNull.Value)
            {
                String MyMaxID = MyResult.ToString().Trim();
                MyMaxID = MyMaxID.Substring(2, MyMaxID.Length - 2);
                MyID = Convert.ToInt64(MyMaxID) + 1;
            }
            int MyLength = MyID.ToString().Length;
            string MyNewID = "";
            switch (MyLength)
            {
                case 1:
                    MyNewID = "LZ0000000" + MyID.ToString();
                    break;
                case 2:
                    MyNewID = "LZ000000" + MyID.ToString();
                    break;
后面还有 59 行代码,解锁后查看完整代码

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

AI 解读

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

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