MeetingWait.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:4k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Web.UI.HtmlControls;
  12. public partial class General_MeetingWait : System.Web.UI.Page
  13. {
  14.     /// <summary>
  15.     /// 模板 
  16.     /// </summary>
  17.     Model.MeetingRun MC = new Model.MeetingRun();
  18.     /// <summary>
  19.     /// 业务
  20.     /// </summary>
  21.     BLL.MeetingRun BC = new BLL.MeetingRun();
  22.     /// <summary>
  23.     /// 查询条件
  24.     /// </summary>
  25.     public string TiaoJian
  26.     {
  27.         get
  28.         {
  29.             if (ViewState["UseThingsTiaoJian"] == null)
  30.             {
  31.                 return "";
  32.             }
  33.             else
  34.             {
  35.                 return ViewState["UseThingsTiaoJian"].ToString();
  36.             }
  37.         }
  38.         set { ViewState["UseThingsTiaoJian"] = value; }
  39.     }
  40.     protected void Page_Load(object sender, EventArgs e)
  41.     {
  42.         LoginLogic.MatchLoad("../", "General_MeetingWait");
  43.         if (!IsPostBack)
  44.         {
  45.             TiaoJian = "PZZT = '" + States.SupplyState_Wait + "'";
  46.             object objid = Request.QueryString["id"];
  47.             if (objid != null)
  48.             {
  49.                 int ri = int.Parse(objid.ToString());
  50.                 TiaoJian += " and HYS = '" + ri.ToString() + "' and convert(varchar(10),KSSJ,120) = '" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
  51.             }
  52.             MyDataBind(1);
  53.         }
  54.     }
  55.     /// <summary>
  56.     /// 获取信息
  57.     /// </summary>
  58.     /// <param name="pidx">页号</param>
  59.     public void MyDataBind(int pidx)
  60.     {
  61.         AspNetPager1.RecordCount = BC.GetCount(TiaoJian);
  62.         bool b_sort = false;
  63.         if (Request.QueryString["id"] != null)
  64.         {
  65.             b_sort = true;
  66.         }
  67.         List<Model.MeetingRun> LRData = BC.GetPageList(20, pidx, "KSSJ", b_sort, TiaoJian);
  68.         if (LRData.Count == 0)
  69.         {
  70.             Model.MeetingRun MC = new Model.MeetingRun();
  71.             LRData.Add(MC);
  72.         }
  73.         GridView1.DataSource = LRData;
  74.         GridView1.DataBind();
  75.     }
  76.     /// <summary>
  77.     /// 车辆类型
  78.     /// </summary>
  79.     /// <returns></returns>
  80.     public string HYS()
  81.     {
  82.         int id = 0;
  83.         if (BC.GetCount(TiaoJian) > 0)
  84.         {
  85.             id = int.Parse(Eval("HYS").ToString());
  86.         }
  87.         return EnumGet.GetMeetingRoomsName(id);
  88.     }
  89.     /// <summary>
  90.     /// 操作
  91.     /// </summary>
  92.     /// <returns></returns>
  93.     public string CaoZuo()
  94.     {
  95.         string Rtstr = "";
  96.         if (BC.GetCount(TiaoJian) > 0)
  97.         {
  98.             string Id = Eval("Id").ToString();
  99.             Rtstr = "<a href='" + "MeetingDetail.aspx?id=" + Id + "'>详细信息</a>&nbsp;&nbsp;";
  100.         }
  101.         else
  102.         {
  103.             Rtstr = "还没有待批的会议室!";
  104.         }
  105.         return Rtstr;
  106.     }
  107.     protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
  108.     {
  109.         MyDataBind(e.NewPageIndex);
  110.     }
  111.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  112.     {
  113.         for (int i = 0; i < GridView1.Rows.Count; i++)
  114.         {
  115.             //首先判断是否是数据行
  116.             if (e.Row.RowType == DataControlRowType.DataRow)
  117.             {
  118.                 //当鼠标停留时更改背景色
  119.                 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
  120.                 //当鼠标移开时还原背景色
  121.                 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
  122.             }
  123.         }
  124.     }
  125. }