Beispiel #1
0
        protected void 二级单位_SelectedIndexChanged(object sender, EventArgs e)
        {
            //string 起始日期 = "";
            //string 截止日期 = "";
            //try
            //{
            //    起始日期 = DatePicker1.SelectedDate.Value.ToString("yyyy-MM-dd");
            //    截止日期 = DatePicker2.SelectedDate.Value.ToString("yyyy-MM-dd");
            //}
            //catch (Exception)
            //{
            //    起始日期 = "";
            //    截止日期 = "";

            //}
            int ID   = Convert.ToInt32(二级单位.SelectedValue);
            int year = 0;

            if (年份.SelectedText == "" || 年份.SelectedText == null)
            {
                DateTime dt = DateTime.Now;
                year = dt.Year;
            }
            else
            {
                year = int.Parse(年份.SelectedText);
            }
            //GridGZ.DataSource = gzbll.按各单位查询设备故障(0, "", "", "", dt.Year, GridGZ.PageIndex, GridGZ.PageSize);
            GridGZ.RecordCount = gzbll.查询设备故障总数(ID, ttbSearch.Text, year);
            GridGZ.DataSource  = gzbll.各单位查询设备故障(ID, ttbSearch.Text, year, GridGZ.PageIndex, GridGZ.PageSize);
            GridGZ.DataBind();
        }
Beispiel #2
0
        private void BindGrid()
        {
            // 1.设置总项数(特别注意:数据库分页一定要设置总记录数RecordCount)

            DateTime dt = DateTime.Now;

            GridGZ.RecordCount = gzbll.查询设备故障总数(0, "", dt.Year);
            GridGZ.DataSource  = gzbll.各单位查询设备故障(0, "", dt.Year, GridGZ.PageIndex, GridGZ.PageSize);
            GridGZ.DataBind();
        }
Beispiel #3
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView row = e.DataItem as DataRowView;


            string     yen  = row["完成情况"].ToString();
            BoundField cyen = GridGZ.FindColumn("完成情况") as BoundField;

            if (yen == "正在进行")
            {
                e.CellAttributes[cyen.ColumnIndex]["data-color"] = "color3";
            }
            else if (yen == "完成")
            {
                e.CellAttributes[cyen.ColumnIndex]["data-color"] = "color2";
            }
        }
Beispiel #4
0
        protected void SelectContentBtn_Click(object sender, EventArgs e)
        {
            //string 起始日期 = "";
            //string 截止日期 = "";
            //try
            //{
            //    起始日期 = DatePicker1.SelectedDate.Value.ToString("yyyy-MM-dd");
            //    截止日期 = DatePicker2.SelectedDate.Value.ToString("yyyy-MM-dd");
            //    DateTime dt1 = Convert.ToDateTime(起始日期);
            //    DateTime dt2 = Convert.ToDateTime(截止日期);
            //    if (dt2 < dt1)
            //    {
            //        Alert.ShowInTop("截止日期不能小于起始日期!", MessageBoxIcon.Error);
            //        return;
            //    }
            //}
            //catch (Exception)
            //{
            //    起始日期 = "";
            //    截止日期 = "";

            //}
            int year = 0;

            if (年份.SelectedText == "")
            {
                DateTime dt = DateTime.Now;
                year = dt.Year;
            }
            else
            {
                year = int.Parse(年份.SelectedText);
            }
            int ID = Convert.ToInt32(二级单位.SelectedValue);

            GridGZ.RecordCount = gzbll.查询设备故障总数(ID, ttbSearch.Text, year);
            GridGZ.DataSource  = gzbll.各单位查询设备故障(ID, ttbSearch.Text, year, GridGZ.PageIndex, GridGZ.PageSize);

            GridGZ.DataBind();
        }
Beispiel #5
0
        protected void GridGZ_PageIndexChange(object sender, GridPageEventArgs e)
        {
            int ID = Convert.ToInt32(二级单位.SelectedValue);
            //DateTime dt = DateTime.Now;
            int year = 0;

            if (年份.SelectedText == "" || 年份.SelectedText == null)
            {
                DateTime dt = DateTime.Now;
                year = dt.Year;
            }
            else
            {
                year = int.Parse(年份.SelectedText);
            }

            GridGZ.RecordCount = gzbll.查询设备故障总数(ID, ttbSearch.Text, year);
            GridGZ.DataSource  = gzbll.各单位查询设备故障(ID, "", year, GridGZ.PageIndex, GridGZ.PageSize - 1);
            // 3.绑定到Grid
            //GridGZ.DataSource = table;
            GridGZ.DataBind();
        }