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


C# Data.StripHTML_LeaveLinks方法代码示例

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


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

示例1: OnwardsIT


//.........这里部分代码省略.........
                        if (StateDropDownPanel.Visible)
                            state = StateDropDown.SelectedItem.Text;
                        else
                            state = StateTextBox.THE_TEXT;

                        SqlCommand cmd = new SqlCommand("SELECT * FROM Venues WHERE [email protected] AND [email protected] AND [email protected]", conn);
                        cmd.Parameters.Add("@address", SqlDbType.NVarChar).Value = locationStr;
                        cmd.Parameters.Add("@city", SqlDbType.NVarChar).Value = CityTextBox.Text.Trim().ToLower();
                        cmd.Parameters.Add("@state", SqlDbType.NVarChar).Value = state;
                        DataSet ds = new DataSet();
                        SqlDataAdapter da = new SqlDataAdapter(cmd);
                        da.Fill(ds);

                        if (ds.Tables.Count > 0)
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                MessagePanel.Visible = true;
                                YourMessagesLabel.Text += "<br/><br/>A venue already exists under this address. " +
                                    "Please take a look at it " +
                                    "<a target=\"_blank\" class=\"AddGreenLink\" href=\"" + dat.MakeNiceName(VenueNameTextBox.THE_TEXT) + "_" +
                                    ds.Tables[0].Rows[0]["ID"].ToString() + "_Venue\">here.</a> You can submit edits to the existing venue by licking on the 'Edit Venue' link at the top of the venue page.";
                                goOn = false;
                            }
                    }

                    if (goOn)
                    {
                        if(changeTab)
                            ChangeSelectedTab(0, 1);

                        FillLiteral();
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    MessagePanel.Visible = true;
                    YourMessagesLabel.Text += "<br/><br/>*Please fill in all fields.";
                }
                return false;
                #endregion
                break;
            case 1:
                DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                if (DescriptionTextBox.Text.Length >= 50)
                {
                    if(changeTab)
                        ChangeSelectedTab(1, 2);

                    FillLiteral();
                    return true;
                }
                else
                {
                    MessagePanel.Visible = true;
                    YourMessagesLabel.Text += "<br/><br/>*Make sure you say what you want your viewers to hear about this venue! The description must be at least 50 characters.";
                    return false;
                }
                break;
            case 2:
                if(Session["CategoriesSet"] == null && Request.QueryString["ID"] != null)
                    SetCategories();

                if (changeTab)
                {
                    ChangeSelectedTab(2, 3);

                }
                FillLiteral();
                return true;
                break;
            case 3:
                if (CategorySelected())
                {
                    FillLiteral();

                    bool isownerupforgrabs = false;
                    EnableOwnerPanel(ref isownerupforgrabs);

                    if(changeTab)
                        ChangeSelectedTab(3, 4);

                    return true;
                }
                else
                {
                    MessagePanel.Visible = true;
                    YourMessagesLabel.Text = "Must include at least one category.";
                    return false;
                }
                break;
            default: break;
        }

        return false;
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterVenue.aspx.cs

示例2: OnwardsIT

    protected bool OnwardsIT(bool changeTab, int selectedIndex)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        try
        {
            YourMessagesLabel.Text = "";
            MessagePanel.Visible = false;

            Session["PrevTab"] = selectedIndex;
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            switch (selectedIndex)
            {
                case 0:
                    #region First Tab
                    DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                    AdNameTextBox.THE_TEXT = dat.stripHTML(AdNameTextBox.THE_TEXT);
                    if (AdNameTextBox.THE_TEXT.Trim().Length != 0)
                    {
                        if (DescriptionTextBox.Text.Length <= 1000)
                        {
                            if (StartDateTimePicker.DbSelectedDate != null)
                            {
                                if ((DateTime)StartDateTimePicker.DbSelectedDate < DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")).Date)
                                {
                                    YourMessagesLabel.Text += "<br/><br/>*The start date cannot be before today.";
                                    MessagePanel.Visible = true;
                                    AdTabStrip.SelectedIndex = 0;
                                    AdPostPages.PageViews[0].Selected = true;
                                    return false;
                                }
                                else
                                {
                                    if(changeTab)
                                        ChangeSelectedTab(0, 1);
                                    MessagePanel.Visible = false;
                                    FillLiteral();
                                    return true;
                                }

                            }
                            else
                            {
                                YourMessagesLabel.Text += "<br/><br/>*All date fields are required.";
                                MessagePanel.Visible = true;
                                AdTabStrip.SelectedIndex = 0;
                                AdPostPages.PageViews[0].Selected = true;
                                return false;
                            }
                        }
                        else
                        {
                            YourMessagesLabel.Text += "<br/><br/>*The description must be less than or equal to 1000 characters.";
                            MessagePanel.Visible = true;
                            AdTabStrip.SelectedIndex = 0;
                            AdPostPages.PageViews[0].Selected = true;
                            return false;
                        }
                    }
                    else
                    {
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "<br/><br/>*Must include a Headline.";
                        if (DescriptionTextBox.Content.Length < 100)
                            YourMessagesLabel.Text += "<br/><br/>*Make sure you say what you want your viewers to hear about your advertisment! The description must be at least 100 characters.";
                        AdTabStrip.SelectedIndex = 0;
                        AdPostPages.PageViews[0].Selected = true;
                        return false;
                    }

                    return false;
                    #endregion
                    break;
                case 1:
                    if (bool.Parse(isFeatured.Text))
                    {
                        FeaturedAdMediaPanel.Visible = true;
                    }
                    else
                    {
                        FeaturedAdMediaPanel.Visible = false;
                    }
                    if(changeTab)
                        ChangeSelectedTab(1, 2);
                    MessagePanel.Visible = false;
                    FillLiteral();
                    return true;
                    break;
                case 2:
                    #region Third Tab
                    bool goOn = false;
                    if (bool.Parse(isFeatured.Text))
                    {
                        SummaryTextBox.InnerHtml = dat.StripHTML_LeaveLinksNoBr(SummaryTextBox.InnerHtml);
                    }
                        bool isEditing = false;
                        if (isEdit.Text.Trim() != "")
                            if (bool.Parse(isEdit.Text))
                                isEditing = true;
                        if (isEditing && Session["categorySession"] == null)
                        {
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:PostAnAd.aspx.cs

示例3: SuggestCategoryClick

    protected void SuggestCategoryClick(object sender, EventArgs e)
    {
        if (CategoriesTextBox.Text.Trim() != "")
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            MessagePanel.Visible = true;
            CategoriesTextBox.Text = dat.stripHTML(CategoriesTextBox.Text.Trim());

            YourMessagesLabel.Text = "<br/><br/>Your category '" + CategoriesTextBox.Text +
                "' has been suggested. We'll send you an update when it has been approved.";

            CategoriesTextBox.Text = dat.StripHTML_LeaveLinks(CategoriesTextBox.Text);

            DataSet dsUser = dat.GetData("SELECT EMAIL, UserName FROM USERS WHERE User_ID=" +
                Session["User"].ToString());

            dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["categoryemail"].ToString(),
                        System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["categoryemail"].ToString(),
                "Category has been suggested from 'EnterVenue.aspx'. The user ID who suggested " +
                "the category is userID: '" + Session["User"].ToString() + "'. The category suggestion is '" + CategoriesTextBox.Text + "'", "Hippo Happenings category suggestion");
            CategoriesTextBox.Text = "";
        }
        else
        {
            MessagePanel.Visible = true;
            YourMessagesLabel.Text = "<br/><br/>Please enter a category to suggest.";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:30,代码来源:EnterVenue.aspx.cs

示例4: OnwardsIT

    protected bool OnwardsIT(bool changeTab, int selectedIndex)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];

            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
            conn.Open();
            string message = "";
            bool goOn = false;
            switch (selectedIndex)
            {
                case 0:
                    #region Case 0

                    bool hasLocation = false;
                    if (DateSelectionsListBox.Items.Count > 0)
                        hasLocation = true;

                    DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>",
                        "<br/>").Replace("</div>", ""));

                    if (hasLocation)
                    {
                        VenueNameTextBox.THE_TEXT = dat.stripHTML(VenueNameTextBox.THE_TEXT);
                        DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>",
                            "<br/>").Replace("</div>", ""));

                        if (VenueNameTextBox.THE_TEXT.Trim() != "" && DescriptionTextBox.Text.Trim() != "")
                        {
                            if (DescriptionTextBox.Text.Length <= 420)
                            {
                                if (VenueNameTextBox.THE_TEXT.Trim().Length <= 70)
                                {
                                    if (changeTab)
                                        ChangeSelectedTab(0, 1);

                                    return true;
                                }
                                else
                                {
                                    MessagePanel.Visible = true;
                                    YourMessagesLabel.Text += "<br/><br/>*Group Event Name be under 70 characters.";
                                }
                            }
                            else
                            {
                                MessagePanel.Visible = true;
                                YourMessagesLabel.Text += "<br/><br/>*Description must be under 420 characters.";
                            }

                        }
                        else
                        {
                            MessagePanel.Visible = true;
                            YourMessagesLabel.Text += "<br/><br/>*Please fill in all required fields.";
                        }
                    }
                    else
                    {
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "<br/><br/>*Please specify date and location.";

                    }
                    return false;
                    #endregion
                    break;
                case 1:
                    if (changeTab)
                    {
                        ChangeSelectedTab(1, 2);
                    }
                    return true;
                    break;
                case 2:
                    if (changeTab)
                    {
                        ChangeSelectedTab(2, 3);

                    }
                    return true;
                    break;
                case 3:
                    goOn = false;
                    if (ParticipantsList.SelectedIndex != -1)
                    {
                        if (ParticipantsList.SelectedValue == "3" && GroupMembersSelectedListBox.Items.Count == 0)
                            message = "Please select the members for your Exclusive Event type.";
                        else
                        {
                            if (RagistrationRadioList.SelectedIndex != -1)
                            {
                                if (RagistrationRadioList.SelectedValue == "2" && NumRegTextBox.Text.Trim() == ""
                                    && DeadlineDatePicker.SelectedDate == null)
                                {
                                    message = "Please select either the limit of users or deadline for the Limited Registration Type.";
                                }
                                else
                                    goOn = true;
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterGroupEvent.aspx.cs

示例5: OnwardsIT

    protected bool OnwardsIT(bool changeTab, int selectedIndex)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];

            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
            conn.Open();
            string message = "";

            switch (selectedIndex)
            {
                case 0:
                    #region Case 0

                    bool goOn = false;

                    bool isInternational = false;
                    string locationStr = "";

                    VenueNameTextBox.THE_TEXT = dat.stripHTML(VenueNameTextBox.THE_TEXT);
                    DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));

                    if (VenueNameTextBox.THE_TEXT.Trim() != "" && DescriptionTextBox.Text.Trim() != "")
                    {
                        bool isUpdate = false;
                        if (Request.QueryString["ID"] != null)
                        {
                            isUpdate = true;
                        }

                        if (DescriptionTextBox.Text.Length <= 420)
                        {
                            if (VenueNameTextBox.THE_TEXT.Trim().Length <= 70)
                            {
                                if (changeTab)
                                    ChangeSelectedTab(0, 1);

                                return true;
                            }
                            else
                            {
                                MessagePanel.Visible = true;
                                YourMessagesLabel.Text += "<br/><br/>*Group Name be under 70 characters.";
                            }
                        }
                        else
                        {
                            MessagePanel.Visible = true;
                            YourMessagesLabel.Text += "<br/><br/>*Description must be under 420 characters.";
                        }

                    }
                    else
                    {
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "<br/><br/>*Please fill in all required fields.";
                    }
                    return false;
                    #endregion
                    break;
                case 1:

                    bool goon = true;
                    HostInstructions.Content = dat.StripHTML_LeaveLinks(HostInstructions.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                    if (HostInstructions.Text.Length > 300)
                    {
                        message = "Host's instructions must be less than 300 characters.";
                        goon = false;
                    }

                    if (goon)
                    {
                        CityTextBox.Text = dat.stripHTML(CityTextBox.Text);
                        ZipTextBox.Text = dat.stripHTML(ZipTextBox.Text);
                        LocationTextBox.Text = dat.stripHTML(LocationTextBox.Text.Trim());
                        PhoneTextBox.Text = dat.stripHTML(PhoneTextBox.Text.Trim());
                        EmailTextBox.Text = dat.stripHTML(EmailTextBox.Text.Trim());
                        WebSiteTextBox.Text = dat.stripHTML(WebSiteTextBox.Text.Trim());
                        string state = "";
                        if (StateTextBox.Visible)
                            state = dat.stripHTML(StateTextBox.THE_TEXT.Trim());
                        else
                        {
                            if (StateDropDown.SelectedValue != "-1")
                                state = StateDropDown.SelectedItem.Text;
                        }

                        if (state == "" || CityTextBox.Text.Trim() == "")
                        {
                            goon = false;
                            message = "Group Head-Quarter location must be included.";
                        }

                        if (goon)
                        {
                            if (StreetNumberTextBox.Text.Trim() != "" || StreetNameTextBox.Text.Trim() != "")
                            {
                                if (StreetNameTextBox.Text.Trim() == "" || StreetNameTextBox.Text.Trim() == ""
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterGroup_OLD.aspx.cs

示例6: PostIt

    protected void PostIt(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        bool goOn = false;
        if (Session["LastPostedComment"] == null)
            goOn = true;
        else if (DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) > ((DateTime)Session["LastPostedComment"]).AddSeconds(double.Parse("2.00")))
            goOn = true;

        if (goOn)
        {
            Session["LastPostedComment"] = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            if (CommentTextBox.Text.Trim() != "")
            {

                string urlToken = Request.Url.Segments[Request.Url.Segments.Length - 1];
                DataSet dsComments;
                SqlCommand cmd = new SqlCommand();
                string commentPrefs = "";
                CommentTextBox.Text = dat.StripHTML_LeaveLinks(CommentTextBox.Text);
                switch (urlToken)
                {

                    case "Trip.aspx":
                        cmd.CommandText = "INSERT INTO TripComments (BlogID, Comment, UserID, BlogDate) VALUES"
                        + "(@blogID, @comment, @userID, @date)";
                        cmd.Connection = dat.GET_CONNECTED;
                        int tripID = int.Parse(Request.QueryString["ID"].ToString());
                        cmd.Parameters.Add("@blogID", SqlDbType.Int).Value = tripID;
                        cmd.Parameters.Add("@comment", SqlDbType.NVarChar).Value = CommentTextBox.Text;
                        cmd.Parameters.Add("@userID", SqlDbType.Int).Value = int.Parse(Session["User"].ToString());
                        cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
                        cmd.ExecuteNonQuery();

                        commentPrefs = dat.GetData("SELECT * FROM UserPreferences WHERE UserID=" + Session["User"].ToString()).Tables[0].Rows[0]["CommentsPreferences"].ToString();
                        if (commentPrefs == "1")
                        {
                            dsComments = dat.GetData("SELECT C.BlogDate AS theDate, * FROM TripComments C, Users U WHERE U.User_ID=C.UserID AND C.BlogID=" + Request.QueryString["ID"].ToString() + " ORDER BY C.BlogDate");
                        }
                        else
                        {
                            dsComments = dat.GetData("SELECT DISTINCT U.ProfilePicture, U.User_ID, U.UserName, C.Comment, C.BlogDate AS theDate FROM Comments C, Users U, User_Friends UF WHERE ((UF.UserID=" + Session["User"].ToString() + " AND UF.FriendID=U.User_ID AND U.User_ID=C.UserID) OR (U.User_ID=" +
                                Session["User"].ToString() + " AND U.User_ID=C.UserID)) AND C.BlogID=" + Request.QueryString["EventID"].ToString() + " ORDER BY C.BlogDate");
                        } CommentTextBox.Text = "";
                        this.DATA_SET = dsComments;
                        DataBind2(true);
                        break;
                    case "Venue.aspx":
                        cmd.CommandText = "INSERT INTO Venue_Comments (Comment, UserID, VenueID, CommentDate) "
                        + "VALUES(@comment, @userID, @venueID, @date)";
                        cmd.Connection = dat.GET_CONNECTED;
                        cmd.Parameters.Add("@comment", SqlDbType.NVarChar).Value = CommentTextBox.Text;
                        cmd.Parameters.Add("@userID", SqlDbType.Int).Value = int.Parse(Session["User"].ToString());
                        cmd.Parameters.Add("@venueID", SqlDbType.Int).Value = int.Parse(Request.QueryString["ID"].ToString());
                        cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
                        cmd.ExecuteNonQuery();
                        CommentTextBox.Text = "";

                        commentPrefs = dat.GetData("SELECT * FROM UserPreferences WHERE UserID=" + Session["User"].ToString()).Tables[0].Rows[0]["CommentsPreferences"].ToString();
                        if (commentPrefs == "1")
                        {
                            dsComments = dat.GetData("SELECT VC.CommentDate AS theDate, * FROM Venue_Comments VC, Users U WHERE VC.UserID=U.User_ID AND VC.VenueID=" + Request.QueryString["ID"].ToString() + " ORDER BY VC.CommentDate ");
                        }
                        else
                        {
                            dsComments = dat.GetData("SELECT DISTINCT U.ProfilePicture, U.User_ID, U.UserName, VC.Comment, VC.CommentDate AS theDate FROM Venue_Comments VC, Users U, User_Friends UF WHERE ((UF.UserID=" + Session["User"].ToString() + " AND UF.FriendID=U.User_ID AND U.User_ID=VC.UserID) OR (U.User_ID=" +
                                                Session["User"].ToString() + " AND U.User_ID=VC.UserID)) AND VC.VenueID=" + Request.QueryString["ID"].ToString() + " ORDER BY VC.CommentDate");
                        } this.DATA_SET = dsComments;
                        DataBind2(false);
                        break;
                    case "Event.aspx":
                        bool isCl = false;
                        if (Request.QueryString["cl"] != null)
                            if (bool.Parse(Request.QueryString["cl"]))
                            {
                                isCl = true;
                            }

                        if (isCl)
                        {
                            cmd.CommandText = "INSERT INTO ClEventComments (ClEventID, Comment, UserID, BlogDate) VALUES"
                            + "(@blogID, @comment, @userID, @date)";
                            cmd.Connection = dat.GET_CONNECTED;
                            string eventID = Request.QueryString["EventID"].ToString();
                            cmd.Parameters.Add("@blogID", SqlDbType.NVarChar).Value = eventID;
                            cmd.Parameters.Add("@comment", SqlDbType.NVarChar).Value = CommentTextBox.Text;
                            cmd.Parameters.Add("@userID", SqlDbType.Int).Value = int.Parse(Session["User"].ToString());
                            cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
                            cmd.ExecuteNonQuery();

                            commentPrefs = dat.GetData("SELECT * FROM UserPreferences WHERE UserID=" + Session["User"].ToString()).Tables[0].Rows[0]["CommentsPreferences"].ToString();
                            if (commentPrefs == "1")
                            {
                                dsComments = dat.GetData("SELECT C.BlogDate AS theDate, * FROM ClEventComments C, Users U WHERE U.User_ID=C.UserID AND C.ClEventID='" + Request.QueryString["EventID"].ToString() + "' ORDER BY C.BlogDate");
                            }
                            else
                            {
                                dsComments = dat.GetData("SELECT DISTINCT U.ProfilePicture, U.User_ID, U.UserName, C.Comment, C.BlogDate AS theDate FROM ClEventComments C, Users U, User_Friends UF WHERE ((UF.UserID=" + Session["User"].ToString() + " AND UF.FriendID=U.User_ID AND U.User_ID=C.UserID) OR (U.User_ID=" +
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:Comments.ascx.cs

示例7: ValidatePage


//.........这里部分代码省略.........
                    }
                    else
                    {
                        if (tryMinMins > 59 || tryMaxMins > 59)
                        {
                            goOn = false;
                            validateMessage += "Please make sure that your Minimum and Maximum duration minutes are less than an hour. ";
                        }
                    }
                }
                else
                {
                    goOn = false;
                    validateMessage += "All adventure duration times must be integers. ";
                }
            }

            if (TimeListBox.Items.Count == 0)
            {
                goOn = false;
                validateMessage += "Please include at least one entry for days and times someone could go on this adventure. ";
            }

            if (MonthsListBox.Items.Count == 0)
            {
                goOn = false;
                validateMessage += "Please include at least one month time frame when this trip could be taken. ";
            }

            if (goOn)
            {
                MinTextBox.Text = dat.stripHTML(MinTextBox.Text.Trim());
                MaxTextBox.Text = dat.stripHTML(MaxTextBox.Text.Trim());
                DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                ShortDescriptionTextBox.Text = dat.StripHTML_LeaveLinksNoBr(ShortDescriptionTextBox.Text);
                WhatObtainTextBox.Text = dat.StripHTML_LeaveLinksNoBr(WhatObtainTextBox.Text.Trim());
                HowDressTextBox.Text = dat.StripHTML_LeaveLinksNoBr(HowDressTextBox.Text.Trim());
                decimal theDecimal = 0.00M;
                bool goMin = false;
                bool goMax = false;
                if (MinTextBox.Text.Trim() != "")
                {
                    if (decimal.TryParse(MinTextBox.Text, out theDecimal))
                    {
                        goMin = true;
                    }
                    else
                    {
                        goMin = false;
                    }
                }
                else
                {
                    goMin = true;
                }

                if (MaxTextBox.Text.Trim() != "")
                {
                    if (decimal.TryParse(MaxTextBox.Text, out theDecimal))
                    {
                        goMax = true;
                    }
                    else
                    {
                        goMax = false;
                    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:67,代码来源:EnterTrip.aspx.cs

示例8: SuggestCategoryClick

    protected void SuggestCategoryClick(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];

        DateTime isn = DateTime.Now;

        if (!DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn))
            isn = DateTime.Now;
        DateTime isNow = isn;
        Data dat = new Data(isn); CategoriesTextBox.Text = dat.stripHTML(CategoriesTextBox.Text.Trim());

        if (CategoriesTextBox.Text.Trim() != "")
        {

            MessagePanel.Visible = true;

            YourMessagesLabel.Text = "Your category '" + CategoriesTextBox.Text + "' has been suggested. We'll send you an update when it has been approved.";

            CategoriesTextBox.Text = dat.StripHTML_LeaveLinks(CategoriesTextBox.Text);

            DataSet dsUser = dat.GetData("SELECT Email, UserName FROM USERS WHERE User_ID=" + Session["User"].ToString());

            dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["categoryemail"].ToString(),
                        System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["categoryemail"].ToString(), "Category has been suggested from 'enter-trip'. The user ID who suggested " +
                "the category is userID: '" + Session["User"].ToString() + "'. The category suggestion is '" + CategoriesTextBox.Text + "'", "Hippo Happenings category suggestion");
            CategoriesTextBox.Text = "";
        }
        else
        {
            MessagePanel.Visible = true;

            YourMessagesLabel.Text = "Please type in the description and name of the category you want to suggest.";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:35,代码来源:EnterTrip.aspx.cs

示例9: OnwardsIT


//.........这里部分代码省略.........
                            YourMessagesLabel.Text += "*Must include the city or a Locale.";
                            return false;
                        }
                    }
                    else
                    {
                        location = false;
                        goOn = false;
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "*Must include the address or a Locale.";
                        return false;
                    }
                }
            }

            if (DateSelectionsListBox.Items.Count > 0)
                startDate = true;
            else
            {
                startDate = false;
                MessagePanel.Visible = true;
                YourMessagesLabel.Text += "*Must include the Date.";
                return false;
            }

            #endregion

            if (eventName && startDate && endDate && location && venue && state && goOn)
            {

                #region Check Second
                MinTextBox.Text = dat.stripHTML(MinTextBox.Text.Trim());
                MaxTextBox.Text = dat.stripHTML(MaxTextBox.Text.Trim());
                DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                //ShortDescriptionTextBox.Text = dat.StripHTML_LeaveLinksNoBr(ShortDescriptionTextBox.Text);
                decimal theDecimal = 0.00M;
                bool goMin = false;
                bool goMax = false;
                if (MinTextBox.Text.Trim() != "")
                {
                    if (decimal.TryParse(MinTextBox.Text, out theDecimal))
                    {
                        goMin = true;
                    }
                    else
                    {
                        goMin = false;
                    }
                }
                else
                {
                    goMin = true;
                }

                if (MaxTextBox.Text.Trim() != "")
                {
                    if (decimal.TryParse(MaxTextBox.Text, out theDecimal))
                    {
                        goMax = true;
                    }
                    else
                    {
                        goMax = false;
                    }
                }
                else
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:67,代码来源:BlogEvent.aspx.cs

示例10: SavePrefs

    protected void SavePrefs(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", ":")));

        DataView dvMembers;

        if (TheCheckList.Items[0].Selected && TheCheckList.Items[1].Selected)
        {
            if (Request.QueryString["type"].ToString() == "e")
                dvMembers = dat.GetDataDV("SELECT * FROM GroupEvent_Members GM, Users U WHERE " +
                "U.User_ID=GM.UserID AND GM.GroupEventID=" + Request.QueryString["ID"].ToString());
            else
                dvMembers = dat.GetDataDV("SELECT * FROM Group_Members GM, Users U WHERE " +
                "U.User_ID=GM.MemberID AND GM.GroupID=" + Request.QueryString["ID"].ToString());
        }
        else
        {
            if (TheCheckList.Items[0].Selected)
            {
                if (Request.QueryString["type"].ToString() == "e")
                    dvMembers = dat.GetDataDV("SELECT * FROM GroupEvent_Members GM, Users U WHERE " +
                    "U.User_ID=GM.UserID AND GM.GroupEventID=" + Request.QueryString["ID"].ToString() + " AND Accepted <> 'True'");
                else
                    dvMembers = dat.GetDataDV("SELECT * FROM Group_Members GM, Users U WHERE " +
                    "U.User_ID=GM.MemberID AND GM.GroupID=" + Request.QueryString["ID"].ToString() + " AND Accepted <> 'True'");
            }
            else
            {
                if (Request.QueryString["type"].ToString() == "e")
                    dvMembers = dat.GetDataDV("SELECT * FROM GroupEvent_Members GM, Users U WHERE " +
                    "U.User_ID=GM.UserID AND GM.GroupEventID=" + Request.QueryString["ID"].ToString() + " AND Accepted='True'");
                else
                    dvMembers = dat.GetDataDV("SELECT * FROM Group_Members GM, Users U WHERE " +
                    "U.User_ID=GM.MemberID AND GM.GroupID=" + Request.QueryString["ID"].ToString() + " AND Accepted='True'");
            }
        }

        DataView dvGroup;
        if (Request.QueryString["type"].ToString() == "e")
            dvGroup = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" +
            Request.QueryString["ID"].ToString());
        else
            dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID=" +
            Request.QueryString["ID"].ToString());

        TextBox textB;
        TextBox textD;
        CheckBox checkS;
        CheckBox checkD;
        MessageTextBox.Text = dat.StripHTML_LeaveLinks(MessageTextBox.Text.Trim());
        string message = "";
        if (Request.QueryString["type"].ToString() == "e")
            message = "You have a message from Group Event " +
                 dvGroup[0]["Name"].ToString();
        else
            message = "You have a message from Group " +
             dvGroup[0]["Header"].ToString();

        string userid = "";
        foreach (DataRowView row in dvMembers)
        {
            if (Request.QueryString["type"].ToString() == "e")
                userid = row["UserID"].ToString();
            else
                userid = row["MemberID"].ToString();
            dat.Execute("INSERT INTO UserMessages (MessageContent, MessageSubject, From_UserID, To_UserID, " +
            "[Date], [Read], [Mode], [Live]) VALUES('" + MessageTextBox.Text.Replace("'", "''") + "', '" +
            message + "', " +
            Session["User"].ToString() + ", " + userid + ", '" +
            DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) +
            "', 'False', 0, 'True')");

            dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
            System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
            row["Email"].ToString(),
            MessageTextBox.Text.Replace("'", "''"), message);
        }

        RemovePanel.Visible = false;
        ThankYouPanel.Visible = true;
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:89,代码来源:SendMessageToParticipants.aspx.cs

示例11: ValidatePage


//.........这里部分代码省略.........

            if (EmailTextBox.Text.Trim() != "")
            {
                if (!dat.ValidateEmail(EmailTextBox.Text))
                {

                    validateMessage += "*Email address is not in the appropriate format.";

                }
            }

            if (CountryDropDown.SelectedValue == "223")
            {
                int zip = 0;
                if (int.TryParse(ZipTextBox.Text.Trim(), out zip))
                {
                    if (ZipTextBox.Text.Trim().Length == 5)
                    {

                    }
                    else
                    {
                        validateMessage += "*Zip must be a 5 digit code.";
                        goOn = false;
                    }
                }
                else
                {
                    validateMessage += "*Zip must be a 5 digit code.";
                    goOn = false;
                }
            }

            if (StateDropDown.Visible)
            {
                if (StateDropDown.SelectedIndex == -1)
                {
                    validateMessage += "*Must include state.";
                    goOn = false;
                }

            }
            else
            {
                if (StateTextBox.Text.Trim() == "")
                {
                    validateMessage += "*Must include state.";
                    goOn = false;
                }
            }

            if (!isUpdate && goOn)
            {
                string state = "";
                if (StateDropDownPanel.Visible)
                    state = StateDropDown.SelectedItem.Text;
                else
                    state = StateTextBox.Text;

                SqlCommand cmd = new SqlCommand("SELECT * FROM Venues WHERE [email protected] AND [email protected] AND [email protected]", conn);
                cmd.Parameters.Add("@address", SqlDbType.NVarChar).Value = locationStr;
                cmd.Parameters.Add("@city", SqlDbType.NVarChar).Value = CityTextBox.Text.Trim().ToLower();
                cmd.Parameters.Add("@state", SqlDbType.NVarChar).Value = state;
                DataSet ds = new DataSet();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds.Tables.Count > 0)
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        validateMessage += "A locale already exists under this address. " +
                            "Please take a look at it " +
                            "<a target=\"_blank\" class=\"AddGreenLink\" href=\"" + dat.MakeNiceName(VenueNameTextBox.Text) + "_" +
                            ds.Tables[0].Rows[0]["ID"].ToString() + "_Venue\">here.</a> You can submit edits to the existing locale by licking on the 'Edit Locale' link at the top of the locale page.";
                        goOn = false;
                    }
            }
        }
        else
        {
            validateMessage += "*Please fill in all fields.";
            goOn = false;
        }

        if (goOn)
        {
            DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));

            if (CategorySelected())
            {
                validateMessage = "success";
            }
            else
            {
                validateMessage = "Must include at least one category.";
            }
        }

        return validateMessage;
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterVenue.aspx.cs


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