Пример #1
0
        protected void AddressListBind()
        {
            DBLib  dbUtil = new DBLib();
            string fieldNames, whereClause, orderBy;

            fieldNames  = "ZIPCODE,(IsNull(SIDO,'')+' '+IsNull(SIGUNGU,'')+' '+IsNull(DONG,'')+' '+IsNull(RI,'')+' '+IsNull(DOSEO,'')+' '+IsNull(BUNJI,'')+' '+IsNull(AMOUNT,'')) AS totAddrValue";
            whereClause = "DONG Like '" + addrSeek.Text.Trim() + "%'";
            orderBy     = "ZIPCODE";

            SqlDataReader drPost = dbUtil.Select_DR(fieldNames, "t_post", whereClause, orderBy);

            if (drPost.HasRows)
            {
                this.dlPost.DataSource = drPost;
                this.dlPost.DataBind();                         //바인딩하기 전에 drPost.Read();하지 말것.
                dlPost.Visible     = true;
                pnAddrList.Visible = true;
                pnNone.Visible     = false;
            }
            else
            {
                dlPost.Visible     = false;
                pnAddrList.Visible = false;
                pnNone.Visible     = true;
            }
            //HttpContext.Current.Response.Write("DBConnection=" + dbUtil.SqlConnection.);
            drPost.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #2
0
        protected void PollExampleBind()
        {
            dbUtil = new DBLib();

            string fieldNames, tableName, whereClause, orderBy;

            fieldNames  = "exNbr,example";
            tableName   = "t_PollEX";
            whereClause = "poll_id =" + this.poll_id;
            orderBy     = "exNbr";
            //실제쿼리실행
            drPoll = dbUtil.Select_DR(fieldNames, tableName, whereClause, orderBy);

            if (drPoll.HasRows)
            {
                rblExamples.DataSource = drPoll;

                rblExamples.DataValueField       = "exNbr";
                rblExamples.DataTextField        = "example";
                rblExamples.DataTextFormatString = "{0}";
                rblExamples.DataBind();
            }
            else
            {
                rblExamples.ToolTip = "예제가 없습니다.";
            }
            drPoll.Close();
        }
Пример #3
0
        //문서데이터 삭제
        public static void DeleteDoc(string mode, string da_id)
        {
            URLQuery.Self.RemoveAll();
            DBLib dbUtil = new DBLib();

            //(실제로 업데이트)
            if (mode == "d")
            {
                string[] setNameValue = new string[3]
                {
                    "daModifyDT=GetDate()", "daStatus=0", "daDescription = daDescription + '\r\n\r\n\r\n" + Cookie.Self["sLoginID"] + "의한 삭제'"
                };
                dbUtil.Update_EN("t_DocumentAssets", setNameValue, "da_id = " + da_id);
            }
            else if (mode == "dd")            //게시물 영구삭제(실제삭제)
            {
                //관련문서파일삭제
                SqlDataReader drDelFiles = dbUtil.Select_DR("dfName", "t_DocFileAssets", "df_id=" + da_id);
                while (drDelFiles.Read())
                {
                    //FileLib.Self.FileDelete(SystemConfig.GetValue("DocUploadDir") + drDelFiles["dfName"].ToString());
                    string backupDir = SystemConfig.GetValue("UploadDirBackup") + "docData.bak/";
                    FileLib.Self.FileMoveTo(SystemConfig.GetValue("DocUploadDir") + drDelFiles["dfName"].ToString(), backupDir + drDelFiles["dfName"].ToString());
                }
                drDelFiles.Close();
                //관련레코드 삭제
                dbUtil.Delete_EN("t_DocFileAssets", "df_id = " + da_id);
                dbUtil.Delete_EN("t_DocumentAssets", "da_id = " + da_id);
                URLQuery.Self["smv"] = "0";
            }
            dbUtil.SqlConnection.Close();
        }
Пример #4
0
        protected void MbrOptListBind()
        {
            DBLib dbUtil = new DBLib();
            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize(20);
            string fieldNames, whereClause, orderBy, subQryOrderBy;

            fieldNames = "a.member_id, a.loginID, a.MbrName, a.MbrEmail, a.newsLetter,"
                         + "b.mLevel, b.howMuch, b.howMany, b.RFund, b.RFundAC,"
                         + "b.point,b.pointAC, b.unpaid,b.unpaidAC, b.joinDT, b.recentLogin, b.leaveDT ";
            this._tableJoin = " t_Member AS a INNER JOIN t_MemberValue AS b ON a.member_id = b.member_id ";
            whereClause     = SetWhereClause();
            orderBy         = SetOrderBy();
            subQryOrderBy   = orderBy.Replace("ASC", "\n").Replace("DESC", "ASC").Replace("\n", "DESC"); //orderBy와 반대	 //Response.Write("subQryOrderBy = " + subQryOrderBy + "<br/>");

            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount(this._tableJoin, whereClause);

            //string qryString = "SELECT t_Members.member_id, t_Members.loginID, t_Members.MbrName, t_Members.MbrEmail, t_Members.newsLetter,"
            //	+ "t_MemberValue.mLevel, t_MemberValue.howMuch, t_MemberValue.howMany, t_MemberValue.RFund,t_MemberValue.RFundAC,"
            //	+ "t_MemberValue.point,t_MemberValue.pointAC, t_MemberValue.unpaid,t_MemberValue.unpaidAC, t_MemberValue.joinDT "
            //	+ "FROM t_Members INNER JOIN t_MemberValue ON "
            //	+ "t_Members.member_id = t_MemberValue.member_id";
            //	+ WHERE   (dbo.t_Members.member_id = 1)//member_id=" + mbID;
            //DataTable dt = dbUtil.MyFillTable(qryString);
            SqlDataReader drMbr = dbUtil.Select_DR(topCnt, fieldNames, this._tableJoin, whereClause, orderBy, Paging.Self.SetPagePortion(), subQryOrderBy);

            if (drMbr.HasRows)
            {
                this.dataGrid.DataSource = drMbr;
                dataGrid.DataKeyField    = "member_id";
                this.dataGrid.DataBind();               //바인딩하기 전에 drMbr.Read();하지 말것.

                //사라질것 사라지고 있어질것 있어져랑
                dataGrid.Visible = litPaging.Visible = true;
            }
            else
            {
                //사라질것 사라지고 있어질것 있어져랑
                dataGrid.Visible = litPaging.Visible = false;
                //에러유져컨트롤 바인딩
                ucMessage.LitMsgText = "자료가 없습니다.";
                if (Page.IsPostBack)
                {
                    ucMessage.LitDetailsText = ddlSelMenu.SelectedItem.Text + "의 ";
                    if (this.tbSearchString.Text != "")
                    {
                        ucMessage.LitDetailsText += "'" + this.ddlSearch.SelectedItem.Text + "'에서 '<b>"
                                                    + this.tbSearchString.Text + "</b>'으로 ";
                    }
                    ucMessage.LitDetailsText += "검색결과입니다.";
                }
            }
            ucMessage.Visible = !dataGrid.Visible;
            drMbr.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #5
0
        protected void StaffListBind()
        {
            DBLib dbUtil = new DBLib();
            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize(20);
            string fieldNames, whereClause;

            fieldNames  = "staff_id,sLoginID,staffNbr,sName,DeptName,sClass,phone,cellularP,sEmail,sBusinessPic,sLevel";
            whereClause = this.whereClause;

            //Response.Write("whereClause :" + whereClause + "<br>");
            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount(this.tableName, whereClause);

            //상관쿼리 설정, AbsolutePage와 같은 역활을 한다. 실 쿼리실행 이전에 설정해야 한다//Paging.Self.SetPagePortion();
            //실제쿼리실행
            SqlDataReader drStaff = dbUtil.Select_DR(topCnt, fieldNames, this.tableName, whereClause, this.orderBy, Paging.Self.SetPagePortion(), this.subQryOrderBy);

            if (drStaff.HasRows)
            {
                this.dataList.DataSource = drStaff;
                this.dataList.DataBind();               //바인딩하기 전에 drStaff.Read();하지 말것.

                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible   = true;
                litPaging.Visible  = true;
                ucMessage.Visible  = false;
                ibSendMail.Visible = true;
                hlPrint.Visible    = true;
            }
            else
            {
                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible   = false;
                litPaging.Visible  = false;
                ibSendMail.Visible = false;
                hlPrint.Visible    = false;
                //에러유져컨트롤 바인딩
                Literal lit        = (Literal)ucMessage.FindControl("litMsg");
                Literal litDetails = (Literal)ucMessage.FindControl("litDetails");
                lit.Text = "자료가 없습니다.";
                if (Page.IsPostBack)
                {
                    litDetails.Text = ddlSelMenu.SelectedItem.Text + "의 ";
                    if (this.tbSearchString.Text != "")
                    {
                        litDetails.Text += "'" + this.ddlSearch.SelectedItem.Text + "'에서 '<b>"
                                           + this.tbSearchString.Text + "</b>'으로 ";
                    }
                    litDetails.Text += "검색결과입니다.";
                }
                ucMessage.Visible = true;
            }
            drStaff.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #6
0
        //메뉴선택리스트 바인딩
        //private void SelMenuBind()
        //{
        //    //상품상태 셋팅
        //    //JinsLibrary.CONTROL.Util.DDLAddItem(ref ddlSelMenu, GdsCellBaseLib.Self.GetGSListItems());

        //}

        #region 상품리스트 바인딩
        protected void GoodsListBind()
        {
            DBLib dbUtil = new DBLib();
            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize(20);
            string fieldNames = "gCode_id,modelNbr,gName,Mfger,custPrice,newPrice,transPrice,joinPrice,USimmPrice";

            //Response.Write("whereClause :" + whereClause + "<br>");
            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount(GdsCellBaseLib.Self.GdsCellBiz.TableName, _whereClause);

            //상관쿼리 설정, AbsolutePage와 같은 역활을 한다. 실 쿼리실행 이전에 설정해야 한다//Paging.Self.SetPagePortion();
            //실제쿼리실행
            SqlDataReader drGds = dbUtil.Select_DR(topCnt, fieldNames, GdsCellBaseLib.Self.GdsCellBiz.TableName, _whereClause, _orderBy, Paging.Self.SetPagePortion(), _subQryOrderBy);

            CompanyItems_CIMasterPage master = this.Master;    //MainMasterPage master = (MainMasterPage)this.Master;

            if (drGds.HasRows)
            {
                this.dataList.DataSource = drGds;
                this.dataList.DataBind();               //바인딩하기 전에 drGds.Read();하지 말것.

                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible  = true;
                litPaging.Visible = true;
                //ucClientMessage.Visible = false;
                master.FindControl("ucClientMessage").Visible = false;
            }
            else
            {
                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible  = false;
                litPaging.Visible = false;

                //에러유져컨트롤 바인딩
                master.FindControl("ucClientMessage").Visible = true;
                master.LitMsgText     = "Goods Code Error!!";
                master.LitDetailsText = "요구하신 제품정보가 존재하지 않습니다.";
                master.HlBackVisible  = true;

                //Literal lit = (Literal)ucClientMessage.FindControl("litMsg");
                //Literal litDetails = (Literal)ucClientMessage.FindControl("litDetails");
                //lit.Text = "자료가 없습니다.";
                //ucClientMessage.Visible = true;
                if (Page.IsPostBack)
                {
                    //if (this.tbSearchString.Text != "")
                    //    litDetails.Text =  this.ddlSearch.SelectedItem.Text + "'에서 '<b>"
                    //        + this.tbSearchString.Text + "</b>'으로 ";
                    //litDetails.Text += "검색결과입니다.";
                }
            }
            drGds.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #7
0
        protected void DocListBind()
        {
            DBLib dbUtil = new DBLib();
            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize(20);

            string fieldNames, whereClause, orderBy;

            fieldNames  = "da_id,daCategory,daType,daName,daStatus,staff_id,ISNULL(daModifyDT, daRegisterDT) as docDay, DNSecurity, SLSecurity";
            whereClause = this.whereClause;
            orderBy     = "daType ASC, docDay DESC";
            string subQryOrderBy = "daType DESC, docDay ASC";                   //orderBy와 반대

            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount(this.tableName, whereClause);
            //상관쿼리 설정, AbsolutePage와 같은 역활을 한다. 실 쿼리실행 이전에 설정해야 한다//Paging.Self.SetPagePortion();
            //실제쿼리실행
            SqlDataReader drList = dbUtil.Select_DR(topCnt, fieldNames, this.tableName, whereClause, orderBy, Paging.Self.SetPagePortion(), subQryOrderBy);

            if (drList.HasRows)
            {
                //this.dataList.DataSource = drList;
                //this.dataList.DataBind();		//바인딩하기 전에 drList.Read();하지 말것.

                this.dataGrid.DataSource   = drList;
                this.dataGrid.DataKeyField = "da_id";
                this.dataGrid.DataBind();                               //바인딩하기 전에 drList.Read();하지 말것.

                #region 페이징기능구현
                //값을 지우고 다시 채워넣야~
                URLQuery.Self.SetQueryString();
                //Paging.Self.Init_Green();
                this.lbPaging.Text    = Paging.Self.GeneratePaging();
                this.lbListBrief.Text = Paging.Self.ListSummary;
                #endregion
                //사라질것 사라지고 있어질것 있어져랑
                lbInfoList.Visible  = false;
                lbListBrief.Visible = true;
                dataGrid.Visible    = true;
                lbPaging.Visible    = true;
            }
            else
            {
                //사라질것 사라지고 있어질것 있어져랑
                lbInfoList.Visible  = true;
                lbListBrief.Visible = false;
                dataGrid.Visible    = false;
                lbPaging.Visible    = false;
            }
            //HttpContext.Current.Response.Write("DBConnection=" + dbUtil.SqlConnection.);
            drList.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #8
0
        private void ViewPollResult()
        {
            //총득표수 셋팅
            //this.GetPollSum();
            this.pollSum = PollBaseLib.GetPollSum(this.poll_id);

            dbUtil = new DBLib();
            string fieldNames, tableName, whereClause, orderBy;

            fieldNames  = "exNbr,example,pPoint";
            tableName   = "t_PollEX";
            whereClause = "poll_id =" + this.poll_id;
            orderBy     = "exNbr";
            //실제쿼리실행
            drPoll = dbUtil.Select_DR(fieldNames, tableName, whereClause, orderBy);

            Table     pTable = new Table();
            TableRow  tRow;
            TableCell tCell;

            while (drPoll.Read())
            {
                tRow             = new TableRow();
                tCell            = new TableCell();
                tCell.ColumnSpan = 2;
                tCell.Text       = drPoll["exNbr"].ToString() + "." + drPoll["example"].ToString();
                //Create a new cell and add it to the row.//행만들기
                tRow.Cells.Add(tCell);
                pTable.Rows.Add(tRow);

                tRow        = new TableRow();
                tCell       = new TableCell();
                tCell.Width = Unit.Percentage(2);
                //tCell.BackColor = Color.LightGreen;
                tCell.Text = "&nbsp;";
                tRow.Cells.Add(tCell);

                tCell          = new TableCell();
                tCell.CssClass = "sTxt1";

                System.Web.UI.WebControls.Image imgBar = PollBaseLib.DrawGraph(Convert.ToInt32(drPoll["pPoint"]), this.pollSum);
                tCell.Controls.Add(imgBar);
                tCell.Controls.Add(new LiteralControl("&nbsp;" + imgBar.AlternateText));
                tRow.Cells.Add(tCell);

                pTable.Width       = Unit.Percentage(100);
                pTable.BorderWidth = 0;
                pTable.CellPadding = 0;
                pTable.CellSpacing = 0;
                pTable.Rows.Add(tRow);
            }
            drPoll.Close();
            pnViewResult.Controls.Add(pTable);
        }
Пример #9
0
        protected void MemberListBind()
        {
            DBLib dbUtil = new DBLib();
            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize(20);
            string fieldNames, whereClause, orderBy, subQryOrderBy;

            fieldNames    = "member_id,loginID,MbrName,MbrEmail,phone,cellularP,mLevel,HowMuch,HowMany,recentLogin";
            whereClause   = SetCondition();
            orderBy       = SetOrderBy();
            subQryOrderBy = orderBy.Replace("ASC", "\n").Replace("DESC", "ASC").Replace("\n", "DESC"); //orderBy와 반대	 //Response.Write("subQryOrderBy = " + subQryOrderBy + "<br/>");


            //Response.Write("whereClause :" + whereClause + "<br>");
            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount(this._tableName, whereClause);

            //상관쿼리 설정, AbsolutePage와 같은 역활을 한다. 실 쿼리실행 이전에 설정해야 한다//Paging.Self.SetPagePortion();
            //실제쿼리실행
            SqlDataReader drMbr = dbUtil.Select_DR(topCnt, fieldNames, _tableName, whereClause, orderBy, Paging.Self.SetPagePortion(), subQryOrderBy);

            if (drMbr.HasRows)
            {
                dataList.DataKeyField    = "member_id";
                this.dataList.DataSource = drMbr;
                this.dataList.DataBind();               //바인딩하기 전에 drMbr.Read();하지 말것.

                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible = litPaging.Visible = true;
            }
            else
            {
                //사라질것 사라지고 있어질것 있어져랑
                dataList.Visible = litPaging.Visible = false;
                //에러유져컨트롤 바인딩
                ucMessage.LitMsgText = "자료가 없습니다.";
                if (Page.IsPostBack)
                {
                    ucMessage.LitDetailsText = ddlSelMenu.SelectedItem.Text + "의 ";
                    if (this.tbSearchString.Text != "")
                    {
                        ucMessage.LitDetailsText += "'" + this.ddlSearch.SelectedItem.Text + "'에서 '<b>"
                                                    + this.tbSearchString.Text + "</b>'으로 ";
                    }
                    ucMessage.LitDetailsText += "검색결과입니다.";
                }
            }
            ucMessage.Visible = !dataList.Visible;

            drMbr.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #10
0
        protected void NewsListBind()
        {
            DBLib dbUtil = new DBLib();

            //페이지사이즈초기화
            int topCnt;

            topCnt = Paging.Self.PageSize();

            string fieldNames, tableName, whereClause, orderBy;

            fieldNames  = "bNews_id,bnsGroup,bnsTitle,ISNULL(modifyDT, writeDT) as newsDay,bnsOrder";
            tableName   = "t_BoardNews";
            whereClause = "bnsStatus > 1";
            if (bnsG != null)
            {
                whereClause += " AND bnsGroup ='" + bnsG + "'";
            }
            orderBy = "bnsOrder DESC,bNews_id DESC";
            //SqlDataReader drNews = dbUtil.Select_DR(topCnt,fieldNames,tableName,whereClause,orderBy);
            string subQryOrderBy = "bnsOrder ASC,bNews_id ASC";

            //총레코드수 저장
            Paging.Self.TotRecordCount = dbUtil.GetRecordCount("t_BoardNews", whereClause);
            //Paging.Self.SetPagePortion(); 상관쿼리 설정, AbsolutePage와 같은 역활을 한다. 실 쿼리실행 이전에 설정해야 한다
            //실제쿼리실행
            SqlDataReader drNews = dbUtil.Select_DR(topCnt, fieldNames, tableName, whereClause, orderBy, Paging.Self.SetPagePortion(), subQryOrderBy);

            //Response.End();

            if (drNews.HasRows)
            {
                this.dlNewsList.DataSource = drNews;
                this.dlNewsList.DataBind();

                #region 페이징기능구현
                //값을 지우고 다시 채워넣야~
                URLQuery.Self.SetQueryString();

                Paging.Self.Init_Violet();
                this.lbPaging.Text    = Paging.Self.GeneratePaging();
                this.lbListBrief.Text = Paging.Self.ListSummary;
                #endregion
            }
            else
            {
                lbNews.Visible = true;
            }
            drNews.Close();
            dbUtil.SqlConnection.Close();
        }
Пример #11
0
        public static SqlDataReader GetMember_idFromName(string MbrName, bool isActiveMbr)
        {
            string whereClause = "MbrName LIKE '%" + MbrName + "%'";

            if (isActiveMbr)
            {
                whereClause += " AND (retireDT Is Null OR retireDT = '')";
            }
            dbUtil = new DBLib();
            SqlDataReader dr = dbUtil.Select_DR("member_id", "t_Members", whereClause);

            //복수나올 가능성 때문에 dr로 넘김.
            return(dr);            //받는 쪽에서 닫아 줘야 함.
        }
Пример #12
0
        //member_id 받아서 회원이름 리턴
        public static string GetMbrName(object member_id)
        {
            string MbrName = "";

            //HttpContext.Current.Response.Write(member_id + "<br>");
            dbUtil = new DBLib();
            SqlDataReader dr = dbUtil.Select_DR("MbrName", "t_Members", "member_id=" + member_id);

            if (dr.Read())
            {
                MbrName = dr["MbrName"].ToString();
            }
            dr.Close();
            return(MbrName);
        }
Пример #13
0
        //member_id 받아서 회원아이디 리턴
        public static string GetLoginID(object member_id)
        {
            string loginID = "NoData";

            //HttpContext.Current.Response.Write(member_id + "<br>");
            dbUtil = new DBLib();
            SqlDataReader dr = dbUtil.Select_DR("loginID", "t_Members", "member_id= " + member_id);            //System.Convert.ToInt16

            if (dr.Read())
            {
                loginID = dr["loginID"].ToString();
            }
            dr.Close();
            return(loginID);
        }
Пример #14
0
        private Boolean LargeImageViewBind()
        {
            DBLib         dbUtil = new DBLib();
            SqlDataReader drLIV  = dbUtil.Select_DR("fileName,fileDESC", "t_GdsCellFiles", "gCode_id=" + gcID + " AND fileName LIKE 'S3%'", "fileDESC");

            if (drLIV.HasRows)
            {
                GdsUploadDir = SystemConfig.GetValue("GdsUploadDir") + "GC" + gcID + "/";
                this.rptThumbImg.DataSource = drLIV;
                this.rptThumbImg.DataBind();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #15
0
        //LoginID 받아서 member_id 리턴
        public static string GetMember_id(object loginID)
        {
            string member_id = null;

            dbUtil = new DBLib();
            SqlDataReader dr = dbUtil.Select_DR("member_id", "t_Members", "loginID= '" + loginID + "'");             //System.Convert.ToInt16

            while (dr.Read())
            {
                //충분히 복수 나옴.
                member_id += dr["member_id"].ToString() + "\n";
            }
            //DataReader와 DBConnection닫기
            dr.Close();
            dbUtil.SqlConnection.Close();
            if (member_id != null)
            {
                member_id = member_id.Substring(0, member_id.Length - 1);
            }
            //HttpContext.Current.Response.Write("member_id = " + member_id + "<br>");
            return(member_id);
        }
Пример #16
0
        private bool LoadPollMain()
        {
            dbUtil = new DBLib();

            string fieldNames, tableName, whereClause, orderBy;

            fieldNames   = "poll_id,pTopic";
            tableName    = "t_PollMain";
            whereClause  = "DATEDIFF(day, pBeginTime, '" + DateTime.Now.ToShortDateString() + "') >=0";
            whereClause += " AND DATEDIFF(day, pEndTime, '" + DateTime.Now.ToShortDateString() + "') <=0";
            //whereClause += " AND pEndTime >= '" + DateTime.Now.ToShortDateString() + "'";
            whereClause += " AND pDisplay = 1 AND IsStaff = 0";
            orderBy      = "poll_id DESC";

            //실제쿼리실행
            drPoll = dbUtil.Select_DR(1, fieldNames, tableName, whereClause, orderBy);
            //Response.End();

            if (drPoll.HasRows)
            {
                drPoll.Read();
                PostState.Self["poll_id"] = drPoll["poll_id"].ToString();
                this.poll_id = Convert.ToInt32(drPoll["poll_id"]);
                pTopic.Text  = drPoll["pTopic"].ToString();
                //쿠키표시된
                if (this.poll_id.ToString() != Cookie.Self["voted"])
                {
                    Cookie.Self.RemoveCookie("voted");
                }
                drPoll.Close();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #17
0
        private bool LoadPollMain()
        {
            dbUtil = new DBLib();

            string fieldNames, tableName, whereClause, orderBy;

            fieldNames   = "poll_id,pTopic,pBeginTime,pEndTime";
            tableName    = "t_PollMain";
            whereClause  = "DATEDIFF(day, pBeginTime, '" + DateTime.Now.ToShortDateString() + "') >=0";
            whereClause += " AND DATEDIFF(day, pEndTime, '" + DateTime.Now.ToShortDateString() + "') <=0";
            whereClause += " AND pDisplay = 1 AND IsStaff = 0";
            whereClause += " AND poll_id = " + this.poll_id;
            orderBy      = "poll_id DESC";

            //실제쿼리실행
            drPoll = dbUtil.Select_DR(1, fieldNames, tableName, whereClause, orderBy);
            //Response.End();

            if (drPoll.HasRows)
            {
                drPoll.Read();
                PostState.Self["poll_id"] = drPoll["poll_id"].ToString();
                this.poll_id = Convert.ToInt32(drPoll["poll_id"]);
                pTopic.Text  = drPoll["pTopic"].ToString();
                //기간세팅
                period.Text = PollBaseLib.GetPeriod(drPoll["pBeginTime"], drPoll["pEndTime"]);
                drPoll.Close();
                return(true);
            }
            else
            {
                PostState.Self["poll_id"] = 0;
                pTopic.Text = "현재 진행하고 있지 않습니다.";
                return(false);
            }
        }
Пример #18
0
 //회원데이터 삭제
 public static void DeleteMember(string mode, string member_id)
 {
     dbUtil = new DBLib();
     //(실제로 업데이트)
     if (mode == "d")
     {
         string[] setNameValue = new string[2]
         {
             "leaveDT=GetDate()", "IPaddress = '" + WebUtil.CurrentRequest.UserHostAddress + "_" + Cookie.Self["sLoginID"] + "'"
         };
         dbUtil.Update_EN("t_MemberValue", setNameValue, "member_id = " + member_id);
     }
     else if (mode == "dd")              //게시물 영구삭제(실제삭제)
     {
         MbrFilesMoveTo(member_id, dbUtil.Select_DR("avataImage", "t_MemberOption", "member_id=" + member_id));
         dbUtil.Delete_EN("t_MemberJob", "member_id = " + member_id);
         dbUtil.Delete_EN("t_MemberOption", "member_id = " + member_id);
         dbUtil.Delete_EN("t_MemberValue", "member_id = " + member_id);
         dbUtil.Delete_EN("t_Members", "member_id = " + member_id);
     }
     dbUtil.SqlConnection.Close();
     URLQuery.Self.Remove("mode");
     HttpContext.Current.Response.Redirect(whichList + "?" + URLQuery.Self.GetQueryString());
 }
Пример #19
0
        private void ViewPollResult()
        {
            //총득표수 셋팅
            //this.GetPollSum();
            this.pollSum = PollBaseLib.GetPollSum(this.poll_id);

            dbUtil = new DBLib();
            string fieldNames, tableName, whereClause, orderBy;

            fieldNames  = "exNbr,example,pPoint";
            tableName   = "t_PollEX";
            whereClause = "poll_id =" + this.poll_id;
            orderBy     = "exNbr";
            //실제쿼리실행
            drPoll = dbUtil.Select_DR(fieldNames, tableName, whereClause, orderBy);

            Table     pTable = new Table();
            TableRow  tRow;
            TableCell tCell;

            pTable.Width       = Unit.Percentage(100);
            pTable.BorderWidth = 1;
            pTable.BorderStyle = BorderStyle.Solid;
            pTable.BorderColor = Color.LightBlue;
            pTable.CellPadding = 1;
            pTable.CellSpacing = 2;


            tRow = new TableRow();
            tRow.HorizontalAlign = HorizontalAlign.Center;
            tRow.Height          = 30;
            tRow.BackColor       = JinsLibrary.IMAGE.ImageLib.Self.ColorFromArgb("d2", "f1", "ff");             //Color.FromArgb(Convert.ToInt32("d2",16),Convert.ToInt32("f1",16) ,Convert.ToInt32("ff",16));

            tCell          = new TableCell();
            tCell.CssClass = "header";
            tCell.Text     = "예문";
            tRow.Cells.Add(tCell);
            tCell          = new TableCell();
            tCell.CssClass = "header";
            tCell.Width    = 50;
            tCell.Text     = "득표수";
            tRow.Cells.Add(tCell);
            tCell          = new TableCell();
            tCell.CssClass = "header";
            tCell.Text     = "그래프";
            tRow.Cells.Add(tCell);
            pTable.Rows.Add(tRow);

            while (drPoll.Read())
            {
                tRow       = new TableRow();
                tCell      = new TableCell();
                tCell.Text = "&nbsp;" + drPoll["exNbr"].ToString() + "." + drPoll["example"].ToString();
                tRow.Cells.Add(tCell);

                tCell                 = new TableCell();
                tCell.BackColor       = JinsLibrary.IMAGE.ImageLib.Self.ColorFromArgb("f4", "fc", "ff");
                tCell.Text            = drPoll["pPoint"].ToString() + " 표";
                tCell.HorizontalAlign = HorizontalAlign.Center;
                tRow.Cells.Add(tCell);

                tCell = new TableCell();
                System.Web.UI.WebControls.Image imgBar = PollBaseLib.DrawGraph(Convert.ToInt32(drPoll["pPoint"]), this.pollSum);
                tCell.Controls.Add(imgBar);
                tCell.Controls.Add(new LiteralControl("&nbsp;" + imgBar.AlternateText));
                tRow.Cells.Add(tCell);

                pTable.Rows.Add(tRow);
            }
            tRow                 = new TableRow();
            tRow.BackColor       = JinsLibrary.IMAGE.ImageLib.Self.ColorFromArgb("d2", "f1", "ff");
            tCell                = new TableCell();
            tRow.Height          = 20;
            tCell.ColumnSpan     = 3;
            tRow.HorizontalAlign = HorizontalAlign.Center;
            tCell.Text           = "[총득표수 : " + this.pollSum.ToString() + "표]";
            tRow.Cells.Add(tCell);
            pTable.Rows.Add(tRow);

            drPoll.Close();
            phViewResult.Controls.Add(pTable);
        }