Ejemplo n.º 1
0
    public override void DataBind() //¡Ô¨¡ÃÃÁ
    {
        DataView   dv, dv1;
        Connection Conn = new Connection();
        BTC        btc  = new BTC();

        string strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName, b.ProjectsCode, b.IndicatorsCode, '' As FullName "
                        + " From Activity a, Evaluation b "
                        + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode  "
                        + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                        + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' ";

        if (ddlSearchDept.SelectedIndex != 0)
        {
            strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName, b.ProjectsCode, b.IndicatorsCode, '' As FullName "
                     + " From Activity a, Evaluation b, dtAcDept c "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode  "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                     + " And c.DeptCode = '" + ddlSearchDept.SelectedValue + "' ";
        }
        if (ddlSearchEmp.SelectedIndex != 0)
        {
            strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName, b.ProjectsCode, b.IndicatorsCode, '' As FullName "
                     + " From Activity a, Evaluation b, dtAcEmp c "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode  "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                     + " And c.EmpCode = '" + ddlSearchEmp.SelectedValue + "' ";
        }
        dv = Conn.Select(strSql + " Group By a.ActivityCode, a.ActivityName, a.Sort, b.ProjectsCode, b.IndicatorsCode Order By a.Sort");

        for (int j = 0; j < dv.Count; j++)
        {
            dv[j]["DeptName"] = btc.getAcDeptName(dv[j]["ActivityCode"].ToString());
        }

        double CkAPercent;
        string strColor;
        string strEva = "";

        for (int i = 0; i < dv.Count; i++)
        {
            strSql = " Select a.ActivityCode "
                     + " From Activity a, Evaluation b "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' ";
            if (ddlSearchDept.SelectedIndex != 0)
            {
                strSql = " Select a.ActivityCode "
                         + " From Activity a, Evaluation b, dtAcDept c "
                         + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode "
                         + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                         + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                         + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                         + " And c.DeptCode = '" + ddlSearchDept.SelectedValue + "' ";
            }
            if (ddlSearchEmp.SelectedIndex != 0)
            {
                strSql = " Select a.ActivityCode "
                         + " From Activity a, Evaluation b, dtAcEmp c "
                         + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode "
                         + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                         + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                         + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                         + " And c.EmpCode = '" + ddlSearchEmp.SelectedValue + "' ";
            }
            dv1 = Conn.Select(strSql);

            CkAPercent = (Convert.ToDouble(dv[i]["CkAPercent"]) * 100) / (Convert.ToDouble(dv1.Count) * 100);

            if (CkAPercent < 50)
            {
                strColor = "Red";//"#f87373";
                strEva   = "(äÁè¼èÒ¹)";
            }
            else
            {
                strColor = "#0B610B";
                strEva   = "(¼èÒ¹)";
            }

            dv[i]["FullName"] = string.Format("<img onclick=\"getPopUpActivity('{5}')\" src=\"../Image/icon/" + ((CkAPercent >= 50) ? "ballg" : "ballr") + ".png\" style=\"border:none;width:32px;height:35px;\"/>&nbsp;&nbsp;<span onclick=\"GoToIndicators2('{5}', '{6}', '{7}');\" style=\"color:" + ((rbtlView1.Checked) ? "#6E6E6E" : strColor) + ";font-size:" + btc.fontView2 + "pt;font-weight:bold;width:630px;overflow:hidden;\" title=\"{4}\">{0}</span><span style=\"width:100px; text-align:right ;float:right; margin:20px 20px 0 0;color:" + strColor + ";font-size:" + btc.fontView2 + "pt; font-weight:bold;\">{2}</span><span style=\"width:50px; text-align:right; float:Right; padding:20px 55px 0 0; color:" + strColor + "; font-size:" + btc.fontView2 + "pt; font-weight:bold;\">{1}</span><span style=\"float:right; width:120px; padding:20px 45px 0 0; color:" + strColor + "; font-size:" + btc.fontView2 + "pt; text-align:right; font-weight:bold;\">{3}%</span><p style=\"clear:both; float:none;\"></p><hr />", (dv[i]["ActivityName"].ToString().Length > btc.strCut4 ? dv[i]["ActivityName"].ToString().Substring(0, btc.strCut4) + "..." : dv[i]["ActivityName"]), "", strEva, " " + CkAPercent.ToString("#,##0.00") + " ", dv[i]["DeptName"], dv[i]["ActivityCode"].ToString(), Request.QueryString["pjid"], Request.QueryString["idtid"]);
            //tNodeActivity.Text = string.Format("<img src=\"../Image/icon/" + ((CkAPercent >= 50) ? "icon5g" : "icon5r") + ".png\" style=\"float:left;border:none;padding:0 0 0 35px;\"/>&nbsp;&nbsp;<span title=\"˹èǧҹ : {3}\" style=\"font-size:11pt;color:" + ((rbtlView1.Checked) ? "#6E6E6E" : strColor) + ";\">{0}</span>&nbsp;&nbsp;&nbsp;<span style=\"font-size:12pt;color:" + strColor + ";\">{2}%</span>&nbsp;&nbsp;&nbsp;<span style=\"font-size:12pt;color:" + strColor + ";\">{1}</span>", dv[i]["ActivityName"].ToString(), strEva, CkAPercent.ToString("#,##0.00"), dv[i]["DeptName"].ToString());

            Repeater1.DataSource = dv;
            Repeater1.DataBind();
        }
    }
Ejemplo n.º 2
0
    private void getActivity() //¡Ô¨¡ÃÃÁ
    {
        DataView   dv, dv1;
        Connection Conn = new Connection();
        BTC        btc  = new BTC();

        string strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName "
                        + " From Activity a, Evaluation b "
                        + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode  "
                        + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                        + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' ";

        if (ddlSearchDept.SelectedIndex != 0)
        {
            strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName "
                     + " From Activity a, Evaluation b, dtAcDept c "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode  "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                     + " And c.DeptCode = '" + ddlSearchDept.SelectedValue + "' ";
        }
        if (ddlSearchEmp.SelectedIndex != 0)
        {
            strSql = " Select a.ActivityCode, '¡Ô¨¡ÃÃÁ - ' + a.ActivityName ActivityName, a.Sort, Sum(b.APercent) CkAPercent, '' DeptName "
                     + " From Activity a, Evaluation b, dtAcEmp c "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode  "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                     + " And c.EmpCode = '" + ddlSearchEmp.SelectedValue + "' ";
        }
        dv = Conn.Select(strSql + " Group By a.ActivityCode, a.ActivityName, a.Sort Order By a.Sort ");

        for (int j = 0; j < dv.Count; j++)
        {
            dv[j]["DeptName"] = btc.getAcDeptName(dv[j]["ActivityCode"].ToString());
        }

        double CkAPercent;
        string strColor;
        string strEva = "";

        for (int i = 0; i < dv.Count; i++)
        {
            strSql = " Select a.ActivityCode "
                     + " From Activity a, Evaluation b "
                     + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode "
                     + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                     + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                     + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' ";
            if (ddlSearchDept.SelectedIndex != 0)
            {
                strSql = " Select a.ActivityCode "
                         + " From Activity a, Evaluation b, dtAcDept c "
                         + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode "
                         + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                         + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                         + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                         + " And c.DeptCode = '" + ddlSearchDept.SelectedValue + "' ";
            }
            if (ddlSearchEmp.SelectedIndex != 0)
            {
                strSql = " Select a.ActivityCode "
                         + " From Activity a, Evaluation b, dtAcEmp c "
                         + " Where a.DelFlag = 0 And b.DelFlag = 0 And a.ActivityCode = b.ActivityCode And a.ActivityCode = c.ActivityCode "
                         + " And b.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And a.ProjectsCode = '" + Request.QueryString["pjid"] + "' "
                         + " And b.ActivityCode = '" + dv[i]["ActivityCode"].ToString() + "' "
                         + " And b.StudyYear = '" + ddlYearB.SelectedValue + "' And b.SchoolID = '" + CurrentUser.SchoolID + "' "
                         + " And c.EmpCode = '" + ddlSearchEmp.SelectedValue + "' ";
            }
            dv1 = Conn.Select(strSql);

            CkAPercent = (Convert.ToDouble(dv[i]["CkAPercent"]) * 100) / (Convert.ToDouble(dv1.Count) * 100);

            if (CkAPercent < 50)
            {
                strColor = "Red";//"#f87373";
                strEva   = "(äÁè¼èÒ¹)";
            }
            else
            {
                strColor = "#0B610B";
                strEva   = "(¼èÒ¹)";
            }

            lblSummarize.Text = string.Format("<img src=\"../Image/icon/" + ((CkAPercent >= 50) ? "ballg" : "ballr") + ".png\" style=\"border:none;width:36px;height:39px;\"/>&nbsp;&nbsp;<span onclick=\"getPopUpActivity('{5}')\" style=\"cursor:pointer; color:" + ((rbtlView1.Checked) ? "#6E6E6E" : strColor) + ";font-size:" + btc.fontView1 + "pt;font-weight:bold;width:630px;overflow:hidden;\" title=\"{4}\">{0}</span><span style=\"width:120px; text-align:right ;float:right; margin:20px 20px 0 0;color:" + strColor + ";font-size:" + btc.fontView1 + "pt; font-weight:bold;\">{2}</span><span style=\"width:50px; text-align:right; float:Right; padding:20px 55px 0 0; color:" + strColor + "; font-size:" + btc.fontView1 + "pt; font-weight:bold;\">{1}</span><span style=\"float:right; width:140px; padding:20px 25px 0 0; color:" + strColor + "; font-size:" + btc.fontView1 + "pt; text-align:right; font-weight:bold;\">{3}%</span><p style=\"clear:both; float:none;\"></p><hr />", (dv[i]["ActivityName"].ToString().Length > btc.strCut4 ? dv[i]["ActivityName"].ToString().Substring(0, btc.strCut4) + "..." : dv[i]["ActivityName"]), "", strEva, " " + CkAPercent.ToString("#,##0.00") + " ", dv[i]["DeptName"], dv[i]["ActivityCode"].ToString());

            DataView dvHead = Conn.Select("Select Top 1 a.SideCode, a.SideName, b.StandardCode, 'Áҵðҹ·Õè ' + Cast(b.Sort As nVarChar) As StandardName, c.IndicatorsCode, 'µÑǺ觪Õé·Õè ' + Cast(b.Sort As nVarChar) + '.' + Cast(c.Sort As nVarChar) As IndicatorsName, d.ProjectsCode, d.ProjectsName, f.ActivityCode, f.ActivityName From Side a, Standard b, Indicators c, Projects d, Activity f, Evaluation e Where a.SideCode = b.SideCode And b.StandardCode = c.StandardCode And d.ProjectsCode = e.ProjectsCode And e.IndicatorsCode = c.IndicatorsCode And d.ProjectsCode = f.ProjectsCode And c.IndicatorsCode = '" + Request.QueryString["idtid"] + "' And e.ProjectsCode = '" + Request.QueryString["pjid"] + "' And f.ActivityCode = '" + Request.QueryString["acid"] + "'");
            Repeater2.DataSource = dvHead;
            Repeater2.DataBind();
        }
    }