Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //指标信息
                if (Request.QueryString["webcode"] != null)
                {
                    WebCode = Request.QueryString["webcode"].ToString();

                    lblInfor.Text = "报表名称: " + KPI_WebDal.GetWebDesc(WebCode);
                }
                else
                {
                    WebCode = "";
                }


                ////机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                foreach (DataRow dr in dt.Rows)
                {
                    ddlUnit.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //
                txt_ST.Value = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                txt_ET.Value = DateTime.Now.ToString("yyyy-MM-dd");

                BindValue();
            }
        }
Пример #2
0
 protected void drpPlants_SelectedIndexChanged(object sender, EventArgs e)
 {
     drpUnits.DataSource     = KPI_UnitDal.GetUnits(drpPlants.SelectedValue);
     drpUnits.DataValueField = "ID";
     drpUnits.DataTextField  = "Name";
     drpUnits.DataBind();
 }
Пример #3
0
        protected void rblRMType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (rblRMType.SelectedValue == "0")
            {
                cbxRMKPIID.Visible = false;
                ddlRMKPIID.Visible = true;
                ddlRMKPIID.Items.Clear();

                DataTable dt = KPI_UnitDal.GetUnits("");
                foreach (DataRow dr in dt.Rows)
                {
                    ddlRMKPIID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }
            }
            else if (rblRMType.SelectedValue == "1")
            {
                cbxRMKPIID.Visible = false;
                ddlRMKPIID.Visible = true;
                ddlRMKPIID.Items.Clear();

                DataTable dt = KPI_SeqDal.GetSeqs();
                foreach (DataRow dr in dt.Rows)
                {
                    ddlRMKPIID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }
            }
            else if (rblRMType.SelectedValue == "2")
            {
                cbxRMKPIID.Visible = false;
                ddlRMKPIID.Visible = true;
                ddlRMKPIID.Items.Clear();

                DataTable dt = KpiDal.GetKpis();
                foreach (DataRow dr in dt.Rows)
                {
                    ddlRMKPIID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }
            }
            else if (rblRMType.SelectedValue == "3")
            {
                cbxRMKPIID.Visible = true;
                cbxRMKPIID.Items.Clear();

                ddlRMKPIID.Visible = false;
                ddlRMKPIID.Items.Clear();

                DataTable dt = ECTagDal.GetECs();
                foreach (DataRow dr in dt.Rows)
                {
                    cbxRMKPIID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }
            }
        }
Пример #4
0
        private void BindUnits(String PlantID)
        {
            var UnitList = KPI_UnitDal.GetUnits(PlantID);

            drpUnits.DataSource     = UnitList;
            drpUnits.DataTextField  = "Name";
            drpUnits.DataValueField = "ID";
            drpUnits.DataBind();
            //drpUnits.DataSource = UnitList;
            //drpUnits.DataValueField = "ID";
            //drpUnits.DataTextField = "Name";
            //drpUnits.DataBind();
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnDelete.Attributes.Add("onclick", "return confirm('确认删除吗?');");

                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                ddl_UnitID.Items.Add(new ListItem("所有机组集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_UnitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //设备信息
                dt = KPI_SeqDal.GetSeqs();
                ddl_SeqID.Items.Add(new ListItem("所有设备集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_SeqID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //指标信息
                dt = KpiDal.GetKpis();
                ddl_KpiID.Items.Add(new ListItem("所有指标集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_KpiID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //周期集信息
                //dt = KPI_CycleDal.GetCycles();
                //ddl_CycleID.Items.Add(new ListItem("所有周期", "ALL"));
                //foreach (DataRow dr in dt.Rows)
                //{
                //    ddl_CycleID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                //}

                //实时指标信息
                dt = ECTagDal.GetECs();
                ddl_ECID.Items.Add(new ListItem("所有指标", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_ECID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                BindEC();
            }
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                ddlUnitID.Items.Add(new ListItem("所有机组集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddlUnitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                BindReal();
            }
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                ddl_UnitID.Items.Add(new ListItem("所有机组集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_UnitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //设备信息
                dt = KPI_SeqDal.GetSeqs();
                ddl_SeqID.Items.Add(new ListItem("所有设备集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_SeqID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //指标信息
                dt = KpiDal.GetKpis();
                ddl_KpiID.Items.Add(new ListItem("所有指标集", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_KpiID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //周期集信息
                //dt = KPI_CycleDal.GetCycles();
                //ddl_CycleID.Items.Add(new ListItem("所有周期", "ALL"));
                //foreach (DataRow dr in dt.Rows)
                //{
                //    ddl_CycleID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                //}

                //安全指标信息
                dt = KPI_SATagDal.GetSAs();
                ddl_SAID.Items.Add(new ListItem("所有安全指标", "ALL"));
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_SAID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                BindSA();
            }
        }
Пример #8
0
        private void ClientInitial()
        {
            DataTable Plants = KPI_PlantDal.GetDataTable();

            drpPlants.DataSource     = Plants;
            drpPlants.DataValueField = "PlantID";
            drpPlants.DataTextField  = "PlantName";
            drpPlants.DataBind();
            if (Plants.Rows.Count > 0)
            {
                String PlantID = Plants.Rows[0]["PlantID"] + "";
                drpUnits.DataSource     = KPI_UnitDal.GetUnits(PlantID);
                drpUnits.DataValueField = "ID";
                drpUnits.DataTextField  = "Name";
                drpUnits.DataBind();
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //全部指标
                rblRDType.SelectedValue = "0";

                //初始化
                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                foreach (DataRow dr in dt.Rows)
                {
                    cbxRDID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                txt_ST.Value = DateTime.Now.AddDays(-5).ToString("yyyy-MM-dd HH:mm:00");
                txt_ET.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:00");
                
                BindRD();
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnExcute.Attributes.Add("onclick", "return confirm('确认执行吗?');");

                //全部指标
                rblRMType.SelectedValue = "0";

                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                foreach (DataRow dr in dt.Rows)
                {
                    ddlRMKPIID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                txt_ST.Value = DateTime.Now.AddMonths(-1).AddDays(-10).ToString("yyyy-MM-dd HH:mm:00");
                txt_ET.Value = DateTime.Now.AddMonths(-1).AddDays(-5).ToString("yyyy-MM-dd HH:mm:00");

                BindRM();
            }
        }
Пример #11
0
        //static string PlantName = "";
        //static string ZBName = "";
        //static string PlantID = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnAdd.Attributes.Add("onclick", "setDivPos('Lay1');Lay1.style.visibility='';progress_update();");

                //btnClose.Attributes.Add("onclick", "javascript:return confirm('确认关闭吗?');");

                if (Request.QueryString["linqid"] != null)
                {
                    string LinqID = Request.QueryString["linqid"].ToString();

                    string LinqName = KPI_LinqDal.GetLinqName(LinqID);

                    //标签信息
                    lbl_Name.Text = "当前配置指标为:" + LinqName;


                    ViewState["linqid"] = LinqID;

                    //////////////////////////////////////////////

                    //机组信息
                    DataTable dt = KPI_UnitDal.GetUnits("");
                    foreach (DataRow dr in dt.Rows)
                    {
                        ddl_UnitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                    }


                    BindValues();

                    BindECs();
                }
            }
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnApply.Attributes.Add("onclick", "setDivPos('Lay1');Lay1.style.visibility='';progress_update();");

                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits("");
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_UnitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //设备信息
                dt = KPI_SeqDal.GetSeqs();
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_SeqID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //指标信息
                dt = KpiDal.GetKpis();
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_KpiID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //单位信息
                dt = EngunitDal.GetEngunits();
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_EngunitID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //周期信息
                dt = CycleDal.GetCycles();
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_CycleID.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }

                //网页集信息
                //信息在KPI_Constant表中
                dt = KPI_ConstantDal.GetECWebs();
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_ECWeb.Items.Add(new ListItem(dr["Name"].ToString(), dr["Value"].ToString()));
                }

                //判断是否新建或编辑
                if (Request.QueryString["ecid"] != null)
                {
                    ViewState["ecid"] = Request.QueryString["ecid"].ToString();

                    BindValues();
                }
                else
                {
                    //添加
                    ViewState["ecid"] = "";

                    //
                    ddl_ECIsValid.Value   = "1";
                    ddl_ECIsCalc.Value    = "1";
                    ddl_ECIsDisplay.Value = "1";
                    ddl_ECIsTotal.Value   = "1";

                    SetECCodeAndName();

                    txt_ECIndex.Value     = "100";
                    txt_ECWeight.Value    = "1";
                    txt_ECDenom.Value     = "1";
                    txt_ECCalcClass.Value = "1";
                }

                btnApply.Visible = true;
            }
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //if (Request.QueryString["title"] != null)
                //{
                //    string title = OPM_TitleDal.GetTitle(Request.QueryString["title"].ToString());
                //    if (title != "")
                //    {
                //        lblTitle.Text = title;
                //    }
                //}
                string plantid = "";
                if (Request.QueryString["plantcode"] != null)
                {
                    string plantcode = Request.QueryString["plantcode"].ToString();

                    if (plantcode != "")
                    {
                        plantid = KPI_PlantDal.GetPlantIDByCode(plantcode);
                    }
                }

                //机组信息
                DataTable dt = KPI_UnitDal.GetUnits(plantid);
                foreach (DataRow dr in dt.Rows)
                {
                    ddlUnit.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
                }


                //获得参数集合
                //unitcode,为了获得值次
                if (Request.QueryString["unitcode"] != null)
                {
                    ViewState["unitcode"] = Request.QueryString["unitcode"].ToString();
                }
                else
                {
                    ViewState["unitcode"] = "";
                }

                //页面集合
                //
                if (Request.QueryString["ecweb"] != null)
                {
                    ViewState["ecweb"] = Request.QueryString["ecweb"].ToString();
                }
                else
                {
                    ViewState["ecweb"] = "";
                }

                //
                DateTime dtST = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                DateTime dtET = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                if (dtET == dtST)
                {
                    dtST = dtST.AddMonths(-1);
                }

                txt_ST.Value = dtST.ToString("yyyy-MM-dd");
                txt_ET.Value = dtET.ToString("yyyy-MM-dd");

                BindValues();
            }
        }