ArchievementForm.cs

(开头部分) 4KB

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

//文件名:ArchievementForm.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 ArchievementForm : Form
    {
        public ArchievementForm()
        {
            InitializeComponent();
        }

        private void 工作业绩BindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.工作业绩BindingSource.EndEdit();
            this.工作业绩TableAdapter.Update(this.myPersonnelDataSet.工作业绩);

        }

        private void ArchievementForm_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“myPersonnelDataSet.工作业绩”中。您可以根据需要移动或移除它。
            this.工作业绩TableAdapter.Fill(this.myPersonnelDataSet.工作业绩);
            this.myPersonnelDataSet.工作业绩.Rows.Clear();
        }

        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 = "YJ0000000" + MyID.ToString();
                    break;
                case 2:
                    MyNewID = "YJ000000" + MyID.ToString();
后面还有 60 行代码,解锁后查看完整代码

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

AI 解读

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

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