Esempio n. 1
0
    protected void iBtnRemove_Click(object sender, ImageClickEventArgs e)
    {
        RoleInfos role = new RoleInfos();

        CheckBox        chk;
        UltraGridRow    row;
        TemplatedColumn col;
        bool            isOK  = false;
        int             edidx = 0;

        for (int i = 0; i < this.UltraWebGrid2.Rows.Count; i++)
        {
            row = UltraWebGrid2.Rows[i];
            col = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
            chk = (CheckBox)((CellItem)col.CellItems[row.BandIndex]).FindControl("cBox");

            if (chk.Checked)
            {
                try
                {
                    isOK = role.RemoveRoleMenu(int.Parse(row.Cells.FromKey("ROLE_REF_ID").Value.ToString()), int.Parse(hdfMenu_Ref_ID.Value));
                }
                catch (Exception ex)
                {
                    lblScript.Text = JSHelper.GetAlertScript("삭제 중 오류가 발생하였습니다..", false);
                    return;
                }
            }
        }

        if (!isOK)
        {
            lblScript.Text = JSHelper.GetAlertScript("삭제할 항목을 선택주세요.", false);
        }
        else
        {
            WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value));
            DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value));
            CheckMenuRoleCount();
        }
    }
Esempio n. 2
0
    protected void iBtnRemove_Click(object sender, ImageClickEventArgs e)
    {
        Biz_MenuInfo objMenuInfo = new Biz_MenuInfo();

        DataTable dataTable = objMenuInfo.GetDataTableSchema();

        dataTable = UltraGridUtility.GetDataTableByCheckValue(
            this.UltraWebGrid1
            , "cBox"
            , "selchk"
            , new string[] { "MENU_REF_ID", "UP_MENU_ID", "MENU_NAME", "MENU_DIR"
                             , "MENU_PAGE_NAME", "MENU_PARAM", "MENU_FULL_PATH"
                             , "MENU_DESC", "MENU_PRIORITY", "MENU_AUTH_TYPE", "MENU_TYPE"
                             , "MENU_NAME_IMAGE_PATH", "MENU_NAME_IMAGE_PATH_U"
                             , "MENU_PREV_ICON_PATH", "MENU_CREATE_DATE", "SHOW_LEFT_MENU" }
            , dataTable);

        RoleInfos role = new RoleInfos();

        foreach (DataRow row in dataTable.Rows)
        {
            int menu_ref_id = DataTypeUtility.GetToInt32(row["MENU_REF_ID"]);
            role.RemoveRoleMenu(ROLE_REF_ID, menu_ref_id);
        }

        GridBindginMenu();

        //RoleInfos role = new RoleInfos();

        //CheckBox chk;
        //UltraGridRow row;
        //TemplatedColumn col;
        //bool isOK = false;
        //int edidx = 0;

        //for (int i = 0; i < this.UltraWebGrid2.Rows.Count; i++)
        //{
        //    row = UltraWebGrid2.Rows[i];
        //    col = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
        //    chk = (CheckBox)((CellItem)col.CellItems[row.BandIndex]).FindControl("cBox");

        //    if (chk.Checked)
        //    {
        //        try
        //        {
        //            isOK = role.RemoveRoleMenu(int.Parse(row.Cells.FromKey("ROLE_REF_ID").Value.ToString()), int.Parse(hdfMenu_Ref_ID.Value));
        //        }
        //        catch (Exception ex)
        //        {
        //            lblScript.Text = JSHelper.GetAlertScript("삭제 중 오류가 발생하였습니다..", false);
        //            return;
        //        }
        //    }
        //}

        //if (!isOK)
        //    lblScript.Text = JSHelper.GetAlertScript("삭제할 항목을 선택주세요.", false);
        //else
        //{
        //    WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value));
        //    DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value));
        //    CheckMenuRoleCount();
        //}
    }