Beispiel #1
0
    private void BindingOrgType(int estterm_ref_id)
    {
        Biz_DeptTypeInfo deptTypeInfo = new Biz_DeptTypeInfo();

        UltraWebGrid1.DataSource = deptTypeInfo.GetDeptTypeList();
        UltraWebGrid1.DataBind();

        CheckDrillDownYN(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo));
    }
Beispiel #2
0
    private void GridBinding()
    {
        Biz_EstDeptOrgDetails estDeptOrgDetail = new Biz_EstDeptOrgDetails();
        Biz_DeptTypeInfo      deptTypeInfo     = new Biz_DeptTypeInfo();

        if (rtlDrildownYN.SelectedIndex == 1)
        {
            if (TreeView1.Nodes.Count > 0)
            {
                UltraWebGrid1.Clear();
                UltraWebGrid1.DataSource = estDeptOrgDetail.GetEstDeptOrgDetail(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), Convert.ToInt32(TreeView1.Nodes[0].Value));
                UltraWebGrid1.DataBind();
            }
            else
            {
                UltraWebGrid1.DataSource = deptTypeInfo.GetDeptTypeList();
                UltraWebGrid1.DataBind();
            }
        }
        else
        {
            if (TreeView1.Nodes.Count > 0)
            {
                if (TreeView1.SelectedNode != null)
                {
                    UltraWebGrid1.Clear();
                    DataSet ds = estDeptOrgDetail.GetEstDeptOrgDetail(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), Convert.ToInt32(TreeView1.SelectedNode.Value));
                    UltraWebGrid1.DataSource = ds;
                    UltraWebGrid1.DataBind();
                }
                else
                {
                    UltraWebGrid1.DataSource = deptTypeInfo.GetDeptTypeList();
                    UltraWebGrid1.DataBind();
                }
            }
            else
            {
                UltraWebGrid1.DataSource = deptTypeInfo.GetDeptTypeList();
                UltraWebGrid1.DataBind();
            }
        }
    }
Beispiel #3
0
    protected void doBind()
    {
        string dept_type_ref_id_list = "";

        for (int i = 0; i < DEPT_TYPE_REF_ID.Length; i++)
        {
            if (dept_type_ref_id_list.Length > 0)
            {
                dept_type_ref_id_list += ", ";
            }

            dept_type_ref_id_list += DEPT_TYPE_REF_ID[i];
        }

        Biz_PositionInfos bizPosInfo = new Biz_PositionInfos(POS_ID);


        //종으로 출력된 부서타입별 가중치를 횡으로 변환
        if (bizPosInfo.Position_Table_Name != null && bizPosInfo.Position_Table_Name.Trim().Length > 0)
        {
            Biz_Est_Pos_Weight bizEstPosWeight = new Biz_Est_Pos_Weight();
            DataTable          dt = bizEstPosWeight.Get_Est_Pos_Weight(POS_ID
                                                                       , bizPosInfo.Position_Table_Name
                                                                       , dept_type_ref_id_list
                                                                       , COMP_ID
                                                                       , ESTTERM_REF_ID
                                                                       , EST_ID);

            DataTable dt_result = DataTypeUtility.GetGroupByDataTable(dt, new string[] { "POS_ID", "POS_VALUE", "POS_VALUE_NAME" });

            if (dt_result.Rows.Count > 0)
            {
                for (int i = 0; i < DEPT_TYPE_REF_ID.Length; i++)
                {
                    int dept_type_ref_id = DEPT_TYPE_REF_ID[i];

                    string colName = string.Format("WEIGHT_{0}", dept_type_ref_id);
                    dt_result.Columns.Add(colName);


                    Biz_DeptTypeInfo bizDeptTypeInfo = new Biz_DeptTypeInfo(dept_type_ref_id);
                    string           dept_type_name  = bizDeptTypeInfo.Itype_name;



                    TemplatedColumn srcCol = (TemplatedColumn)UltraWebGrid1.Columns.FromKey("WEIGHT");
                    //컬럼 복사 후 추가
                    if (!UltraWebGrid1.Columns.Exists(colName))
                    {
                        UltraGridColumn hdCol = new UltraGridColumn();//히든 컬럼
                        hdCol.BaseColumnName = colName;
                        hdCol.Key            = colName;
                        hdCol.Hidden         = true;
                        UltraWebGrid1.Columns.Insert(srcCol.Index, hdCol);
                    }

                    if (!UltraWebGrid1.Columns.Exists("i" + colName))
                    {
                        TemplatedColumn tgtCol = new TemplatedColumn();//입력 컬럼
                        tgtCol.CopyFrom(srcCol);
                        tgtCol.BaseColumnName = "i" + colName;
                        tgtCol.Key            = "i" + colName;
                        tgtCol.Hidden         = false;
                        tgtCol.Width          = Unit.Pixel(80);
                        tgtCol.Header.Caption = string.Format("{0} 가중치", dept_type_name);

                        UltraWebGrid1.Columns.Insert(srcCol.Index, tgtCol);
                    }



                    DataTable dt_filtered_pos_weght = DataTypeUtility.FilterSortDataTable(dt, string.Format("DEPT_TYPE_REF_ID={0}", dept_type_ref_id));

                    if (dt_filtered_pos_weght.Rows.Count > 0)
                    {
                        for (int j = 0; j < dt_result.Rows.Count; j++)
                        {
                            string pos_value = DataTypeUtility.GetString(dt_result.Rows[j]["POS_VALUE"]);

                            DataTable dt_pos_weight = DataTypeUtility.FilterSortDataTable(dt_filtered_pos_weght, string.Format("POS_VALUE='{0}'", pos_value));

                            if (dt_pos_weight.Rows.Count > 0)
                            {
                                double pos_weight = DataTypeUtility.GetToDouble(dt_pos_weight.Rows[0]["WEIGHT"]);
                                dt_result.Rows[j][string.Format("WEIGHT_{0}", dept_type_ref_id)] = pos_weight;
                            }
                            else
                            {
                                dt_result.Rows[j][string.Format("WEIGHT_{0}", dept_type_ref_id)] = 0;
                            }
                        }
                    }
                }
            }


            UltraWebGrid1.Clear();
            UltraWebGrid1.DataSource = dt_result;
            UltraWebGrid1.DataBind();
        }
    }
Beispiel #4
0
    protected void iBtnSave_2_Click(object sender, ImageClickEventArgs e)
    {
        UltraGridRow    row;
        CheckBox        cBoxHome_YN_Org;
        CheckBox        cBoxHeader_YN_Org;
        CheckBox        cBoxContent_YN_Org;
        DropDownList    ddlPosition_Org;
        TemplatedColumn home_yn_col;
        TemplatedColumn header_yn_col;
        TemplatedColumn content_yn_col;
        TemplatedColumn position_col;
        int             est_dept_ref_id = 0;
        string          ynStr           = "N";

        Biz_DeptTypeInfo      deptTypeInfo     = new Biz_DeptTypeInfo();
        Biz_EstDeptOrgDetails estDeptOrgDetail = new Biz_EstDeptOrgDetails();

        IDbConnection conn = DbAgentHelper.CreateDbConnection();

        conn.Open();
        IDbTransaction trx = conn.BeginTransaction();

        try
        {
            // 드릴다운 사용 안할 때
            if (rtlDrildownYN.SelectedValue.Equals("0"))
            {
                if (TreeView1.Nodes.Count > 0)
                {
                    est_dept_ref_id = int.Parse(TreeView1.Nodes[0].Value);
                }
                else
                {
                    ltrScript.Text = JSHelper.GetAlertScript("조직정보가 없습니다.", false);
                    return;
                }

                ynStr = "Y";
                estDeptOrgDetail.RemoveEstDeptOrgDetail(conn, trx, PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), 0, 0);
            }
            else // 드릴다운 사용
            {
                if (TreeView1.SelectedNode != null)
                {
                    est_dept_ref_id = int.Parse(TreeView1.SelectedValue);
                    estDeptOrgDetail.ModifyEstDeptOrgDetail(conn, trx, PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), "N");
                    estDeptOrgDetail.RemoveEstDeptOrgDetail(conn, trx, PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), est_dept_ref_id, 0);
                }
                else
                {
                    ltrScript.Text = JSHelper.GetAlertScript("드릴다운 방식으로 하실 때에는 조직 부서를 선택하셔야 합니다.", false);
                    return;
                }

                ynStr = TypeUtility.GetBooleanToYN(cBoxEstDeptTopYN.Checked);
            }

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

                home_yn_col    = (TemplatedColumn)row.Band.Columns.FromKey("HOME_YN_ORG");
                header_yn_col  = (TemplatedColumn)row.Band.Columns.FromKey("HEADER_YN_ORG");
                content_yn_col = (TemplatedColumn)row.Band.Columns.FromKey("CONTENT_YN_ORG");
                position_col   = (TemplatedColumn)row.Band.Columns.FromKey("POSITION_ORG");

                cBoxHome_YN_Org    = (CheckBox)((CellItem)home_yn_col.CellItems[row.BandIndex]).FindControl("cBoxHome_YN_Org");
                cBoxHeader_YN_Org  = (CheckBox)((CellItem)header_yn_col.CellItems[row.BandIndex]).FindControl("cBoxHeader_YN_Org");
                cBoxContent_YN_Org = (CheckBox)((CellItem)content_yn_col.CellItems[row.BandIndex]).FindControl("cBoxContent_YN_Org");
                ddlPosition_Org    = (DropDownList)((CellItem)position_col.CellItems[row.BandIndex]).FindControl("ddlPosition_Org");

                estDeptOrgDetail.AddEstDeptOrgDetail(conn
                                                     , trx
                                                     , PageUtility.GetIntByValueDropDownList(ddlEstTermInfo)
                                                     , est_dept_ref_id
                                                     , int.Parse(row.Cells.FromKey("TYPE_REF_ID").Value.ToString())
                                                     , TypeUtility.GetBooleanToYN(cBoxHome_YN_Org.Checked)
                                                     , TypeUtility.GetBooleanToYN(cBoxHeader_YN_Org.Checked)
                                                     , TypeUtility.GetBooleanToYN(cBoxContent_YN_Org.Checked)
                                                     , ynStr
                                                     , int.Parse(ddlPosition_Org.SelectedValue)
                                                     , gUserInfo.Emp_Ref_ID);

                if (cBoxHome_YN_Org.Checked ||
                    cBoxHeader_YN_Org.Checked)
                {
                    ddlPosition_Org.Enabled = true;
                }
                else
                {
                    ddlPosition_Org.Enabled = false;
                }
            }

            trx.Commit();

            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 저장되었습니다.", false);
        }
        catch (Exception ex)
        {
            trx.Rollback();
            conn.Close();
        }
        finally
        {
            conn.Close();
        }
    }
Beispiel #5
0
    protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        string strTreeNm = TreeView1.SelectedNode.Text;
        string strTreeID = TreeView1.SelectedNode.Value;

        Biz_DeptTypeInfo biz = new Biz_DeptTypeInfo();
        DataSet          ds  = biz.GetDeptTypeSortList(this.IEsttermRefID
                                                       , int.Parse(strTreeID));
        string strScript = string.Empty;

        if (this.ICCB3 == "")
        {
//            string strScript = @"
//                                  <script type='text/javascript'>
//                                    opener.document.getElementById('{0}').value='" + strTreeID + @"'
//                                    opener.document.getElementById('{1}').value='" + strTreeNm + @"'
//
//                                    var openerFlag = 'ctl00_Contents_hdfDept_Type_Flag';
//                                    if(opener.document.getElementById(openerFlag))
//                                        opener.document.getElementById(openerFlag).value = '';
//
//                                    self.close();
//                                  </script>
//                               ";
//            ltrScript.Text = String.Format(strScript, this.ICCB1, this.ICCB2);
            strScript = string.Format(@"
                                  <script type='text/javascript'>
                                    window.opener.PopupSetValue('{0}','{1}');
                                    self.close();
                                  </script>
                               ", strTreeID, strTreeNm);
        }
        else
        {
//            string strScript = @"
//                                  <script type='text/javascript'>
//                                    opener.document.getElementById('{0}').value='" + strTreeID + @"'
//                                    opener.document.getElementById('{1}').value='" + strTreeNm + @"'
//
//                                    var openerFlag = 'ctl00_Contents_hdfDept_Type_Flag';
//                                    if(opener.document.getElementById(openerFlag))
//                                        opener.document.getElementById(openerFlag).value = '';
//
//                                    opener.__doPostBack('{2}','');
//                                    self.close();
//                                  </script>
//                               ";
            strScript = string.Format(@"
                                  <script type='text/javascript'>
                                    window.opener.PopupSetValue('{0}','{1}');
                                    var openerFlag = 'ctl00_Contents_hdfDept_Type_Flag';
                                    if(opener.document.getElementById(openerFlag))
                                        opener.document.getElementById(openerFlag).value = '';

                                    opener.__doPostBack('{2}','');
                                    self.close();
                                  </script>
                               ", strTreeID, strTreeNm, this.ICCB3);
        }
        ltrScript.Text = strScript;
    }