Ejemplo n.º 1
0
    protected void itnClearDeptDrill_Click(object sender, ImageClickEventArgs e)
    {
        Biz_EstDeptOrgDetails estDeptOrgDetail = new Biz_EstDeptOrgDetails();

        estDeptOrgDetail.RemoveEstDeptOrgDetail(null, null, PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), int.Parse(TreeView1.SelectedValue), 0);

        iBtnSearch_Click(null, null);
        BindingOrgType(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo));

        iBtnSave_1.Visible = false;
    }
Ejemplo n.º 2
0
    protected void itnClearEstDeptOrg_Click(object sender, ImageClickEventArgs e)
    {
        Biz_EstDeptOrgDetails estDeptOrgDetail = new Biz_EstDeptOrgDetails();

        estDeptOrgDetail.RemoveEstDeptOrgDetail(null, null, PageUtility.GetIntByValueDropDownList(ddlEstTermInfo), 0, 0);

        iBtnSearch_Click(null, null);
        BindingOrgType(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo));

        iBtnSave_1.Visible = false;
        //iBtnSave_2.Visible = false;
        //itnClearEstDeptOrg.Visible = false;
    }
Ejemplo n.º 3
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();
        }
    }