Ejemplo n.º 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( );
    }
Ejemplo n.º 2
0
 protected void btn_Save_Click(object sender, EventArgs e)
 {
     if (!Mgr.CheckLogin(this, 2))
     {
         return;
     }
     Reqsub(0);
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Mgr.CheckLogin(this, 3);
     if (!IsPostBack)
     {
         BeginTime.Text = System.DateTime.Now.Date.ToString("yyyy-MM-dd");
         EndTime.Text   = System.DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
     }
 }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Mgr.CheckLogin(this, 1);
     if (!IsPostBack)
     {
         Years.Text = YearTime.Text;
         GetAllDepart( );
     }
 }
Ejemplo n.º 5
0
    protected void Btn_PostBack_Click(object sender, EventArgs e)
    {
        if (!Mgr.CheckLogin(this, 2))
        {
            return;
        }
        bool   b = false;
        string errstr = "", s;
        int    nSucc  = 0;
        int    ntotal = 0;

        for (int nn = 0; nn < ReqDataView.Rows.Count; nn++)
        {
            GridViewRow row  = ReqDataView.Rows[nn];
            Control     ctrl = row.FindControl("CheckBox1");
            if ((ctrl as CheckBox).Checked)
            {
                ntotal++;
                int n = row.RowIndex;
                //TableCellCollection cell = row.Cells;
                int    ReqRkey = Convert.ToInt32(ReqDataView.DataKeys[n].Values[0].ToString( ));
                int    nState  = Mgr.GetReqState(ReqRkey);
                string estr    = "";
                if (!Mgr.CheckState(nState, new int[] { 1 }, ref estr))
                {
                    errstr += "第 " + ntotal.ToString( ) + " 条 " + estr + "\\n";
                }
                else
                {
                    s = "UPDATE Req SET reqstate = 3 WHERE RKey= " + ReqRkey.ToString( );
                    DBBase db = new DBBase( );
                    if (db.SqlExec(s) <= 0)
                    {
                        errstr += "第 " + ntotal.ToString( ) + "条 返回0,操作失败 \\n";
                    }
                    else
                    {
                        nSucc++;
                        errstr += "第 " + ntotal.ToString( ) + "条 操作成功 \\n";
                    }
                }
                b = true;
            }
        }
        if (!b)
        {
            errstr = "数据为空";
        }
        else
        {
            errstr += "总共: " + ntotal.ToString( ) + "条    成功:" + nSucc.ToString( ) + "条";
        }
        Mgr.ShowAlert(this, errstr);
        GetData( );
    }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Mgr.CheckLogin(this, 2);
     if (!IsPostBack)
     {
         tbx_date.Text  = System.DateTime.Now.Date.ToString("yyyy-MM-dd");
         tbx_time1.Text = System.DateTime.Now.ToString( );
         tbx_time2.Text = System.DateTime.Now.ToString( );
         cbx_ReqType_SelectedIndexChanged(sender, e);
         GetRestType( );
     }
 }
Ejemplo n.º 7
0
    private void GetData()
    {
        if (!Mgr.CheckLogin(this, 2))
        {
            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 受理时间 ";
        s += " FROM Req d1 INNER JOIN employeemsg d2 ON d1.employeeid = d2.rkey ";
        s += " WHERE ReqPerson = " + Mgr.QuoteStr(Session["USER_FULL_NAME"].ToString( )) + " AND Reqtime BETWEEN " + Mgr.QuoteStr(BeginTime.Text) + " AND ";
        s += " dateadd(day,2," + Mgr.QuoteStr(EndTime.Text) + ") " + " AND ReqState = " + cbx_type.SelectedValue.ToString( );
        s += " ORDER BY Reqtime";
        DBBase    db = new DBBase( );
        DataTable tb = new DataTable( );

        tb = db.SqlOpen(s);
        ReqDataView.DataSource = tb;
        ReqDataView.DataBind( );
    }
Ejemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Mgr.CheckLogin(this);
 }