Beispiel #1
0
    private void GetData()
    {
        if (!Mgr.CheckLogin(this, 3))
        {
            return;
        }

        string s = "SELECT d1.rkey ,d2.employeecode as 工号, d2.chinesename as 姓名,  ";

        s += " (case reqstate when 0 then '未提交' when 1 then '已提交' when 2 then '已审核' when 3 then '退回' end) as 状态, reqinfo as 备注, reqperson as 提交人,";
        s += " reqtime as 提交时间, (case reqtype when 0 then '补卡' when 1 then '请假' when 2 then '修改工时' end ) as 类型, req_cardtime as 时间, req_starttime as 始,";
        s += " req_endtime as 终, zbhour as 正班, jbhour as 加班, dealperson as 受理人, dealtime as 受理时间 , d1.Cardno, d1.employeeid , d1.AskForLeaveRK, d3.LeaveType";
        s += " FROM Req d1 INNER JOIN employeemsg d2 ON d1.employeeid = d2.rkey ";
        s += " LEFT JOIN AskForLeave d3 ON d1.AskForLeaveRK = d3.RKey ";
        s += " WHERE Reqtime BETWEEN " + Mgr.QuoteStr(BeginTime.Text) + " AND ";
        s += " dateadd(day,2," + Mgr.QuoteStr(EndTime.Text) + ") " + " AND ReqState = " + cbx_type.SelectedValue.ToString( );
        if (!string.IsNullOrEmpty(tbxEmployID.Text))
        {
            if (!Mgr.CheckInt(tbxEmployID.Text))
            {
                Mgr.ShowAlert(this, "工号只能是数字!");
                return;
            }
            s += " AND d2.employeecode=" + tbxEmployID.Text;
        }
        s += " ORDER BY 工号";
        DBBase    db = new DBBase( );
        DataTable tb = new DataTable( );

        tb = db.SqlOpen(s);
        ReqDataView.DataSource = tb;
        ReqDataView.DataBind( );
    }