/// <summary>
    /// 평가별 주기
    /// </summary>
    /// <param name="ddl"></param>
    /// <param name="est_id"></param>
    public static void BindEstTermSub(DropDownList ddl, int comp_id, string est_id, string year_yn)
    {
        Biz_TermSubEstMaps termSubEstMap = new Biz_TermSubEstMaps();
        DataSet            ds            = termSubEstMap.GetTermSubEstMap(comp_id, est_id, year_yn);

        ddl.DataTextField  = "ESTTERM_SUB_NAME";
        ddl.DataValueField = "ESTTERM_SUB_ID";
        ddl.DataSource     = ds;
        ddl.DataBind();

        if (ds.Tables[0].Rows.Count == 0)
        {
            ddl.Style.Add("display", "none");
        }
        else
        {
            ddl.Style.Remove("display");
        }

        //if(ds.Tables[0].Rows.Count == 1)
        //{
        //    ddl.Visible = false;
        //}
        //else
        //{
        //    ddl.Visible = false;
        //}
    }
Exemple #2
0
    private void BindCblEstTermSub(int comp_id, string est_id)
    {
        Biz_TermSubEstMaps termSubEstMaps = new Biz_TermSubEstMaps();

        DT_ESTTERM_SUB_MAP = termSubEstMaps.GetTermSubEstMap(comp_id, est_id, "").Tables[0];

        Biz_TermSubs termSub = new Biz_TermSubs();
        DataSet      ds      = termSub.GetTermSubByYearYN(COMP_ID, "N");

        uGridSub.DataSource = ds;
        uGridSub.DataBind();
    }
Exemple #3
0
    /// <summary>
    /// 평가주기의 총가중치 합 반환
    /// </summary>
    /// <param name="est_id"></param>
    /// <returns></returns>
    public static double GetTotalWeightEstTermSub(int comp_id, string est_id)
    {
        Biz_TermSubEstMaps estterm   = new Biz_TermSubEstMaps();
        DataTable          dataTable = estterm.GetTermSubEstMap(comp_id, est_id, "").Tables[0];

        double total = 0;

        foreach (DataRow dataRow in dataTable.Rows)
        {
            total += DataTypeUtility.GetToDouble(dataRow["WEIGHT"]);
        }

        if (total == 0)
        {
            return(100);
        }

        return(total);
    }
Exemple #4
0
    private bool SaveEstTermSubMap()
    {
        Biz_TermSubEstMaps termSubEstMap = new Biz_TermSubEstMaps();
        DataTable          dataTable     = termSubEstMap.GetDataTableSchema();
        DataRow            dataRow       = null;

        TemplatedColumn ckb_use_yn = null;
        CheckBox        ckbUseYN   = null;

        TemplatedColumn weight_col = null;
        TextBox         txtWeight  = null;

        for (int i = 0; i < uGridSub.Rows.Count; i++)
        {
            UltraGridRow row = uGridSub.Rows[i];

            ckb_use_yn = (TemplatedColumn)row.Band.Columns.FromKey("USE_YN");
            ckbUseYN   = (CheckBox)((CellItem)ckb_use_yn.CellItems[row.BandIndex]).FindControl("cBox");

            weight_col = (TemplatedColumn)row.Band.Columns.FromKey("WEIGHT");
            txtWeight  = (TextBox)((CellItem)weight_col.CellItems[row.BandIndex]).FindControl("txtWeight");

            if (ckbUseYN.Checked)
            {
                dataRow = dataTable.NewRow();

                dataRow["COMP_ID"]        = COMP_ID;
                dataRow["EST_ID"]         = TreeView1.SelectedValue;
                dataRow["ESTTERM_SUB_ID"] = uGridSub.Rows[i].Cells.FromKey("ESTTERM_SUB_ID").Value;
                dataRow["WEIGHT"]         = txtWeight.Text;
                dataRow["DATE"]           = DateTime.Now;
                dataRow["USER"]           = EMP_REF_ID;

                dataTable.Rows.Add(dataRow);
            }
        }

        return(termSubEstMap.SaveTermSubEstMap(dataTable, COMP_ID, TreeView1.SelectedValue));
    }
Exemple #5
0
    /// <summary>
    /// 평가 주기의 가중치 String
    /// </summary>
    /// <param name="comp_id"></param>
    /// <param name="est_id"></param>
    /// <returns></returns>
    public static string GetWeightStringByEstTermSub(int comp_id, string est_id)
    {
        Biz_TermSubEstMaps estterm   = new Biz_TermSubEstMaps();
        DataTable          dataTable = estterm.GetTermSubEstMap(comp_id, est_id, "").Tables[0];

        string temp    = "";
        bool   isFirst = true;

        foreach (DataRow dataRow in dataTable.Rows)
        {
            if (isFirst)
            {
                temp   += DataTypeUtility.GetToDouble(dataRow["WEIGHT"]).ToString("#,##0.00");
                isFirst = false;
            }
            else
            {
                temp += " : " + DataTypeUtility.GetToDouble(dataRow["WEIGHT"]).ToString("#,##0.00");
            }
        }

        return(temp);
    }