Esempio n. 1
0
    protected void loadPIDetails()
    {
        int       KPI_ID = 0;
        DataTable dtKPI  = objKPI.GetGoal(0, "KPI030", 0);

        if (dtKPI.Rows[0]["KPI_ID"] != null)
        {
            KPI_ID = Convert.ToInt32(dtKPI.Rows[0]["KPI_ID"]);
        }

        DataSet   ds      = BLL_TMSA_PI.Get_KPI_Detail(KPI_ID);
        DataTable dt      = new DataTable();
        DataTable dtPIDtl = ds.Tables[1];

        dt.Columns.Add(new DataColumn("sno", typeof(int)));
        dt.Columns.Add(new DataColumn("PID", typeof(string)));
        dt.Columns.Add(new DataColumn("value", typeof(string)));
        dt.Columns.Add(new DataColumn("PIName", typeof(string)));
        string exp = "";

        if (dtPIDtl.Rows.Count > 0)
        {
            foreach (DataRow row in dtPIDtl.Rows)
            {
                dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                exp = exp + row["value"].ToString();
            }
            lblFormula.Text = "KPI Formula : " + exp;
            DataTable dt_PI = dt;
            dt_PI.DefaultView.RowFilter = "PID <> ''";
            DataList1.DataSource        = dt_PI.DefaultView;
            DataList1.DataBind();
        }
    }
Esempio n. 2
0
    protected void loadPIDetails()
    {
        DataSet ds = BLL_TMSA_PI.Get_KPI_Detail(UDFLib.ConvertIntegerToNull(hiddenKPIID.Value));

        if (ds.Tables[0].Rows.Count > 0)
        {
            ltKPI.Text          = ds.Tables[0].Rows[0]["Name"].ToString();
            hiddenKPIName.Value = ds.Tables[0].Rows[0]["Name"].ToString();
            DataTable dt      = new DataTable();
            DataTable dtPIDtl = ds.Tables[1];
            dt.Columns.Add(new DataColumn("sno", typeof(int)));
            dt.Columns.Add(new DataColumn("PID", typeof(string)));
            dt.Columns.Add(new DataColumn("value", typeof(string)));
            dt.Columns.Add(new DataColumn("PIName", typeof(string)));
            string exp = "";
            foreach (DataRow row in dtPIDtl.Rows)
            {
                dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                exp = exp + row["value"].ToString();
            }
            lblFormula.Text = "KPI Formula : " + exp;
            DataTable dt_PI = dt;
            dt_PI.DefaultView.RowFilter = "PID <> ''";
            DataList1.DataSource        = dt_PI.DefaultView;
            DataList1.DataBind();
        }
    }
Esempio n. 3
0
    private void loadFormula()
    {
        DataSet ds = BLL_TMSA_PI.Get_KPI_Detail(UDFLib.ConvertIntegerToNull(hiddenKPIID.Value));

        DataTable dtPIDtl = ds.Tables[1];

        string exp = "";

        foreach (DataRow row in dtPIDtl.Rows)
        {
            exp = exp + row["value"].ToString();
        }
        lblFormula.Text = "KPI Formula : " + exp;
        loadPIDetails();
    }
Esempio n. 4
0
    private void BindDetails()
    {
        DataTable dt = BLL_TMSA_PI.Get_KPI_Detail(UDFLib.ConvertIntegerToNull(ViewState["KPI_ID"])).Tables[0];

        if (dt.Rows.Count > 0)
        {
            DataRow dr = dt.Rows[0];
            if (dr["Interval"] != null)
            {
                ddlIntervalUnit.SelectedValue = dr["Interval"].ToString();
            }
            txtItemDescription.Text = dr["Description"].ToString();
            txtPIName.Text          = dr["Name"].ToString();
            txtPICode.Text          = dr["Code"].ToString();
        }
        BindPI();
    }
    private void loadFormula()
    {
        DataTable dtKPI  = objKPI.GetGoal(0, "KPI030", 0);
        string    KPI_ID = dtKPI.Rows[0]["KPI_ID"].ToString();

        hdnKPIID.Value = KPI_ID;
        DataSet   ds      = BLL_TMSA_PI.Get_KPI_Detail(UDFLib.ConvertIntegerToNull(KPI_ID));
        DataTable dtPIDtl = ds.Tables[1];
        string    exp     = "";

        foreach (DataRow row in dtPIDtl.Rows)
        {
            exp = exp + row["value"].ToString();
        }
        lblFormula.Text = "KPI Formula : " + exp;
        loadPIDetails();
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserAccessValidation();
        if (!IsPostBack)
        {
            BindCategory();
            BindInterval();
            ddlOperator.SelectedValue = "0";
            txtNumber.Text            = "";
            LoadQueryList();
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("sno", typeof(int)));
            dt.Columns.Add(new DataColumn("PID", typeof(string)));
            dt.Columns.Add(new DataColumn("value", typeof(string)));
            dt.Columns.Add(new DataColumn("PIName", typeof(string)));

            // dt.PrimaryKey = new DataColumn[] { dt.Columns["sno"] };

            hdnKPIID.Value = Request.QueryString["KPI_ID"];//21
            if (hdnKPIID.Value == "0")
            {
                lblCode1.Visible = false;
                //  lblCode2.Visible = false;
                lblCode3.Visible    = false;
                lblFormula1.Visible = false;
                //  lblFormula2.Visible = false;
                lblFormula3.Visible = false;
            }
            else
            {
                DataSet   ds      = BLL_TMSA_PI.Get_KPI_Detail(UDFLib.ConvertIntegerToNull(hdnKPIID.Value));
                DataTable dtDtl   = ds.Tables[0];
                DataTable dtPIDtl = ds.Tables[1];

                txtKPIName.Text    = dtDtl.Rows[0]["Name"].ToString();
                txtKPIDesc.Text    = dtDtl.Rows[0]["Description"].ToString();
                txtTimePeriod.Text = dtDtl.Rows[0]["Time_Period"].ToString();
                txtMeasure.Text    = dtDtl.Rows[0]["Measurement_Detail"].ToString();
                txtURL.Text        = dtDtl.Rows[0]["URL"].ToString();
                lblCode3.Text      = dtDtl.Rows[0]["Code"].ToString();

                if (ddlCategory.Items.FindByValue(dtDtl.Rows[0]["Category"].ToString()) != null)
                {
                    ddlCategory.SelectedValue = dtDtl.Rows[0]["Category"].ToString() != "" ? dtDtl.Rows[0]["Category"].ToString() : "0";
                }
                else
                {
                    ddlCategory.SelectedValue = "0";
                }

                //if (ddlListSource.Items.FindByValue(dtDtl.Rows[0]["DataSource"].ToString()) != null)
                //    ddlListSource.SelectedValue = dtDtl.Rows[0]["DataSource"].ToString() != "" ? dtDtl.Rows[0]["DataSource"].ToString() : "0";
                //else
                //    ddlListSource.SelectedValue = "0";


                //  ddlCategory.SelectedValue = dtDtl.Rows[0]["Category"].ToString();
                if (ddlInterval.Items.FindByValue(dtDtl.Rows[0]["Interval"].ToString()) != null)
                {
                    ddlInterval.SelectedValue = dtDtl.Rows[0]["Interval"].ToString() != "" ? dtDtl.Rows[0]["Interval"].ToString() : "0";
                }
                else
                {
                    ddlInterval.SelectedValue = "0";
                }

                if (ddlStatus.Items.FindByValue(dtDtl.Rows[0]["KPI_Status"].ToString()) != null)
                {
                    ddlStatus.SelectedValue = dtDtl.Rows[0]["KPI_Status"].ToString() != "" ? dtDtl.Rows[0]["KPI_Status"].ToString() : "2";
                }
                else
                {
                    ddlStatus.SelectedValue = "2";
                }

                if (ddlKPIApplicableFor.Items.FindByValue(dtDtl.Rows[0]["KPI_ApplicableFor"].ToString()) != null)   //Added to display the preselected value from database.
                {
                    ddlKPIApplicableFor.SelectedValue = dtDtl.Rows[0]["KPI_ApplicableFor"].ToString() != "" ? dtDtl.Rows[0]["KPI_ApplicableFor"].ToString() : "0";
                }

                else
                {
                    ddlKPIApplicableFor.SelectedValue = "2";
                }


                string exp = "";
                foreach (DataRow row in dtPIDtl.Rows)
                {
                    dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                    exp = exp + row["value"].ToString();
                }
                lblFormula3.Text      = exp;
                dtlFormula.DataSource = dt;
                dtlFormula.DataBind();

                DataTable dt_PI = dt;
                dt_PI.DefaultView.RowFilter = "PID <> ''";
                DataList1.DataSource        = dt_PI.DefaultView;
                DataList1.DataBind();
            }
            ViewState["dtFormula"] = dt;
            Bind_PI(ddlInterval.SelectedValue);
        }
    }
Esempio n. 7
0
    /// <summary>
    /// Method to load PIs for PMS overdue KPI and display formula
    /// </summary>

    protected void loadPIDetails()
    {
        try
        {
            int KPI_ID1 = Convert.ToInt16(hdnKPI1.Value);
            int KPI_ID2 = Convert.ToInt16(hdnKPI2.Value);
            int KPI_ID3 = Convert.ToInt16(hdnKPI3.Value);

            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("sno", typeof(int)));
            dt.Columns.Add(new DataColumn("PID", typeof(string)));
            dt.Columns.Add(new DataColumn("value", typeof(string)));
            dt.Columns.Add(new DataColumn("PIName", typeof(string)));

            DataSet ds = BLL_TMSA_PI.Get_KPI_Detail(KPI_ID1);

            DataTable dtPIDtl = ds.Tables[1];
            string    exp     = "";
            if (dtPIDtl.Rows.Count > 0)
            {
                foreach (DataRow row in dtPIDtl.Rows)
                {
                    dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                    exp = exp + row["value"].ToString();
                }
                lblFormula.Text = "Non Critical Rate: " + exp;
                DataTable dt_PI1 = dt;
                dt_PI1.DefaultView.RowFilter = "PID <> ''";
                dt_PI1.DefaultView.Sort      = "PID asc";
                DataList1.DataSource         = dt_PI1.DefaultView;
                DataList1.DataBind();
            }


            ds.Clear();
            dt.Clear();
            dtPIDtl.Clear();

            ds = BLL_TMSA_PI.Get_KPI_Detail(KPI_ID2);

            dtPIDtl = ds.Tables[1];
            exp     = "";
            if (dtPIDtl.Rows.Count > 0)
            {
                foreach (DataRow row in dtPIDtl.Rows)
                {
                    dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                    exp = exp + row["value"].ToString();
                }
                lblFormula2.Text = "Critical Rate: " + exp;
                DataTable dt_PI1 = dt;
                dt_PI1.DefaultView.RowFilter = "PID <> ''";
                dt_PI1.DefaultView.Sort      = "PID asc";
                DataList2.DataSource         = dt_PI1.DefaultView;
                DataList2.DataBind();
            }



            ds.Clear();
            dt.Clear();
            dtPIDtl.Clear();
            ds = BLL_TMSA_PI.Get_KPI_Detail(KPI_ID3);

            dtPIDtl = ds.Tables[1];
            exp     = "";
            if (dtPIDtl.Rows.Count > 0)
            {
                foreach (DataRow row in dtPIDtl.Rows)
                {
                    dt.Rows.Add(new object[] { Convert.ToInt32(row["SerialNumber"].ToString()), row["PI_ID"].ToString(), row["value"].ToString(), row["Name"].ToString() });
                    exp = exp + row["value"].ToString();
                }
                lblFormula3.Text = "KPI030 Formula : " + exp;
                DataTable dt_PI1 = dt;
                dt_PI1.DefaultView.RowFilter = "PID <> ''";
                dt_PI1.DefaultView.Sort      = "PID asc";
                DataList3.DataSource         = dt_PI1.DefaultView;
                DataList3.DataBind();
            }
        }

        catch (Exception ex)
        {
            //UDFLib.WriteExceptionLog(ex);
        }
    }