aaaa.aspx.cs
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Collections.Generic;
  12. using COM.OA.Entity;
  13. using COM.OA.BLL;
  14. public partial class wc_rlzy_aaaa : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.          users loginuser =Session["loginuser"] as COM.OA.Entity.users;
  19.          if (loginuser == null)
  20.          {
  21.              this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
  22.          }
  23.          else
  24.          {
  25.              //通过登录人ID查询  
  26.              //1 已经有 今天考勤不能继续添加 否则 可添加
  27.              int id = loginuser.u_id;
  28.              string where = "att_u_id=" + id;
  29.              IList<attendance> ilist = attendanceBLL.Select(where);
  30.              if (ilist.Count == 0)//没数据 跳转传2
  31.              {
  32.                  this.Response.Write(string.Format(GetRedirect.REDIRECT, "rlzy_zxkq.aspx?at=2"));
  33.              }
  34.              else
  35.              {
  36.                  List<attendance> list = (List<attendance>)ilist;
  37.                  attendance at = new attendance();
  38.                  at = list[0];
  39.                  string time = DateTime.Now.ToString("yyyy-MM-dd");
  40.                  string t = at.att_date.ToString("yyyy-MM-dd");
  41.                  if (time.Equals(t))//如果最后一条记录日期与今天相同 跳转传1
  42.                  {
  43.                      this.Response.Write(string.Format(GetRedirect.REDIRECT, "rlzy_zxkq.aspx?at=1"));
  44.                  }
  45.                  else//如果最后一条记录日期与今天不相同 跳转传2
  46.                  {
  47.                      this.Response.Write(string.Format(GetRedirect.REDIRECT, "rlzy_zxkq.aspx?at=2"));
  48.                  }
  49.              }
  50.          }
  51.     }
  52. }