Exemplo n.º 1
0
        protected void dataList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //DataRow row = ((DataRowView)e.Item.DataItem).Row;    //<-- DataSet에서만 가능
                System.Data.Common.DbDataRecord dRecord = (System.Data.Common.DbDataRecord)e.Item.DataItem;
                //((Literal)e.Item.FindControl("litIDX")).Text = e.Item.ItemIndex.ToString();

                //회원등급
                Label mLevel = (Label)e.Item.FindControl("mLevel");
                mLevel.ToolTip = MbrBaseLib.Self.GetStatusText(dRecord.GetByte(dRecord.GetOrdinal("mLevel")));


                //회사명(직업)
                Label lbJobInfo = (Label)e.Item.FindControl("lbJobInfo");
                lbJobInfo.Text    = dRecord.GetValue(dRecord.GetOrdinal("company")).ToString();
                lbJobInfo.ToolTip = dRecord.GetValue(dRecord.GetOrdinal("jobType")).ToString();

                //최근로그인한 날
                Label hobbies = (Label)e.Item.FindControl("hobbies");
                hobbies.ToolTip = dRecord.GetValue(dRecord.GetOrdinal("hobbies")).ToString();
                if (hobbies.ToolTip != "")
                {
                    hobbies.Text = Text.ShortenString(hobbies.ToolTip, 10);
                }

                //메일링크
                HyperLink hlEmail = (HyperLink)e.Item.FindControl("hlEmail");
                hlEmail.Text    = string.Format("{0} ({1})", dRecord.GetString(dRecord.GetOrdinal("MbrName")), dRecord.GetString(dRecord.GetOrdinal("loginID")));
                hlEmail.ToolTip = dRecord.GetValue(dRecord.GetOrdinal("MbrEmail")).ToString();
                string strSendonemail = Text.GetEmailFormat(dRecord.GetValue(dRecord.GetOrdinal("MbrName")).ToString(), hlEmail.ToolTip);
                hlEmail.NavigateUrl = "../Mine/Mail/MailForm.aspx?m=" + strSendonemail;

                //월급정보
                Literal litMonthlyPayText = (Literal)e.Item.FindControl("litMonthlyPayText");
                litMonthlyPayText.Text = MbrBaseLib.Self.GetMonthlyPayText(dRecord.GetValue(dRecord.GetOrdinal("monthlyPay")).ToString());

                //자동차정보
                Literal litCarInfoText = (Literal)e.Item.FindControl("litCarInfoText");
                litCarInfoText.Text = MbrBaseLib.Self.GetCarInfoText(dRecord.GetValue(dRecord.GetOrdinal("carInfo")).ToString());


                URLQuery.Self["mbID"] = ((System.Data.Common.DbDataRecord)e.Item.DataItem).GetValue(0).ToString();
                bool boolDisplay;
                if (MbrBaseLib.Self.CanAccess(string.Empty))
                {
                    //보기버튼
                    HyperLink hlView = (HyperLink)e.Item.FindControl("hlView");
                    hlView.NavigateUrl = "MbrView.aspx?" + URLQuery.Self.GetQueryString();
                    hlView.ToolTip     = "내용보기";
                    hlView.Visible     = true;
                    //수정버튼
                    ImageButton ibModfy = (ImageButton)e.Item.FindControl("ibModfy");
                    ibModfy.CommandName     = "select";
                    ibModfy.CommandArgument = dataList.DataKeys[e.Item.ItemIndex].ToString();
                    //이렇게 할필요 까지???ibModfy.Attributes["onClick"] = "return ConfirmJ('수정하시겠습니까?');";
                    ibModfy.ToolTip = "수정하기";
                    ibModfy.Visible = true;

                    //Response.Write(hlView.Visible + " - " + ibModfy.Visible + " : " + DateTime.Now.ToString() + "<br>");
                    boolDisplay = false;
                }
                else
                {
                    boolDisplay = true;
                }
                //없음표시(뭔가 이상);
                Literal displayNone = (Literal)e.Item.FindControl("displayNone");
                displayNone.Visible = boolDisplay;//DisplayNone(hlView.Visible, ibModfy.Visible);
            }
            else if (e.Item.ItemType == ListItemType.Header)
            {
                Literal litSearchResult = (Literal)e.Item.FindControl("litSearchResult");
                Literal litListBrief    = (Literal)e.Item.FindControl("litListBrief");

                litSearchResult.Text = this.SearchResultDisplay(this.tbSearchString.Text);
                litListBrief.Text    = Paging.Self.ListSummary;
                //각종 상태값 메모리로 올림(상태유지를 위해)
                SetQueryString();
                #region 페이징기능구현
                Paging.Self.Init_Violet();
                this.litPaging.Text = Paging.Self.GeneratePaging();
                #endregion
            }
            else if (e.Item.ItemType == ListItemType.Footer)
            {
                //페이징기능이 여기에 구현되어야 하나 인터페이스에 없으므로 헤더에서 구현
                //Literal litPaging = (Literal)e.Item.FindControl("litPaging");
            }
        }
Exemplo n.º 2
0
        //protected void ddlSelMenu_SelectedIndexChanged(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    URLQuery.Self.Remove("cp");
        //    URLQuery.Self["cp"] = "1";
        //    Paging.Self.SetCurrentPage(1);

        //    //메뉴상태 스태틱저장
        //    //SelMenuValue = Convert.ToInt16(ddlSelMenu.SelectedValue);

        //    SetCondition();
        //    GoodsListBind();
        //    //나머지 이벤트실행되면 혼나
        //    //this.tbSearchString.TextChanged -= new System.EventHandler(this.tbSearchString_TextChanged);
        //    //this.btnSearch.Click -= new System.EventHandler(this.btnSearch_Click);
        //}
        //protected void tbSearchString_TextChanged(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    Paging.Self.SetCurrentPage(1);

        //    SetCondition();
        //    GoodsListBind();
        //    //this.btnSearch.Click -= new System.EventHandler(this.btnSearch_Click);
        //}
        //protected void btnSearch_Click(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    Paging.Self.SetCurrentPage(1);

        //    SetCondition();
        //    GoodsListBind();
        //    //this.tbSearchString.TextChanged -= new System.EventHandler(this.tbSearchString_TextChanged);
        //}


        //protected void ibSendMail_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        //{
        //    //Response.Write("where = " + tableName + ";" + ViewState["whereClause"] );
        //    Session.Add("whereClause", ViewState["whereClause"]);
        //    Response.Redirect("../Mine/Mail/MailForm.aspx?t=mbr");
        //}
        #endregion

        protected void dataList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //DataRow row = ((DataRowView)e.Item.DataItem).Row;    //<-- DataSet에서만 가능
                System.Data.Common.DbDataRecord dRecord = (System.Data.Common.DbDataRecord)e.Item.DataItem;

                //메일링크
                //HyperLink hlEmail = (HyperLink)e.Item.FindControl("hlEmail");
                //string strSendonemail = ((System.Data.Common.DbDataRecord)e.Item.DataItem).GetValue(2) + " <" + hlEmail.ToolTip +">;";
                //hlEmail.NavigateUrl = "../Mine/Mail/MailForm.aspx?m=" + strSendonemail;

                URLQuery.Self["gcID"] = ((System.Data.Common.DbDataRecord)e.Item.DataItem).GetValue(0).ToString();
                //작은 상품이미지(링크) 만들기
                Image imgGdsSmallPic = (Image)e.Item.FindControl("imgGdsSmallPic");
                imgGdsSmallPic.ImageUrl = GdsCellBaseLib.Self.GetGdsSmallPicUrl(Convert.ToInt32(URLQuery.Self["gcID"]));
                imgGdsSmallPic.ToolTip  = dRecord.GetString(dRecord.GetOrdinal("gName"));
                HyperLink hlGdsSmallPic = (HyperLink)e.Item.FindControl("hlGdsSmallPic");
                hlGdsSmallPic.NavigateUrl = "/Shop/GdsView/CellView.aspx?gcid=" + URLQuery.Self["gcID"];
                HyperLink hlGdsTitle = (HyperLink)e.Item.FindControl("hlGdsTitle");
                hlGdsTitle.NavigateUrl = hlGdsSmallPic.NavigateUrl;

                //bool boolDisplay;
                //if (GdsCellBaseLib.Self.CanAccess())
                //{
                //    //보기버튼
                //    HyperLink hlView = (HyperLink)e.Item.FindControl("hlView");
                //    hlView.NavigateUrl = "GdsCellView.aspx?" + URLQuery.Self.GetQueryString();
                //    hlView.ToolTip = "내용보기";
                //    hlView.Visible = true;
                //    //수정버튼
                //    ImageButton ibUpdate = (ImageButton)e.Item.FindControl("ibUpdate");
                //    //이렇게 할필요 까지???ibUpdate.Attributes["onClick"] = "return ConfirmJ('수정하시겠습니까?');";
                //    ibUpdate.ToolTip = "수정하기";
                //    ibUpdate.Visible = true;

                //    //Response.Write(hlView.Visible + " - " + ibUpdate.Visible + " : " + DateTime.Now.ToString() + "<br>");
                //    boolDisplay = false;
                //}
                //else
                //    boolDisplay = true;
                ////없음표시(뭔가 이상);
                //Literal displayNone = (Literal)e.Item.FindControl("displayNone");
                //displayNone.Visible = boolDisplay;//DisplayNone(hlView.Visible, ibUpdate.Visible);
            }
            else if (e.Item.ItemType == ListItemType.Header)
            {
                //Literal litSearchResult = (Literal)e.Item.FindControl("litSearchResult");
                //litSearchResult.Text = this.SearchResultDisplay("");//this.tbSearchString.Text);
                //Literal litListBrief = (Literal)e.Item.FindControl("litListBrief");
                litListBrief.Text = Paging.Self.ListSummary;
                //각종 상태값 메모리로 올림(상태유지를 위해)
                SetQueryString();
                #region 페이징기능구현
                Paging.Self.Init_Violet();
                this.litPaging.Text = Paging.Self.GeneratePaging();
                #endregion
            }
            else if (e.Item.ItemType == ListItemType.Footer)
            {
                //페이징기능이 여기에 구현되어야 하나 인터페이스에 없으므로 헤더에서 구현
                //Literal litPaging = (Literal)e.Item.FindControl("litPaging");
            }

            //Response.Write("WebUtil.CurrentRequest.Path => " + WebUtil.CurrentRequest.Path + "<br/>");
        }