private void DeleteViewData() { if (!this.CheckFormData()) { return; } Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); bool result = objMenuInfo.RemoveMenuinfo(_imenu_ref_id); if (result) { this.IType = "U"; this.SetFormData(); this.SetButton(); ltrScript.Text = JSHelper.GetAlertOpenerControlCallBackScript("메뉴삭제가 성공되었습니다.", this.ICCB1, true); } else { hdfMenuRefID.Value = ""; ltrScript.Text = JSHelper.GetAlertScript("메뉴삭제가 실패했습니다.", false); } }
private void SetNoticeBoard() { Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); string strMenuFullPath = HttpContext.Current.Request.Url.AbsolutePath + HttpContext.Current.Request.Url.Query; CURRENT_PAGE_MENU_ID = objMenuInfo.GetMenuIDByMenuFullPath(strMenuFullPath); if (CURRENT_PAGE_MENU_ID != 0) { CheckNoticePopupMenu(CURRENT_PAGE_MENU_ID); } else { string sUrl = HttpContext.Current.Request.Url.AbsolutePath; if (sUrl.Substring(sUrl.LastIndexOf("/") + 1).ToUpper() == "EST110104.ASPX" || sUrl.Substring(sUrl.LastIndexOf("/") + 1).ToUpper() == "EST110104_01.ASPX") { CURRENT_PAGE_MENU_ID = objMenuInfo.GetMenuIDByMenuFullPath(sUrl); if (CURRENT_PAGE_MENU_ID != 0) { CheckNoticePopupMenu(CURRENT_PAGE_MENU_ID); } } } }
protected void iBtnDelete_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); bool isOK = objMenuInfo.RemoveMenuinfo(dataTable); if (!isOK) { lblScript.Text = JSHelper.GetAlertScript("삭제할 메뉴를 체크해주세요.", false); } else { lblScript.Text = JSHelper.GetAlertScript("메뉴를 삭제하였습니다.", false); GridBindginMenu(); } }
private void InsertViewData() { if (!this.CheckFormData()) { return; } Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); objMenuInfo.Menu_ref_id = DataTypeUtility.GetToInt32(this.txtMenuRefID.Text.Trim()); objMenuInfo.Up_menu_id = DataTypeUtility.GetToInt32(this.hdfUpMenuID.Value); objMenuInfo.Menu_name = txtMenuName.Text.Trim(); objMenuInfo.Menu_dir = txtMenuDir.Text.Trim(); objMenuInfo.Menu_page_name = txtMenuPageName.Text.Trim(); objMenuInfo.Menu_param = txtMenuParam.Text.Trim(); objMenuInfo.Menu_full_path = txtMenuFullPath.Text.Trim(); objMenuInfo.Menu_desc = txtMenuDesc.Text.Trim(); objMenuInfo.Menu_priority = DataTypeUtility.GetToInt32(txtMenuPriority.Text.Trim()); objMenuInfo.Menu_auth_type = WebUtility.GetByValueDropDownList(ddlMenuAuthType); objMenuInfo.Menu_type = WebUtility.GetByValueDropDownList(ddlMenuType); objMenuInfo.Menu_name_image_path = txtMenuNameImagePath.Text.Trim(); objMenuInfo.Menu_name_image_path_u = txtMenuNameImagePathU.Text.Trim(); objMenuInfo.Menu_prev_icon_path = txtMenuPrevIconPath.Text.Trim(); objMenuInfo.Show_left_menu = WebUtility.GetByValueDropDownList(ddlShowLeftMenu); bool result = objMenuInfo.AddMenuinfo(objMenuInfo.Menu_ref_id , objMenuInfo.Up_menu_id , objMenuInfo.Menu_name , objMenuInfo.Menu_dir , objMenuInfo.Menu_page_name , objMenuInfo.Menu_param , objMenuInfo.Menu_full_path , objMenuInfo.Menu_desc , objMenuInfo.Menu_priority , objMenuInfo.Menu_auth_type , objMenuInfo.Menu_type , objMenuInfo.Menu_name_image_path , objMenuInfo.Menu_name_image_path_u , objMenuInfo.Menu_prev_icon_path , DateTime.Now , objMenuInfo.Show_left_menu); if (result) { this.IType = "U"; this.SetFormData(); this.SetButton(); ltrScript.Text = JSHelper.GetAlertOpenerControlCallBackScript("메뉴등록이 성공되었습니다.", this.ICCB1, true); } else { hdfMenuRefID.Value = ""; ltrScript.Text = JSHelper.GetAlertScript("메뉴등록이 실패했습니다.", false); } }
private void SetFormData() { if (this.IType != "A") { Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(_imenu_ref_id); txtMenuRefID.Text = objMenuInfo.Menu_ref_id.ToString(); txtUpMenuID.Text = objMenuInfo.Up_menu_id.ToString(); hdfUpMenuID.Value = objMenuInfo.Up_menu_id.ToString(); txtUpMenuName.Text = objMenuInfo.Up_Menu_name; txtMenuName.Text = objMenuInfo.Menu_name; txtMenuDir.Text = objMenuInfo.Menu_dir; txtMenuPageName.Text = objMenuInfo.Menu_page_name; txtMenuParam.Text = objMenuInfo.Menu_param; txtMenuFullPath.Text = objMenuInfo.Menu_full_path; txtMenuDesc.Text = objMenuInfo.Menu_desc; txtMenuPriority.Text = objMenuInfo.Menu_priority.ToString(); WebUtility.FindByValueDropDownList(ddlMenuAuthType, objMenuInfo.Menu_auth_type); WebUtility.FindByValueDropDownList(ddlMenuType, objMenuInfo.Menu_type); txtMenuNameImagePath.Text = objMenuInfo.Menu_name_image_path; txtMenuNameImagePathU.Text = objMenuInfo.Menu_name_image_path_u; txtMenuPrevIconPath.Text = objMenuInfo.Menu_prev_icon_path; WebUtility.FindByValueDropDownList(ddlShowLeftMenu, objMenuInfo.Show_left_menu); } else { txtMenuRefID.Text = GetMaxMenuRefID().ToString(); } }
private void SetNoticeBoard() { Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); string strMenuFullPath = HttpContext.Current.Request.Url.AbsolutePath + HttpContext.Current.Request.Url.Query; CURRENT_PAGE_MENU_ID = objMenuInfo.GetMenuIDByMenuFullPath(strMenuFullPath); if (CURRENT_PAGE_MENU_ID != 0) { CheckNoticePopupMenu(CURRENT_PAGE_MENU_ID); } }
/// <summary> /// GetTopMenuRefID /// : 현재페이지를 기초로 TOP_MENU_REF_ID를 리턴한다. /// : 재귀호출로 처리 /// </summary> /// <param name="asUrl"></param> /// <returns></returns> private int GetTopMenuRefID(string asUrl) { Biz_lib_MenuControl biz = new Biz_lib_MenuControl(); int iTopMenuID = 0; DataSet dsAuthMenu = biz.GetAuthMenuInclude_N(gUserInfo.Emp_Ref_ID.ToString()); DataRow[] draRow; draRow = dsAuthMenu.Tables[0].Select( "( MENU_FULL_PATH = '" + asUrl.ToUpper() + "' ) OR ( MENU_DIR + MENU_PAGE_NAME = '" + asUrl.ToUpper() + "' AND MENU_TYPE = 'N' )" ); //쿼리스트링을 포함한 경로가 메뉴에 없을경우 페이지명으로만 다시 검색 if (draRow.Length == 0 && Request.Url.Query.Length > 0) { draRow = dsAuthMenu.Tables[0].Select( "( MENU_DIR + MENU_PAGE_NAME = '" + Request.Url.AbsolutePath.Replace(Request.Url.Query, "") + "' )" ); } foreach (DataRow dbRow in draRow) { SearchTopMenuID(dsAuthMenu, dbRow, out iTopMenuID); } // 만약 해당메뉴가 없다면 DB에서 바로 불러옴 // usr10001.aspx 인 경우에 해당 dsAuthMenu에 없음 if (iTopMenuID == 0) { Biz_MenuInfo biz_menuinfo = new Biz_MenuInfo(); iTopMenuID = biz_menuinfo.GetUpMenuIDByMenuFullPath(asUrl); } return(iTopMenuID); }
public static void BindMenu(TreeView treeView , bool isCheckBox , TreeNodeSelectAction treeNodeSelectAction , string checkedValues) { string valueStr = "MENU_REF_ID"; string up_valueStr = "UP_MENU_ID"; string textStr = "MENU_NAME"; string iconStr = "EST_STYLE_ID"; string imageUrlDir = "../images/treeview/"; bool isExtended = true; DataTable dataTable = null; // 부모 페이지에서 값이 수정되었을 경우를 위해서 체크박스에 대한 값을 처리하기 // 위해서 추가 되는 부분 if (isCheckBox && (checkedValues != null || checkedValues == "")) { dataTable = new DataTable(); DataRow dr = null; dataTable.Columns.Add("VALUE", typeof(string)); dataTable.Columns.Add("OK_YN", typeof(string)); string[] values = checkedValues.Split(','); foreach (string val in values) { dr = dataTable.NewRow(); dr["VALUE"] = val; dr["OK_YN"] = "N"; dataTable.Rows.Add(dr); } } Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); DataSet ds = objMenuInfo.GetMenuInfos(); ds.Relations.Add("NodeRelation" , ds.Tables[0].Columns[valueStr] , ds.Tables[0].Columns[up_valueStr] , false); treeView.Nodes.Clear(); foreach (DataRow dbRow in ds.Tables[0].Rows) { if (dbRow[up_valueStr] == DBNull.Value || DataTypeUtility.GetToInt32(dbRow[up_valueStr]) == 0) { TreeNode rootNode = CreateNode(dbRow[valueStr].ToString() , dbRow[textStr].ToString() , imageUrlDir + "folder.gif" , isExtended , treeNodeSelectAction , isCheckBox); if (isCheckBox && (checkedValues != null || checkedValues == "")) { TreeNodeCheck(rootNode, dataTable); } treeView.Nodes.Add(rootNode); PopulateMenuTree(dbRow, rootNode, valueStr, textStr, imageUrlDir, iconStr, treeNodeSelectAction, isExtended, isCheckBox, dataTable); } } }
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(); //} }
protected void iBtnAdd_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); MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common bizCustom = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common(); int okCnt = bizCustom.AddMenuRole(dataTable, ddlRoles.SelectedValue); //RoleInfos role = new RoleInfos(); //role.RemoveRoleMenu(); //role.AddRoleMenu(int.Parse(ddlRoles.SelectedValue), int.Parse(hdfMenu_Ref_ID.Value)); //WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value)); //DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value)); CheckMenuRoleCount(); GridBindginMenu(); //Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); //DataTable blankDataTable = new DataTable(); //blankDataTable.Columns.Add("ROLE_REF_ID", typeof(string)); //blankDataTable.Columns.Add("MENU_REF_ID", typeof(string)); ////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","MENU_ROLE" } //// , dataTable); //foreach (UltraGridRow ugRow in UltraWebGrid1.Rows) //{ // TemplatedColumn col_cBox = (TemplatedColumn)ugRow.Band.Columns.FromKey("selchk"); // CheckBox cBox = (CheckBox)((CellItem)col_cBox.CellItems[ugRow.BandIndex]).FindControl("cBox"); // if (cBox.Checked) // { // DataRow dataRow = blankDataTable.NewRow(); // TemplatedColumn col_ddl = (TemplatedColumn)ugRow.Band.Columns.FromKey("MENU_ROLE"); // DropDownList colDDL = (DropDownList)((CellItem)col_ddl.CellItems[ugRow.BandIndex]).FindControl("ddlMenuRole"); // dataRow["ROLE_REF_ID"] = colDDL.SelectedValue; // dataRow["MENU_REF_ID"] = ugRow.Cells.FromKey("MENU_REF_ID").Value; // blankDataTable.Rows.Add(dataRow); // } //} //object a = this.UltraWebGrid1.Rows[1].Cells.FromKey("MENU_ROLE").Value; //Biz_DongbuMetal_Custom bizCustom = new Biz_DongbuMetal_Custom(); //int okCnt = bizCustom.AddMenuRole(blankDataTable, ddlRoles.SelectedValue); ////RoleInfos role = new RoleInfos(); ////role.RemoveRoleMenu(); ////role.AddRoleMenu(int.Parse(ddlRoles.SelectedValue), int.Parse(hdfMenu_Ref_ID.Value)); ////WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value)); ////DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value)); //CheckMenuRoleCount(); }
/// <summary> /// 메뉴ID 구하기 /// </summary> /// <returns></returns> private int GetMaxMenuRefID() { Biz_MenuInfo objMenuInfo = new Biz_MenuInfo(); return(objMenuInfo.GetMaxMenuRefID()); }