timeset.ascx.cs

来自「一个简单的OA系统,对于中小型企业的OA」· CS 代码 · 共 37 行

CS
37
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class controls_TimeSet : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //初次显示页面时,要先查看是否设置了工作时间
        //如果已设置,则两个文本框分别显示其值
        if (!Page.IsPostBack)
        {
            TimeSet myset=new TimeSet();
            //如果为空,则表示是第一次设置时间
            TextBox1.Text = myset.GetOnDutyTime();
            TextBox2.Text = myset.GetOffDutyTime();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //初始化时间设置类
        TimeSet mytime = new TimeSet();
        //使用时间设置类的方法设置时间
        bool result=mytime.SetTime(TextBox1.Text, TextBox2.Text);
        //判断执行是否成功
        if (result)
            Response.Write("<script language=javascript>alert('时间设置成功')</script>");
    }
}

⌨️ 快捷键说明

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