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

📄 frmsystemdattime.cs

📁 财务凭证管理系统,主要是从事公司或部门的财务方面的管理。此系统给会计人员带来很大的帮助!
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using property.model.tb_logInfo;
using property.model.GetConnection;
using property.control.SystemInfo;
using System.Data.SqlClient;
using System.Data;
namespace property.view.SystemInfo
{
    public partial class frmSystemDatTime : Form
    {
        public frmSystemDatTime()
        {
            InitializeComponent();
        }
         public frmSystemDatTime(string P_str_name)
        {
            InitializeComponent();
            this.P_str_getUserName = P_str_name;
        }
        public string P_str_getUserName;
    

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar !=8 && !char.IsDigit(e.KeyChar))
            {
                MessageBox.Show("年份只能输入数字", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                e.Handled = true;
            }
        }

        private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar))
            {
                MessageBox.Show("月份只能输入数字", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                e.Handled = true;
            }
        }
        //保存
        private void linkSave_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (this.txtYear.Text == "")
            {
                MessageBox.Show("年份不能为空", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtYear.Focus();
                return;
            }
            if (this.txtMonths.Text == "")
            { MessageBox.Show("月份不能为空", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
               this.txtMonths.Focus();
               return;
            }
            if (Convert.ToInt32(txtYear.Text.Trim()) < 1990 || Convert.ToInt32(txtYear.Text.Trim()) >9999 )
            {
                MessageBox.Show("请输入正确年份", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtYear.Focus();
                return;
            }
            if (Convert.ToInt32(txtMonths.Text.Trim()) < 0 || Convert.ToInt32(txtMonths.Text.Trim())>12)
            {
                MessageBox.Show("请输入正确月份", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMonths.Focus();
                return;
            }
            string P_str_Date = txtYear.Text.ToString() + "-" + txtMonths.Text.ToString();
            tb_logInfo tblog = new tb_logInfo();
            log lg=new log();
            tblog.setusername(P_str_getUserName);
            tblog.setlogdate(Convert.ToDateTime(P_str_Date));
            string P_str_reslu = lg.GetInfoLogAdd(tblog);
            if (P_str_reslu == "ok")
            { MessageBox.Show("初始时期完成", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }
            if (P_str_reslu == "no")
            { MessageBox.Show("月份不能为空", "有情提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }
                
            

        }// end block mehotd 

        private void SystemDatTime_Load_1(object sender, EventArgs e)
        {

        }

        private void txtYear_TextChanged(object sender, EventArgs e)
        {

        }

        private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            txtMonths.Text = "";
            txtYear.Text = "";
            txtMonths.Enabled = false;
            txtYear.Enabled = false;
        }

        private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DialogResult a = MessageBox.Show("是否要退出?", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (Convert.ToString(a) == "Yes")
            {
                this.Close();
            }// end block 
        }

        private void groupBox2_Enter(object sender, EventArgs e)
        {

        }

        private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.txtMonths.Enabled = true;
            this.txtYear.Enabled = true;
        }
    }
}

⌨️ 快捷键说明

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