コード例 #1
0
        private void SetWhereClause()
        {
            this.whereClause = BoardBaseLib.GetSelMenuQuery(ddlSelMenu.SelectedValue);
            if (tbSearchString.Text != "")
            {
                //현재 페이지를 셋팅합니다.      ; 1
                Paging.Self.SetCurrentPage(1);

                string search = "";
                tbSearchString.Text = HTML.ReplaceToDB(tbSearchString.Text);

                switch (ddlSearch.SelectedItem.Value)
                {
                case "daCategory":
                case "daType":
                    search            = " LIKE '" + tbSearchString.Text + "%'";
                    this.whereClause += " AND (" + ddlSearch.SelectedItem.Value + search + ")";
                    break;

                case "daName":
                case "DeptName":
                case "daDescription":
                    search            = " LIKE '%" + tbSearchString.Text + "%'";
                    this.whereClause += " AND (" + ddlSearch.SelectedItem.Value + search + ")";
                    break;

                case "da_id":
                case "staff_id":
                    if (ddlSearch.SelectedItem.Value == "da_id")
                    {
                        search = "=" + tbSearchString.Text;
                    }
                    else
                    {
                        search = "=" + StfBaseLib.GetStaff_id(tbSearchString.Text);
                    }

                    this.whereClause += " AND (" + ddlSearch.SelectedItem.Value + search + ")";
                    break;

                //case "DeptName":
                //	search = "=" + tbSearchString.Text;
                //	break;
                //	case "DeptID":
                //	string deptID = BoardBaseLib.GetDeptID(tbSearchString.Text);
                //	if(deptID != null)
                //	search = " = " + deptID;
                //	else
                //	search = " Is Null";
                //	this.whereClause += " AND (" + ddlSearch.SelectedItem.Value + search + ")";
                //	JinsLibrary.WebUtil.CurrentResponse.Write("후후후= " +this.whereClause + "<br>");
                //	JinsLibrary.CommonLib.WebUtil.CurrentResponse.End();
                //	break;
                default:
                    goto case "daCategory";
                }
            }
            SearchResultDisplay();
        }
コード例 #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //ClientAction.GoUrl(4, "BoardInfo_inc.asp");

            //로그인되었는지 확인
            //KistelSite.Admins.CompanyMgr.Staffs.LoginProcess.LoginOK();
            //페이지타이틀설정
            JinsLibrary.ClientAction.AddBrowserTitleBar("게시판리스트");

            //Response.End();
            #region 각전역변수 테스트
            //	if(AppVariable.Self["application"] != null)
            //		ClientAction.ShowInfoMsg(AppVariable.Self["application"].ToString());
            //	if(Session["session"] != null)
            //		ClientAction.ShowInfoMsg(Session["session"].ToString());
            //	if(DataCache.Self["dataCache"] != null)
            //		ClientAction.ShowInfoMsg(JinsLibrary.STATEMANAGE.DataCache.Self["dataCache"].ToString());
            //	ClientAction.ShowInfoMsg(JinsLibrary.CONFIG.TableConfig.nameNJ);
            #endregion
            //삭제버튼을 클릭한 경우"d" //게시물 영구영구삭제"dd"
            if (Request.QueryString["mode"] != null)
            {
                BoardBaseLib.DeleteDoc(Request.QueryString["mode"], WebUtil.CurrentRequest["daID"]);
                HttpContext.Current.Response.Redirect(Request.Url.AbsolutePath.ToString() + "?" + URLQuery.Self.GetQueryString());
            }
            if (!Page.IsPostBack)
            {
                //현재 페이지를 셋팅합니다.      -1
                Paging.Self.SetCurrentPage(WebUtil.CurrentRequest["cp"]);
                //메뉴선택리스트 바인딩
                SelMenuBind();
                //문서선택메뉴
                if (Request.QueryString["smv"] != null)
                {
                    this.ddlSelMenu.SelectedValue = Request.QueryString["smv"];
                }
                SelMenuValue = Convert.ToInt16(ddlSelMenu.SelectedValue);
                //조건문 셋팅
                SetWhereClause();
                //테이터바이딩
                this.DocListBind();
                //문서입력 링크바인딩
                InsertButtonLink();
            }
        }