Exemple #1
0
 //关闭统计数据维护
 protected void Senior_DetailCLOSE_Click(object sender, EventArgs e)
 {
     Panel1.Visible = false;
     this.UpdatePanel1.Update();
     Panel_Name.Visible = false;
     this.UpdatePanel_Name.Update();
     Senior_DetailOPEN.Visible  = true;
     Senior_DetailCLOSE.Visible = false;
     Panel_Grid.Visible         = true;
     UpdatePanel_Grid.Update();
     panelGraph.Visible = false;
     UpdatepanelGraph.Update();
 }
Exemple #2
0
 //打开统计数据维护
 protected void Senior_DetailOPEN_Click(object sender, EventArgs e)
 {
     Panel_Grid.Visible = false;
     this.UpdatePanel_Grid.Update();
     Senior_DetailOPEN.Visible  = false;
     Senior_DetailCLOSE.Visible = true;
     Panel1.Visible             = true;
     UpdatePanel1.Update();
     BindGridView1(" and EN_OperationTime is not null and EN_Limit is not null and EN_OperationTime!=-1 and EN_Limit!=-1");
     UpdatePanel_Search.Update();
     panelGraph.Visible = false;
     UpdatepanelGraph.Update();
 }
Exemple #3
0
 //重置按钮
 protected void BtnReset_Click(object sender, EventArgs e)
 {
     Senior_DetailOPEN.Visible  = true;
     Senior_DetailCLOSE.Visible = false;
     Panel_Grid.Visible         = true;
     UpdatePanel_Grid.Update();
     Panel1.Visible = false;
     UpdatePanel1.Update();
     Panel_Name.Visible = false;
     UpdatePanel_Name.Update();
     textname.Text = "";
     UpdatePanel_Grid.Update();
     panelGraph.Visible = false;
     UpdatepanelGraph.Update();
 }
Exemple #4
0
    //检索按钮
    protected void BtnSearch_Click(object sender, EventArgs e)
    {
        Senior_DetailOPEN.Visible  = true;
        Senior_DetailCLOSE.Visible = false;
        Panel_Grid.Visible         = true;
        UpdatePanel_Grid.Update();
        Panel1.Visible = false;
        UpdatePanel1.Update();
        Panel_Name.Visible = false;
        UpdatePanel_Name.Update();
        panelGraph.Visible = false;
        UpdatepanelGraph.Update();
        if (this.textyear.Text.ToString() == "" || this.textyear.Text.ToString().Length != 4)
        {
            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填入正确的年份!')", true);
            return;
        }
        string condition = GetCondition();
        string year      = textyear.Text.Trim().ToString();

        BindGrid_Detail(condition, year);
        UpdatePanel_Grid.Update();
    }
Exemple #5
0
    protected void Grid_Detail_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Gra")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_Detail.SelectedIndex = row.RowIndex;

            //panelGraph.Visible = true;
            //DataSet ds = sd.S_Equiptrend("and EN_EquipName='" + e.CommandArgument + "'",textyear.Text.Trim());
            //ds.Tables[0].Select();
            //Chart1.DataSource = ds.Tables[0].Select();
            //Chart1.Titles[0].Text = e.CommandArgument + "维修率和停机率趋势图";

            ////设置图表Y轴对应项
            //Chart1.Series[0].YValueMembers = "出站数";
            //Chart1.Series[1].YValueMembers = "合格率";

            ////设置图表X轴对应项
            //Chart1.Series[0].XValueMember = "月份";
            //Chart1.Series[1].XValueMember = "月份";

            //Chart1.Series[1].Points.AddXY("一月","Grid_Detail.Rows[row.RowIndex].Cells[1].Text.ToString()");//试试
            //绑定数据
            //Chart1.DataBind();

            //Create a DataTable as the data source of the Chart control
            DataTable dt = new DataTable();

            //Add three columns to the DataTable
            dt.Columns.Add("Date");
            dt.Columns.Add("Volume1");
            dt.Columns.Add("Volume2");

            DataRow dr;
            dr            = dt.NewRow();
            dr["Date"]    = "一月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[3].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[4].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "二月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[5].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[6].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "三月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[7].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[8].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "四月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[9].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[10].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "五月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[11].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[12].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "六月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[13].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[14].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "七月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[15].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[16].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "八月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[17].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[18].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "九月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[19].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[20].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "十月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[21].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[22].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "十一月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[23].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[24].Text.ToString();
            dt.Rows.Add(dr);

            dr            = dt.NewRow();
            dr["Date"]    = "十二月";
            dr["Volume1"] = Grid_Detail.Rows[row.RowIndex].Cells[25].Text.ToString();
            dr["Volume2"] = Grid_Detail.Rows[row.RowIndex].Cells[26].Text.ToString();
            dt.Rows.Add(dr);

            //设置图表的数据源
            Chart1.DataSource     = dt;
            Chart1.Titles[0].Text = e.CommandArgument + "—维修率和停机率趋势图";

            //设置图表Y轴对应项
            Chart1.Series[0].YValueMembers = "Volume1";
            Chart1.Series[1].YValueMembers = "Volume2";

            //设置图表X轴对应项
            Chart1.Series[0].XValueMember = "Date";
            Chart1.Series[1].XValueMember = "Date";

            //绑定数据
            Chart1.DataBind();

            panelGraph.Visible = true;
            UpdatepanelGraph.Update();
        }
    }