当前位置: 首页>>代码示例>>C#>>正文


C# Data.GetDataDV方法代码示例

本文整理汇总了C#中Data.GetDataDV方法的典型用法代码示例。如果您正苦于以下问题:C# Data.GetDataDV方法的具体用法?C# Data.GetDataDV怎么用?C# Data.GetDataDV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Data的用法示例。


在下文中一共展示了Data.GetDataDV方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetVenueEvents

    protected DataView GetVenueEvents()
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        string id = Request.QueryString["ID"].ToString();

        DataView dvNormal = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
            "[End], E.Header, CONVERT(NVARCHAR,E.ID)+';E;'+CONVERT(NVARCHAR,EO.ID) AS ID, V.Name "+
            "FROM Event_Occurance EO, Events E, Venues " +
            "V WHERE EO.EventID=E.ID AND E.Venue=V.ID AND V.ID=" + id);

        DataView dvGroupPublic = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
            "[End], E.Name AS Header, CONVERT(NVARCHAR,E.ID)+';G;'+CONVERT(NVARCHAR,EO.ID) AS ID, EO.ID "+
            "AS ReoccurrID, V.Name FROM GroupEvent_Occurance EO, GroupEvents E, Venues " +
            "V WHERE E.EventType='1' AND EO.GroupEventID=E.ID AND EO.VenueID=V.ID AND V.ID=" + id);

        DataView dvGroupInvited = new DataView();
        if (Session["User"] != null)
        {
            dvGroupInvited = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
            "[End], E.Name AS Header,  CONVERT(NVARCHAR,E.ID)+';G;'+CONVERT(NVARCHAR,EO.ID) AS ID, EO.ID " +
            "AS ReoccurrID, V.Name FROM GroupEvent_Occurance EO, GroupEvents E, GroupEvent_Members GEM, Venues " +
            "V WHERE E.EventType <> '1' AND GEM.UserID=" + Session["User"].ToString() + " AND GEM.GroupEventID=E.ID AND GEM.ReoccurrID=EO.ID " +
            "AND EO.GroupEventID=E.ID AND EO.VenueID=V.ID AND V.ID=" + id);
        }

        return MergeDV(MergeDV(dvGroupPublic, dvGroupInvited), dvNormal);
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:35,代码来源:VenueCalendar.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            HtmlMeta hm = new HtmlMeta();
            HtmlHead head = (HtmlHead)Page.Header;
            hm.Name = "ROBOTS";
            hm.Content = "NOINDEX, FOLLOW";
            head.Controls.AddAt(0, hm);
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            DataView dvGroupEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" + Request.QueryString["ID"].ToString());
            ImageButton9.OnClientClick = "javascript:Search('" +
                dat.MakeNiceName(dvGroupEvent[0]["Name"].ToString()) + "_" + Request.QueryString["O"].ToString() + "_" +
                Request.QueryString["ID"].ToString() + "_GroupEvent');";

            string groupID = Request.QueryString["ID"].ToString();
            string command = "SELECT * FROM Group_Members WHERE GroupID=" +
               dvGroupEvent[0]["GroupID"].ToString() + " AND MemberID=" + Session["User"].ToString();
            DataView dvMembers = dat.GetDataDV(command);
            if (bool.Parse(dvMembers[0]["SharedHosting"].ToString()))
            {
                HostPanel.Visible = true;
            }
            else
                HostPanel.Visible = false;
        }
        catch (Exception ex)
        {
            ErrorLabel.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:33,代码来源:PostEventComment.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        //Ajax.Utility.RegisterTypeForAjax(typeof(Delete));
        if (!IsPostBack)
        {
            string cookieName = FormsAuthentication.FormsCookieName;
            HttpCookie authCookie = Context.Request.Cookies[cookieName];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            DataView dvEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" +
                Request.QueryString["ID"].ToString());
            string groupID = dvEvent[0]["GroupID"].ToString();
            DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID=" + groupID);
            ImageButton9.OnClientClick = "Search('" + dat.MakeNiceName(dvGroup[0]["Header"].ToString()) + "_" + groupID + "_Group');";

            TextLabel.Text = "Are you sure you want to delete the event '" + dvEvent[0]["Name"].ToString() +
                "' from the group '" + dvGroup[0]["Header"].ToString() + "'";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:32,代码来源:DeleteGroupEvent.aspx.cs

示例4: CheckAndInsert

    protected void CheckAndInsert(string header, string description, string date, string images, string VenueID, string categories, string URL)
    {
        Data dat = new Data(DateTime.Now);

        //Check whether event exists in database
        DateTime dStart = DateTime.Parse(date);
        DataView dvEvent = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE E.Venue=" + VenueID +
            " AND E.Header='" + header + "' AND E.ID=EO.EventID AND EO.DateTimeStart = CONVERT(DATETIME, '" + dStart.ToString() + "')");
        //Insert if does not exist
        if (dvEvent.Count == 0)
        {
            DataView dvVenue = dat.GetDataDV("SELECT country, city, state, zip, address FROM Venues WHERE ID=" + VenueID);
            string country = dvVenue[0]["country"].ToString();
            string city = dvVenue[0]["city"].ToString();
            string state = dvVenue[0]["state"].ToString();
            string zip = dvVenue[0]["zip"].ToString();
            string address = dvVenue[0]["address"].ToString();

            string mediaCat = "0";
            if (images != "")
                mediaCat = "1";

            if (description.Length > 500)
                description = description.Substring(0, 500) + "... " + URL;

            dvEvent = dat.GetDataDV("INSERT INTO Events (PostedOn, LastEditOn, UserName, Venue, Header, [Content], StarRating, hasSongs, mediaCategory, " +
                "city, country, state, zip, address) VALUES ('" + DateTime.Now.ToString() + "', '" + DateTime.Now.ToString() + "', 'aleksczajka', " +
                VenueID + ", '" + header +
                "', '" + description.Replace("'", "''").Replace("\\", "\\\\") + "', 0, 'False', " + mediaCat + ", '" + city + "', " +
                country + ", '" + state + "', '" + zip + "', '" + address + "')  SELECT @@IDENTITY AS 'Identity'");

            string theID = dvEvent[0]["Identity"].ToString();

            //Insert date and time
            dat.Execute("INSERT INTO Event_Occurance (EventID, DateTimeStart, DateTimeEnd) VALUES (" + theID + ", '" +
                dStart.ToString() + "', '" + dStart.AddHours(2.00).ToString() + "')");

            //Insert categories
            string[] delim = { ";" };
            string[] tokens = categories.Split(delim, StringSplitOptions.RemoveEmptyEntries);
            foreach (string token in tokens)
            {
                dat.Execute("INSERT INTO Event_Category_Mapping (CategoryID, EventID, tagSize) VALUES (" + token + ", '" +
                    theID + "', 22)");
            }

            //Insert Images
            string[] imgDelim = { "^" };
            if (images != "")
            {
                string[] imgTokens = images.Split(imgDelim, StringSplitOptions.RemoveEmptyEntries);
                foreach (string token in imgTokens)
                {
                    dat.Execute("INSERT INTO Event_Slider_Mapping (EventID, PictureName, RealPictureName, " +
                        "ImgPathAbsolute) VALUES(" + theID + ", '" + token + "', '" + token + "', 'True')");
                }
            }
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:59,代码来源:RSSInput.aspx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HtmlLink lk = new HtmlLink();
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/HippoPointsEdit.aspx";
        head.Controls.AddAt(0, lk);

        UploadButton.SERVER_CLICK += UploadPick;
        PictureNixItButton.SERVER_CLICK += NixIt;
        BlueButton2.SERVER_CLICK += Save;

        ErrorLabel.Text = "";

        Literal lit = new Literal();
        lit.Text = dat.GetDataDV("SELECT * FROM HippoPointsConditions")[0]["Content"].ToString();

        TACTextBox.Controls.Add(lit);

        if (!IsPostBack)
        {
            DataView dvUser = dat.GetDataDV("SELECT * FROM UserPreferences UP WHERE UP.UserID=" + Session["User"].ToString());

            if(dvUser[0]["MayorText"].ToString().Trim() != "")
                DescriptionTextBox.Text = dvUser[0]["MayorText"].ToString();

            Checkbox1.Checked = bool.Parse(dvUser[0]["Mayors"].ToString());

            if (dvUser[0]["PictureName"].ToString().Trim() != "")
            {
                TheImage.ImageUrl = dvUser[0]["PictureName"].ToString();
                PictureNixItButton.Visible = true;
            }

            if (dvUser[0]["MayorLink"].ToString().Trim() != "")
            {
                LinkTextBox.Text = dvUser[0]["MayorLink"].ToString();
            }
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:55,代码来源:HippoPointsEdit.aspx.cs

示例6: AutomaticJoin

    protected void AutomaticJoin(object sender, EventArgs e)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            string shared = "False";
            string title = "";
            string prefs = "124";
            DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE AutomaticHost='True' " +
                "AND ID=" + Request.QueryString["ID"]);

            if (dvGroup.Count > 0)
            {
                shared = "True";
                title = "Shared Host";
                prefs = "12345";
            }

            dat.Execute("INSERT INTO Group_Members (GroupID, MemberID, Title, SharedHosting, Accepted, Prefs) " +
                "VALUES(" + Request.QueryString["ID"] + ", " + Session["User"].ToString() +
                ", '" + title + "', '" + shared + "', 'True', " + prefs + ")");

            AutomaticPanel.Visible = false;
            ThankYouPanel.Visible = true;
        }
        catch (Exception ex)
        {
            Label1.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:32,代码来源:JoinUs.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        if (Session["User"] == null)
        {
            Response.Redirect("~/Home.aspx");

        }

        if (Request.QueryString["ID"] == null)
            Response.Redirect("Home.aspx");

        if (dat.HasEventPassed(Request.QueryString["ID"].ToString()))
        {
            DataView dvName = dat.GetDataDV("SELECT * FROM Events WHERE ID="+
                Request.QueryString["ID"].ToString());
            Response.Redirect(dat.MakeNiceName(dvName[0]["Header"].ToString()) + "_" +
                Request.QueryString["ID"].ToString() + "_Event");
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:28,代码来源:EditEvent.aspx.cs

示例8: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID="+Request.QueryString["ID"].ToString());
        if (dvGroup[0]["Host"].ToString() == Session["User"].ToString())
        {
            TheLabel.Text = "Since you are the primary host of the group, you must first designate another host for the group. Go to your group's home page and click on 'Edit Members' Prefs'.";
            Button3.Visible = false;
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:25,代码来源:RevokeMembership.aspx.cs

示例9: DrawEvents

    protected void DrawEvents(DataView dvEvents, int cutOff)
    {
        string eventID = GetEventID();
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        Literal lit = new Literal();

        int count = 0;
        DataView dvEvent;
        string contentSub = "";
        foreach (DataRowView row in dvEvents)
        {
            if (count > cutOff - 1)
            {
                break;
            }
            else
            {
                contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", ""));
                if (dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", "")).Length > 100)
                    contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                        "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                        "").Replace("<br />", "").Replace("<BR />", "")).Substring(0, 100);
                dvEvent = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE E.ID=EO.EventID AND E.ID=" + row["EventID"].ToString());
                lit.Text += "<div class=\"SimilarSide\">";
                lit.Text += "<a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["EventID"].ToString() + "_Event\">" + row["Header"].ToString() +
                    "</a> at " + "<a class=\"Green12LinkNF\" href=\"" + dat.MakeNiceName(row["Name"].ToString()) +
                    "_" + row["Venue"].ToString() + "_Venue\">" + row["Name"].ToString() + "</a> on " +
                    DateTime.Parse(dvEvent[0]["DateTimeStart"].ToString()).ToShortDateString() +
                    ". " + dat.BreakUpString(contentSub, 30) +
                    "... <a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["EventID"].ToString() + "_Event\">Read More</a>";
                lit.Text += "</div>";
                count++;
            }
        }

        OtherEventsPanel.Controls.Add(lit);
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:53,代码来源:Event.aspx.cs

示例10: CheckMayors

    protected void CheckMayors()
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
        Data dat = new Data(isNow);
        string thisMonth = isNow.Month.ToString() + "/1/" + isNow.Year.ToString();
        string userID = Request.QueryString["ID"].ToString();
        DataView dvUser = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + userID);
        DataView dv = dat.GetDataDV("SELECT * FROM UserPreferences WHERE UserID=" + userID);

        //Happenings
        DataView dvEventCount = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Events WHERE UserName='" + dvUser[0]["UserName"].ToString() + "'");

        DataView dvEventCountLast = dat.GetDataDV("SELECT COUNT(*) AS count FROM Events WHERE PostedOn >= CONVERT(DATETIME,'" +
            thisMonth + "') AND UserName='" + dvUser[0]["UserName"].ToString() + "'");
        NumEventsLabel.Text = "<span class=\"TextNormal Friend20\">" + dvEventCount[0]["count"].ToString() +
            "</span> Happenings. <span class=\"TextNormal Friend20\">" + dvEventCountLast[0]["count"].ToString() +
            "</span> This Month.";

        //Trips
        dvEventCount = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Trips WHERE UserName='" + dvUser[0]["UserName"].ToString() + "'");

        dvEventCountLast = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Trips WHERE PostedOn >= CONVERT(DATETIME,'" +
            thisMonth + "') AND UserName='" + dvUser[0]["UserName"].ToString() + "'");
        NumTripsLabel.Text = "<span class=\"TextNormal Friend20\">" + dvEventCount[0]["count"].ToString() +
            "</span> Trips. <span class=\"TextNormal Friend20\">" + dvEventCountLast[0]["count"].ToString() +
            "</span> This Month.";

        //Locales
        dvEventCount = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Venues WHERE CreatedByUser=" + userID);

        dvEventCountLast = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Venues WHERE PostedOn >= CONVERT(DATETIME,'" +
            thisMonth + "') AND CreatedByUser=" + userID);
        NumLocalesLabel.Text = "<span class=\"TextNormal Friend20\">" + dvEventCount[0]["count"].ToString() +
            "</span> Locales. <span class=\"TextNormal Friend20\">" + dvEventCountLast[0]["count"].ToString() +
            "</span> This Month.";

        //Ads
        dvEventCount = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Ads WHERE User_ID=" + userID);

        dvEventCountLast = dat.GetDataDV("SELECT COUNT(*) AS count  FROM Ads WHERE DateAdded >= CONVERT(DATETIME,'" +
            thisMonth + "') AND User_ID=" + userID);
        NumAdsLabel.Text = "<span class=\"TextNormal Friend20\">" + dvEventCount[0]["count"].ToString() +
            "</span> Bulletins. <span class=\"TextNormal Friend20\">" + dvEventCountLast[0]["count"].ToString() +
            "</span> This Month.";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:46,代码来源:Friend.aspx.cs

示例11: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.Date.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")")));

        DataView dv = dat.GetDataDV("SELECT * FROM TermsAndConditions");

        testLit.Text = dv[0]["Content"].ToString();
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:16,代码来源:TermsAndConditions.aspx.cs

示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        DataView dvGroupEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" +
            Request.QueryString["ID"].ToString());

        ImageButton9.OnClientClick = "javascript:Search('" +
            dat.MakeNiceName(dvGroupEvent[0]["Name"].ToString()) + "_" + Request.QueryString["O"].ToString() + "_" +
            Request.QueryString["ID"].ToString() + "_GroupEvent');";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:17,代码来源:RemoveEventSticky.aspx.cs

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        ImageButton9.OnClientClick = "javascript:Search('Group.aspx?ID=" +
            Request.QueryString["ID"].ToString() + "');";

        DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE AutomaticAccept='True' "+
            "AND ID=" + Request.QueryString["ID"]);

        if (Session["User"] == null)
        {
            RemovePanel.Visible = false;
            NotSignedInPanel.Visible = true;
            AutomaticPanel.Visible = false;
        }
        else
        {

            if (dvGroup.Count == 0)
            {

                NotSignedInPanel.Visible = false;
                RemovePanel.Visible = true;
                AutomaticPanel.Visible = false;
            }
            else
            {
                ThankYouLabel.Text = "You have joined the group.";
                AutomaticPanel.Visible = true;
                NotSignedInPanel.Visible = false;
                RemovePanel.Visible = false;
            }
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:42,代码来源:JoinUs.aspx.cs

示例14: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        DataView dvGroup = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + Request.QueryString["ID"].ToString());

        TheLabel.Text = " Are you sure you want to remove your friend '" + dvGroup[0]["UserName"].ToString() + "'?";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:22,代码来源:RemoveFriend.aspx.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.Date.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")")));

        DataView dv = dat.GetDataDV("SELECT * FROM TermsAndConditions");

        testLit.Text = dv[0]["Content"].ToString();
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:22,代码来源:TermsAndConditionsOpen.aspx.cs


注:本文中的Data.GetDataDV方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。