private void GetPageSetting(int Idx, DataSet ds, string CMD) { if (CMD.Equals("V")) { this.lbtnCancel.Text = "<span>목록</span>"; this.lbtnCancel.CssClass = "buttons fl_l"; DataTable dt1 = ds.Tables[0]; DataTable dt2 = ds.Tables[1]; Common_NTx_Dac ddlSet = new Common_NTx_Dac(); DataTable AllCategorydt = ddlSet.TOTALBBS_ALL_CATEGORY_INFO_SEL(-1); this.ltBoardCategory.Text = (AllCategorydt.AsEnumerable().Where(p => (p["intIdx"].ToString() == dt1.Rows[0]["intBoardCatrgory"].ToString()) && (p["chrCateGubun"].ToString() == "B")).Select(p => p["strCateName"].ToString())).FirstOrDefault(); this.ltWriteCategory.Text = (AllCategorydt.AsEnumerable().Where(p => (p["intIdx"].ToString() == dt1.Rows[0]["intWriteCategory"].ToString()) && (p["chrCateGubun"].ToString() == "W")).Select(p => p["strCateName"].ToString())).FirstOrDefault(); this.ltUserId.Text = dt1.Rows[0]["strUserId"].ToString(); this.ltWriter.Text = dt1.Rows[0]["strWriter"].ToString(); this.ltSubject.Text = dt1.Rows[0]["strSubject"].ToString(); this.ltContent.Text = dt1.Rows[0]["strContent"].ToString(); this.ltRegiDateValue.Text = dt1.Rows[0]["dateRegDate"].ToString(); this.ltViewCntValue.Text = dt1.Rows[0]["intViewCount"].ToString(); //첨부파일 세팅 if (dt2.Rows.Count == 0) { this.rptBoard_Attached.DataSource = dt2; this.rptBoard_Attached.DataBind(); } else { AttachedFileCnt = 1; this.rptBoard_Attached.DataSource = dt2; this.rptBoard_Attached.DataBind(); } } this.hdfIdx.Value = Idx.ToString(); this.hdfCMD.Value = CMD; }
protected void rptGetList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { Literal ltThChkBoxAll = (Literal)e.Item.FindControl("ltThChkBoxAll"); LinkButton lbtThIdx = (LinkButton)e.Item.FindControl("lbtThIdx"); LinkButton lbtThBoardCate = (LinkButton)e.Item.FindControl("lbtThBoardCate"); LinkButton lbtThWriteCate = (LinkButton)e.Item.FindControl("lbtThWriteCate"); LinkButton lbtThSubject = (LinkButton)e.Item.FindControl("lbtThSubject"); LinkButton lbtThViewCount = (LinkButton)e.Item.FindControl("lbtThViewCount"); LinkButton lbtThWriter = (LinkButton)e.Item.FindControl("lbtThWriter"); LinkButton lbtThRegdate = (LinkButton)e.Item.FindControl("lbtThRegdate"); ltThChkBoxAll.Text = "<input type=\"checkbox\" onclick=\"SelectAllCheckBoxes(this);\" id=\"SelectAllCheckBox\" />"; lbtThIdx.Text = "일련번호"; lbtThIdx.OnClientClick = "if(!FrmSort('IDX')) return false;"; lbtThBoardCate.Text = "게시판 카테고리"; lbtThBoardCate.OnClientClick = "if(!FrmSort('BCD')) return false;"; lbtThWriteCate.Text = "게시글 카테고리"; lbtThWriteCate.OnClientClick = "if(!FrmSort('WCD')) return false;"; lbtThSubject.Text = "제목"; lbtThSubject.OnClientClick = "if(!FrmSort('SUB')) return false;"; lbtThViewCount.Text = "조회수"; lbtThViewCount.OnClientClick = "if(!FrmSort('VCT')) return false;"; lbtThWriter.Text = "작성자"; lbtThWriter.OnClientClick = "if(!FrmSort('WRT')) return false;"; lbtThRegdate.Text = "등록일"; lbtThRegdate.OnClientClick = "if(!FrmSort('REG')) return false;"; } // 데이타 처리 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { BoardBean GetItems = (BoardBean)e.Item.DataItem; Literal ltChkBoxList = (Literal)e.Item.FindControl("ltChkBoxList"); Literal ltIdx = (Literal)e.Item.FindControl("ltIdx"); Literal ltBoardCate = (Literal)e.Item.FindControl("ltBoardCate"); Literal ltWriteCate = (Literal)e.Item.FindControl("ltWriteCate"); LinkButton lbtSubject = (LinkButton)e.Item.FindControl("lbtSubject"); Literal ltViewCount = (Literal)e.Item.FindControl("ltViewCount"); Literal ltWriter = (Literal)e.Item.FindControl("ltWriter"); Literal ltRegdate = (Literal)e.Item.FindControl("ltRegdate"); ltChkBoxList.Text = "<input type=\"checkbox\" name=\"ChkBoxList\" id=\"ChkBoxList\" value=\"" + GetItems.intIdx.ToString() + "\" />"; ltIdx.Text = Convert.ToString(TotalCnt--); lbtSubject.Text = GetItems.strSubject + " (" + GetItems.intReplyCount + ")"; lbtSubject.OnClientClick = "if(!FrmModify('" + GetItems.intIdx.ToString() + "','')) return false;"; //lbtSubject.PostBackUrl = "/BackOffice/Board/BoardWrite.aspx"; Common_NTx_Dac ddlSet = new Common_NTx_Dac(); DataTable AllCategorydt = ddlSet.TOTALBBS_ALL_CATEGORY_INFO_SEL(-1); string strBoardCategory = (AllCategorydt.AsEnumerable().Where(p => (p["intIdx"].ToString() == Convert.ToString(GetItems.intBoardCategory)) && (p["chrCateGubun"].ToString() == "B")).Select(p => p["strCateName"].ToString())).FirstOrDefault(); string strWriteCategory = (AllCategorydt.AsEnumerable().Where(p => (p["intIdx"].ToString() == Convert.ToString(GetItems.intWriteCategory)) && (p["chrCateGubun"].ToString() == "W")).Select(p => p["strCateName"].ToString())).FirstOrDefault(); //ltBoardCate.Text = Convert.ToString(GetItems.intBoardCategory); ltBoardCate.Text = strBoardCategory; //ltWriteCate.Text = Convert.ToString(GetItems.intWriteCategory); ltWriteCate.Text = strWriteCategory; ltWriter.Text = GetItems.strWriter; ltViewCount.Text = Convert.ToString(GetItems.intViewCount); ltRegdate.Text = GetItems.dateRegDate; } if (e.Item.ItemType == ListItemType.Footer) { if (NoDataTotalCnt == 0) { Literal ltNoData = (Literal)e.Item.FindControl("ltNoData"); //데이타가 없는경우 ltNoData.Text = string.Format("<tr><td colspan=\"{ 0}\">{1}</td></tr>", "7", "조회된 데이터가 없습니다."); } } }