コード例 #1
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果
            foreach (Control label in this.Controls)
            {
                if (label.GetType().ToString() == "System.Windows.Forms.Label")
                {
                    label.Font = UI_FontUtil.SetMainFont();
                }
            }
            DateTime tmCur = DateTime.Now;

            if (tmCur.Hour < 8 || tmCur.Hour > 18)
            {//晚上
                label3.Text = "(*´▽`)ノノ晚上好,";
                label5.Text = LoginInfo.WorkerName;
            }
            else if (tmCur.Hour > 8 && tmCur.Hour < 12)
            {//上午
                label3.Text = "上午好,";
                label5.Text = LoginInfo.WorkerName;
            }
            else
            {//下午
                label3.Text = "下午好,";
                label5.Text = LoginInfo.WorkerName;
            }
            int n = Convert.ToInt32(WorkerCheckManager.SelectToDayCheckInfoByWorkerNo(LoginInfo.WorkerNo));

            if (n > 0)
            {
                linkLabel1.Text      = "已打卡";
                linkLabel1.ForeColor = Color.Green;
                linkLabel1.LinkColor = Color.Green;
            }
            notifyIcon1.Text = "TS酒店管理系统-版本号:" + System.Windows.Forms.Application.ProductVersion.ToString();
            wk_WorkerName    = LoginInfo.WorkerName;
            //Opacity = 0.0; //窗体透明度为0
            //fadeTimer.Start(); //计时开始
            picRoom.BackgroundImage     = Resources.预订管理ab;
            picExtend.BackgroundImage   = Resources.扩展功能_ib;
            picCustomer.BackgroundImage = Resources.用户管理_ib;
            //CheckUpdate();
            pnlMID.Controls.Clear();
            FrmRoomManager frm1 = new FrmRoomManager();

            frm1.TopLevel = false;
            pnlMID.Controls.Add(frm1);
            frm1.Show();
        }
コード例 #2
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            int n = Convert.ToInt32(WorkerCheckManager.SelectToDayCheckInfoByWorkerNo(LoginInfo.WorkerNo));

            if (n > 0)
            {
                linkLabel1.Text      = "已打卡";
                linkLabel1.ForeColor = Color.Green;
                linkLabel1.LinkColor = Color.Green;
                pnlCheckInfo.Visible = true;
                lblCheckDay.Text     = Convert.ToString(WorkerCheckManager.SelectWorkerCheckDaySumByWorkerNo(LoginInfo.WorkerNo));
            }
            else
            {
                linkLabel1.Text      = "未打卡";
                linkLabel1.ForeColor = Color.Red;
                linkLabel1.LinkColor = Color.Red;
                DialogResult dr = MessageBox.Show("你今天还未打卡哦,请先打卡吧!", "打卡提醒", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    WorkerCheck workerCheck = new WorkerCheck
                    {
                        WorkerNo  = LoginInfo.WorkerNo,
                        CheckWay  = "系统界面",
                        CheckTime = DateTime.Parse(GetNetDateTime())
                    };
                    int j = WorkerCheckManager.AddCheckInfo(workerCheck);
                    if (j > 0)
                    {
                        lblCheckDay.Text = Convert.ToString(WorkerCheckManager.SelectWorkerCheckDaySumByWorkerNo(LoginInfo.WorkerNo));
                        MessageBox.Show("打卡成功!你已累计打卡" + lblCheckDay.Text + "天,再接再厉吧!", "打卡提醒", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        linkLabel1.Text      = "已打卡";
                        linkLabel1.ForeColor = Color.Green;
                        linkLabel1.LinkColor = Color.Green;
                        pnlCheckInfo.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("服务器错误,请稍后再试!");
                    }
                }
            }
        }