using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; public partial class Latest_Announced_Events_List : System.Web.UI.Page { PublicMethods ClspUblicMethods = new PublicMethods(); EMUPDataContext dbEmup = new EMUPDataContext(); protected string city { get; set; } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string url = HttpContext.Current.Request.Url.AbsoluteUri; littype.Text = url.Substring(url.LastIndexOf('-') + 1); calFromDate.StartDate = DateTime.Now; calToDate.StartDate = DateTime.Now; //ClspUblicMethods.FillDropDownList(ClspUblicMethods.GetEventCategories(), ddlCategory); //Int32 startzip = 0; //Int32 endzip = 0; //string zipcode; string strLoc = ""; string strIP = string.Empty; strIP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(strIP)) strIP = Request.ServerVariables["REMOTE_ADDR"]; try { HttpCookie cookieLoc = Request.Cookies.Get("locInfo"); //if (Request.QueryString["Sloc"] != null) //{ // //Session["loc"] = Convert.ToString(Request.QueryString["loc"]); // //string strcity = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[0]; // //Session["loc"] = strcity; // //string strstate = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[1]; // //DataSet dsZip = ClspUblicMethods.getZipCode(strcity, strstate); // //zipcode = Convert.ToString(dsZip.Tables[0].Rows[0]["zip"]); // //zipcode = zipcode.Replace(@"\", ""); // //zipcode = zipcode.Replace('"', ' ').Trim(); // //startzip = Convert.ToInt32(zipcode) - 500; // //endzip = Convert.ToInt32(zipcode) + 500; // string strcity = Convert.ToString(Convert.ToString(Request.QueryString["Sloc"])).Split(',')[0]; // Session["loc"] = strcity; // //Session["Sloc"] = (Convert.ToString(Request.QueryString["Sloc"]).Split(',')[0], Convert.ToString(Request.QueryString["Sloc"].Substring(Request.QueryString["Sloc"].LastIndexOf(',') + 1))); // string strstate = Convert.ToString(Convert.ToString(Request.QueryString["Sloc"])).Split(',')[1]; // strLoc = strcity + "," + strstate; // Session["Sloc"] = strLoc; // ClspUblicMethods.GetLatLong(Convert.ToString(Request.QueryString["Sloc"]).Split(',')[0], Convert.ToString(Request.QueryString["Sloc"].Substring(Request.QueryString["Sloc"].LastIndexOf(',') + 1))); // if (Convert.ToString(littype.Text) == "week") // { // BindThisWeekEvents(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // BindListing(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // } // else if (Convert.ToString(littype.Text) == "recent") // { // BindRecentEvents(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // BindListing(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // } // else if (Convert.ToString(littype.Text) == "upcoming") // { // BindUpcomingEvents(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // BindListing(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // } // else if (Convert.ToString(littype.Text) == "ticketed") // { // BindTicketedEvents(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // BindListing(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // } // else // { // BindAllEvents(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // BindListing(Convert.ToDouble(ClspUblicMethods.salti), Convert.ToDouble(ClspUblicMethods.slong)); // } //} //try //{ // BindUpcomingEvents(Convert.ToDouble(32.7766642), Convert.ToDouble(-96.7969879)); // BindListing(Convert.ToDouble(32.7766642), Convert.ToDouble(-96.7969879)); //} //catch (Exception ex) //{ // throw (ex); // // BindUpcomingEvents(); //} if (Request.Cookies["locInfo"] != null) { if (Convert.ToString(littype.Text) != "") { if (Convert.ToString(littype.Text) == "week") { this.Title = "Indian this week events, Desi this week events near me at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian this week events, Desi this week events in USA at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "recent") { this.Title = "Indian recently announced events, Desi recently announced events near me at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian recently announced events, Desi recently announced events in USA at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "upcoming") { this.Title = "Indian upcoming events, Desi upcoming events near me at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian upcoming events, Desi upcoming events in USA at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "ticketed") { this.Title = "Indian event tickets, Desi event tickets near me at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian event tickets, Desi event tickets in USA at " + Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } } //Session["loc"] = Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["loc"])); //Session["Sloc"] = Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); if (Convert.ToString(littype.Text) == "week") { BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "recent") { BindRecentEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "upcoming") { BindUpcomingEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "ticketed") { BindTicketedEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else { BindAllEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } } else if (Convert.ToString(Session["Sloc"]) != "") { //string strcity = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[0]; //Session["loc"] = strcity; //string strstate = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[1]; //DataSet dsZip = ClspUblicMethods.getZipCode(strcity, strstate); //zipcode = Convert.ToString(dsZip.Tables[0].Rows[0]["zip"]); //zipcode = zipcode.Replace(@"\", ""); //zipcode = zipcode.Replace('"', ' ').Trim(); //startzip = Convert.ToInt32(zipcode) - 500; //endzip = Convert.ToInt32(zipcode) + 500; //string strcity = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[0]; //Session["loc"] = strcity; //string strstate = Convert.ToString(Convert.ToString(Session["Sloc"])).Split(',')[1]; //ClspUblicMethods.GetLatLong(Convert.ToString(Session["Sloc"]).Split(',')[0], Convert.ToString(Session["Sloc"]).Split(',')[1]); if (Convert.ToString(littype.Text) != "") { if (Convert.ToString(littype.Text) == "week") { this.Title = "Indian this week events, Desi this week events near me at " + Convert.ToString(Session["Sloc"]); Page.MetaDescription = "Indian this week events, Desi this week events in USA at " + Convert.ToString(Session["Sloc"]); } else if (Convert.ToString(littype.Text) == "recent") { this.Title = "Indian recently announced events, Desi recently announced events near me at " + Convert.ToString(Session["Sloc"]); Page.MetaDescription = "Indian recently announced events, Desi recently announced events in USA at " + Convert.ToString(Session["Sloc"]); } else if (Convert.ToString(littype.Text) == "upcoming") { this.Title = "Indian upcoming events, Desi upcoming events near me at " + Convert.ToString(Session["Sloc"]); Page.MetaDescription = "Indian upcoming events, Desi upcoming events in USA at " + Convert.ToString(Session["Sloc"]); } else if (Convert.ToString(littype.Text) == "ticketed") { this.Title = "Indian event tickets, Desi event tickets near me at " + Convert.ToString(Session["Sloc"]); Page.MetaDescription = "Indian event tickets, Desi event tickets in USA at " + Convert.ToString(Session["Sloc"]); } } if (Convert.ToString(littype.Text) == "week") { // BindGridViewListings(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindThisWeekEvents(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindListing(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); } else if (Convert.ToString(littype.Text) == "recent") { BindRecentEvents(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindListing(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); } else if (Convert.ToString(littype.Text) == "upcoming") { BindUpcomingEvents(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindListing(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); } else if (Convert.ToString(littype.Text) == "ticketed") { BindTicketedEvents(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindListing(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); } else { BindAllEvents(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindListing(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); } } else if (cookieLoc != null) { if (Convert.ToString(littype.Text) != "") { if (Convert.ToString(littype.Text) == "week") { this.Title = "Indian this week events, Desi this week events near me at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian this week events, Desi this week events in USA at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "recent") { this.Title = "Indian recently announced events, Desi recently announced events near me at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian recently announced events, Desi recently announced events in USA at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "upcoming") { this.Title = "Indian upcoming events, Desi upcoming events near me at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian upcoming events, Desi upcoming events in USA at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } else if (Convert.ToString(littype.Text) == "ticketed") { this.Title = "Indian event tickets, Desi event tickets near me at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); Page.MetaDescription = "Indian event tickets, Desi event tickets in USA at " + Convert.ToString(Server.HtmlEncode(Request.Cookies["locInfo"]["Sloc"])); } } if (Convert.ToString(littype.Text) == "week") { // BindGridViewListings(Convert.ToDouble(Session["lat"]), Convert.ToDouble(Session["long"])); BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "recent") { BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "upcoming") { BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else if (Convert.ToString(littype.Text) == "ticketed") { BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } else { BindThisWeekEvents(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); BindListing(Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["lat"])), Convert.ToDouble(Server.HtmlEncode(Request.Cookies["locInfo"]["long"]))); } } else { //try //{ // DataTable dt = ClspUblicMethods.GetLocation(strIP); // lblCity.Text = dt.Rows[0]["cityName"].ToString(); // HttpCookie hcLoc = new HttpCookie("locInfo"); // hcLoc.Values["loc"] = Convert.ToString(lblCity.Text); // hcLoc.Values["lat"] = Convert.ToString(dt.Rows[0]["latitude"].ToString()); // hcLoc.Values["long"] = Convert.ToString(dt.Rows[0]["longitude"].ToString()); // hcLoc.Values["Sloc"] = dt.Rows[0]["cityName"].ToString() + "," + Convert.ToString(dt.Rows[0]["regionName"].ToString()); // hcLoc.Expires = DateTime.Now.AddDays(1); // hcLoc.Domain = ".jhalak.com"; // Response.Cookies.Add(hcLoc); // Session["loc"] = lblCity.Text; // Session["lat"] = Convert.ToString(dt.Rows[0]["latitude"].ToString()); // Session["long"] = Convert.ToString(dt.Rows[0]["longitude"].ToString()); // Session["Sloc"] = dt.Rows[0]["cityName"].ToString() + "," + Convert.ToString(dt.Rows[0]["regionName"].ToString()); // //hcLoc.Domain = ".jhalak.com"; // Response.Cookies.Add(hcLoc); // if (Convert.ToString(littype.Text) == "week") // { // // BindGridViewListings(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindThisWeekEvents(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindListing(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // } // else if (Convert.ToString(littype.Text) == "recent") // { // BindRecentEvents(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindListing(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // } // else if (Convert.ToString(littype.Text) == "upcoming") // { // BindUpcomingEvents(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindListing(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // } // else if (Convert.ToString(littype.Text) == "ticketed") // { // BindTicketedEvents(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindListing(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // } // else // { // BindAllEvents(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // BindListing(Convert.ToDouble(dt.Rows[0]["latitude"].ToString()), Convert.ToDouble(dt.Rows[0]["longitude"].ToString())); // } //} //catch //{ // BindAllEvents(); // BindListing(); //} BindAllEvents(); BindListing(); if (Convert.ToString(littype.Text) != "") { if (Convert.ToString(littype.Text) == "week") { this.Title = "Indian this week events, Desi this week events near me"; Page.MetaDescription = "Indian this week events, Desi this week events near by your Location"; } else if (Convert.ToString(littype.Text) == "recent") { this.Title = "Indian recently announced events, Desi recently announced events near me"; Page.MetaDescription = "Indian recently announced events, Desi recently announced events near by your Location"; } else if (Convert.ToString(littype.Text) == "upcoming") { this.Title = "Indian upcoming events, Desi upcoming events near me"; Page.MetaDescription = "Indian upcoming events, Desi upcoming events near by your Location"; } else if (Convert.ToString(littype.Text) == "ticketed") { this.Title = "Indian event tickets, Desi event tickets near me"; Page.MetaDescription = "Indian event tickets, Desi event tickets near by your Location"; } } } } catch { BindAllEvents(); BindListing(); } city = Convert.ToString(Session["loc"]); //Page.MetaDescription = "Jhalak.com,Jhalak Events Listing,Free Classifeds and Business Listing in " + Convert.ToString(Session["loc"]); } } //private void LatestEvents() //{ // gvLatestEvents.DataSource = ClspUblicMethods.GetLatestAnnouncedEventsList(); // gvLatestEvents.DataBind(); //} //private void UpcomingEvents() //{ // gvUpcomingEvents.DataSource = ClspUblicMethods.GetUpComingEventsList(); // gvUpcomingEvents.DataBind(); //} //private void OnGoingEvent() //{ // gvTodaysEvents.DataSource = ClspUblicMethods.GetTodaysEventsList(); // gvTodaysEvents.DataBind(); //} private void BindListing() { gvServceListing.DataSource =GetProvidersListings(27); gvServceListing.DataBind(); //gvPremiumProviders.DataSource = ClspUblicMethods.GetProvidersListings(27, "Premium"); //gvPremiumProviders.DataBind(); } private void BindListing(string strLoc) { gvServceListing.DataSource = GetProvidersListings(27, strLoc, "Free"); gvServceListing.DataBind(); //gvPremiumProviders.DataSource = GetProvidersListings(27, strLoc, "Premium"); //gvPremiumProviders.DataBind(); } private void BindListing(int StartZip, int EndZip) { gvServceListing.DataSource = GetProvidersListings(27, StartZip, EndZip, "Free"); gvServceListing.DataBind(); //gvPremiumProviders.DataSource = GetProvidersListings(27, StartZip, EndZip, "Premium"); //gvPremiumProviders.DataBind(); } private void BindListing(double latitude, double longitude) { gvServceListing.DataSource = GetBUsersByRadius(latitude, longitude, 27, 21); gvServceListing.DataBind(); //gvPremiumProviders.DataSource = ClspUblicMethods.GetProvidersListings(27, StartZip, EndZip, "Premium"); //gvPremiumProviders.DataBind(); } //public IQueryable GetProvidersListings(int intCatId, string UserType) //{ // var objA = from objG in dbEmup.UserDets // where objG.Role == "Business" && objG.CategoryId == intCatId // && objG.UserType == UserType // orderby objG.CreatedDate descending // select new // { // UserId = objG.UserSerNo, // Name = objG.Name, // Category = objG.CategoryDet.Categoryname, // ContactNo = objG.BusinessContact, // Location = objG.Location, // BusinessName = objG.BusinessName, // Website = Convert.ToString(objG.Website), // AboutUs = Convert.ToString(objG.AboutUs), // }; // return objA; //} private void BindThisWeekEvents(string strLoc) { gvEvents.DataSource = GetTodaysEvents("Free", strLoc); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetTodaysEvents("Premium", strLoc); rpPremiumEvents.DataBind(); } private void BindThisWeekEvents(int StartZip, int EndZip) { gvEvents.DataSource = GetTodaysEvents("Free", StartZip, EndZip); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetTodaysEvents("Premium", StartZip, EndZip); rpPremiumEvents.DataBind(); } private void BindThisWeekEvents(double latitude, double longitude) { gvEvents.DataSource = ClspUblicMethods.GetThisWeekEventsByRadius(latitude, longitude, "Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = ClspUblicMethods.GetThisWeekEventsByRadius(latitude, longitude, "Premium"); rpPremiumEvents.DataBind(); } private void BindUpcomingEvents(string strLoc) { gvEvents.DataSource = GetUpComingEvents("Free", strLoc); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetUpComingEvents("Premium", strLoc); rpPremiumEvents.DataBind(); } private void BindUpcomingEvents(int StartZip, int EndZip) { gvEvents.DataSource = GetUpComingEvents("Free", StartZip, EndZip); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetUpComingEvents("Premium", StartZip, EndZip); rpPremiumEvents.DataBind(); } private void BindUpcomingEvents(double latitude, double longitude) { gvEvents.DataSource = ClspUblicMethods.GetUpcomingEventsByRadius(latitude, longitude, "Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = ClspUblicMethods.GetUpcomingEventsByRadius(latitude, longitude, "Premium"); rpPremiumEvents.DataBind(); } private void BindRecentEvents(string strLoc) { gvEvents.DataSource = GetLatestAnnouncedEventsHome("Free", strLoc); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetLatestAnnouncedEventsHome("Premium", strLoc); rpPremiumEvents.DataBind(); } private void BindRecentEvents(int StartZip, int EndZip) { gvEvents.DataSource = GetLatestAnnouncedEventsHome("Free", StartZip, EndZip); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetLatestAnnouncedEventsHome("Premium", StartZip, EndZip); rpPremiumEvents.DataBind(); } private void BindRecentEvents(double latitude, double longitude) { gvEvents.DataSource = ClspUblicMethods.GetLatestEventsByRadius(latitude, longitude, "Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = ClspUblicMethods.GetLatestEventsByRadius(latitude, longitude, "Premium"); rpPremiumEvents.DataBind(); } public void BindTicketedEvents(string strLoc) { gvEvents.DataSource = GetTicketedEventsHome(27, 288, "Free", strLoc); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetTicketedEventsHome(27, 288, "Premium", strLoc); rpPremiumEvents.DataBind(); } public void BindTicketedEvents(int StartZip, int EndZip) { gvEvents.DataSource = GetTicketedEventsHome(27, 288, "Free", StartZip, EndZip); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetTicketedEventsHome(27, 288, "Premium", StartZip, EndZip); rpPremiumEvents.DataBind(); } public void BindTicketedEvents(double latitude, double longitude) { gvEvents.DataSource = ClspUblicMethods.GetTicketedEventsByRadius(latitude, longitude, 27, 288, "Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = ClspUblicMethods.GetTicketedEventsByRadius(latitude, longitude, 27, 288, "Premium"); rpPremiumEvents.DataBind(); } public void BindAllEvents(string strLoc) { gvEvents.DataSource = GetAllEvents("Free", strLoc); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetAllEvents("Premium", strLoc); rpPremiumEvents.DataBind(); } public void BindAllEvents() { gvEvents.DataSource = GetAllEvents("Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetAllEvents("Premium"); rpPremiumEvents.DataBind(); } public void BindAllEvents(int StartZip, int EndZip) { gvEvents.DataSource = GetAllEvents("Free", StartZip, EndZip); gvEvents.DataBind(); rpPremiumEvents.DataSource = GetAllEvents("Premium", StartZip, EndZip); rpPremiumEvents.DataBind(); } public void BindAllEvents(double latitude, double longitude) { gvEvents.DataSource = ClspUblicMethods.GetEventsByRadius(latitude, longitude, "Free"); gvEvents.DataBind(); rpPremiumEvents.DataSource = ClspUblicMethods.GetEventsByRadius(latitude, longitude, "Premium"); rpPremiumEvents.DataBind(); } public IQueryable GetAllEvents(string AdType) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.Status == null && Convert.ToDateTime(objEvents.EventDate) >= DateTime.Now orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, City = objEvents.UserAdsDet.City, Location = objEvents.UserAdsDet.City, EventDate = objEvents.EventDate, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetAllEvents(string AdType, string strLoc) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.City.Contains(strLoc) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetAllEvents(string AdType, int startZip, int EndZip) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.Status == null && (Convert.ToInt32(objEvents.UserAdsDet.ZipCode) >= startZip && Convert.ToInt32(objEvents.UserAdsDet.ZipCode) <= EndZip) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetUpComingEvents(string AdType, string strLoc) { var objOrgList = (from objEvents in dbEmup.Event_Creates where (Convert.ToDateTime(objEvents.EventDate) >= DateTime.Now.AddDays(+7)) && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.City.Contains(strLoc) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetUpComingEvents(string AdType, int startZip, int EndZip) { var objOrgList = (from objEvents in dbEmup.Event_Creates where (Convert.ToDateTime(objEvents.EventDate) >= DateTime.Now.AddDays(+7)) && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.Status == null && (Convert.ToInt32(objEvents.UserAdsDet.ZipCode) >= startZip && Convert.ToInt32(objEvents.UserAdsDet.ZipCode) <= EndZip) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetTodaysEvents(string AdType, string strLoc) { var dateCriteria = DateTime.Now.Date.AddDays(7); var objOrgList = (from objEvents in dbEmup.Event_Creates where (Convert.ToDateTime(objEvents.CreatedDate) <= dateCriteria) && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == AdType && objEvents.UserAdsDet.City.Contains(strLoc) // Where(objEvents => startOfWeek <= objEvents.DateField && objEvents.DateField < endOfWeek) //&& (Convert.ToDateTime(objEvents.EventEndDate)<=DateTime.Now.Date.AddDays(-7))) && objEvents.UserAdsDet.Status == null orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now ) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetTodaysEvents(string AdType, int startZip, int EndZip) { var dateCriteria = DateTime.Now.Date.AddDays(7); var objOrgList = (from objEvents in dbEmup.Event_Creates where (Convert.ToDateTime(objEvents.CreatedDate) <= dateCriteria) && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == AdType && (Convert.ToInt32(objEvents.UserAdsDet.ZipCode) >= startZip && Convert.ToInt32(objEvents.UserAdsDet.ZipCode) <= EndZip) // Where(objEvents => startOfWeek <= objEvents.DateField && objEvents.DateField < endOfWeek) //&& (Convert.ToDateTime(objEvents.EventEndDate)<=DateTime.Now.Date.AddDays(-7))) && objEvents.UserAdsDet.Status == null orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now ) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetTicketedEventsHome(int intCatId, int intSubCateId, string adType, string strLoc) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.CategoryId == intCatId && objEvents.UserAdsDet.SubCategoryId == intSubCateId && objEvents.UserAdsDet.City.Contains(strLoc) && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == adType && objEvents.AdmissionType == "Paid Entry" orderby objEvents.AdId descending select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, OrganizerName = objEvents.UserAdsDet.UserDet.Name, Website = objEvents.UserAdsDet.UserDet.Website, Email = objEvents.UserAdsDet.UserDet.EmailId, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetTicketedEventsHome(int intCatId, int intSubCateId, string adType, int startZip, int EndZip) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.CategoryId == intCatId && objEvents.UserAdsDet.SubCategoryId == intSubCateId && objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.AdType == adType && objEvents.AdmissionType == "Paid Entry" && (Convert.ToInt32(objEvents.UserAdsDet.ZipCode) >= startZip && Convert.ToInt32(objEvents.UserAdsDet.ZipCode) <= EndZip) orderby objEvents.AdId descending select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, OrganizerName = objEvents.UserAdsDet.UserDet.Name, Website = objEvents.UserAdsDet.UserDet.Website, Email = objEvents.UserAdsDet.UserDet.EmailId, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetLatestAnnouncedEventsHome(string AdType, string strLoc) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.Status == null && objEvents.UserAdsDet.City.Contains(strLoc) && ((Convert.ToDateTime(objEvents.CreatedDate) == DateTime.Now)) && objEvents.UserAdsDet.AdType == AdType // (Convert.ToDateTime(objEvents.EventEndDate) <= DateTime.Now)) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now ) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public IQueryable GetLatestAnnouncedEventsHome(string AdType, int startZip, int EndZip) { var objOrgList = (from objEvents in dbEmup.Event_Creates where objEvents.UserAdsDet.Status == null && (Convert.ToInt32(objEvents.UserAdsDet.ZipCode) >= startZip && Convert.ToInt32(objEvents.UserAdsDet.ZipCode) <= EndZip) && ((Convert.ToDateTime(objEvents.CreatedDate) == DateTime.Now)) && objEvents.UserAdsDet.AdType == AdType // (Convert.ToDateTime(objEvents.EventEndDate) <= DateTime.Now)) orderby objEvents.AdId descending //where ((Convert.ToDateTime(objEvents.EventDate) == DateTime.Now ) && //(Convert.ToDateTime(objEvents.EventEndDate)=>DateTime.Now)) select new { AdId = objEvents.AdId, Id = objEvents.AdId, Title = objEvents.Event_Name, AdTitle = objEvents.Event_Name, Location = objEvents.UserAdsDet.City, Date = objEvents.EventDate, StartTime = objEvents.StartTime, EndTime = objEvents.EndTime, AdEventDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdOrganizerDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdSupplierDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, AdVenueDetail = objEvents.UserAdsDet.City.Replace(",", "-") + "-" + objEvents.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objEvents.AdId, }).Take(20); return objOrgList; } public DataSet GetBUsersByRadius(double latitude, double longitude, int catId, int partycatid) { DataSet ds = new DataSet(); string sqlQuery = "SELECT Top 16 UserSerNo,usertype, BusinessName, ContactNo,Location, Website, latitude, longitude, Verified,JhalakBusinessD FROM( SELECT z.UserSerNo ,z.usertype, z.BusinessName,z.ContactNo,z.Location,z.Latitude, z.Longitude, z.Website,z.Verified,"; sqlQuery += "concat(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE ( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(z.BusinessName,'!', ''), '''', ''), '@', ''), '#', ''), '$', ''),'%',''),'^',''),'&',''),'*',''),'(',''),'-',''), '_',''),':',''),';',''),'',''),',',''),'.',''),'<',''),'>',''),'?',''),'/','')+ '-', "; sqlQuery += " z.UserSerNo) AS JhalakBusinessD , p.distance_unit"; sqlQuery += " * DEGREES(ACOS(COS(RADIANS(p.latpoint)) * COS(RADIANS(z.Latitude)) * COS(RADIANS(p.longpoint - z.Longitude)) "; sqlQuery += " + SIN(RADIANS(p.latpoint)) * SIN(RADIANS(z.Latitude)))) AS distance FROM Userdet AS z "; sqlQuery += " JOIN( SELECT " + latitude + " AS latpoint," + longitude + " AS longpoint, 200 AS radius, 111.045 AS distance_unit ) AS p ON 1 = 1 "; sqlQuery += " WHERE (z.CategoryId=" + catId + " OR z.CategoryId=" + partycatid + ") and z.Role='Business' and z.Latitude BETWEEN p.latpoint - (p.radius / p.distance_unit) AND p.latpoint + (p.radius / p.distance_unit) "; sqlQuery += " AND z.Longitude BETWEEN p.longpoint - (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint)))) AND p.longpoint + "; sqlQuery += " (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint))))) AS d WHERE distance <= 200 order by usertype desc, UserSerNo desc "; string con = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection connection = new SqlConnection(con); //SqlDataAdapter dataadapter = new SqlDataAdapter(sqlQuery, connection); connection.Open(); SqlCommand cmd = new SqlCommand(sqlQuery, connection); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); connection.Close(); return ds; } private IQueryable GetProvidersListings(int intCatId) { var objA = (from objG in dbEmup.UserDets where objG.Role == "Business" && objG.CategoryId == intCatId orderby objG.UserType descending, objG.UserSerNo descending,objG.CreatedDate descending select new { UserId = objG.UserSerNo, UserSerNo = Convert.ToString(objG.UserSerNo), Name = objG.Name, Category = objG.CategoryDet.Categoryname, ContactNo = objG.BusinessContact, Location = objG.OperationLocatoin, usertype = Convert.ToString(Convert.ToString(objG.UserType)), AdType = Convert.ToString(Convert.ToString(objG.UserType)), BusinessName = Convert.ToString(objG.BusinessName), Website = Convert.ToString(objG.Website), AboutUs = Convert.ToString(objG.AboutUs), Verified = Convert.ToString(objG.Verified), JhalakBusinessD = objG.BusinessName.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.UserSerNo, }).Take(16); return objA; } public IQueryable GetProvidersListings(int intCatId, string strLoc, string strtype) { var objA = (from objG in dbEmup.UserDets where objG.Role == "Business" && objG.CategoryId == intCatId && objG.OperationLocatoin == strLoc && objG.UserType == strtype orderby objG.UserSerNo descending select new { UserId = objG.UserSerNo, UserSerNo = objG.UserSerNo, Name = objG.Name, Category = objG.CategoryDet.Categoryname, ContactNo = objG.BusinessContact, Location = objG.OperationLocatoin, BusinessName = objG.BusinessName, Website = Convert.ToString(objG.Website), AboutUs = Convert.ToString(objG.AboutUs), Verified = Convert.ToString(objG.Verified), JhalakBusinessD = objG.BusinessName.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.UserSerNo, }).Take(16); return objA; } public IQueryable GetProvidersListings(int intCatId, int startZip, int endZip, string strtype) { var objA = (from objG in dbEmup.UserDets where objG.Role == "Business" && objG.CategoryId == intCatId && objG.UserType == strtype && (Convert.ToInt32(objG.ZipCode) >= startZip && Convert.ToInt32(objG.ZipCode) <= endZip) orderby objG.UserSerNo descending select new { UserId = objG.UserSerNo, UserSerNo = objG.UserSerNo, Name = objG.Name, Category = objG.CategoryDet.Categoryname, ContactNo = objG.BusinessContact, Location = objG.OperationLocatoin, BusinessName = objG.BusinessName, Website = Convert.ToString(objG.Website), AboutUs = Convert.ToString(objG.AboutUs), Verified = Convert.ToString(objG.Verified), JhalakBusinessD = objG.BusinessName.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.UserSerNo, }).Take(16); return objA; } public IQueryable GetProvidersListings(int intCatId, string strtype) { var objA = (from objG in dbEmup.UserDets where objG.Role == "Business" && objG.CategoryId == intCatId && objG.UserType == strtype orderby objG.UserSerNo descending select new { UserId = objG.UserSerNo, UserSerNo = objG.UserSerNo, Name = objG.Name, Category = objG.CategoryDet.Categoryname, ContactNo = objG.BusinessContact, Location = objG.OperationLocatoin, BusinessName = objG.BusinessName, Website = Convert.ToString(objG.Website), AboutUs = Convert.ToString(objG.AboutUs), Verified = Convert.ToString(objG.Verified), JhalakBusinessD = objG.BusinessName.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.UserSerNo, }).Take(16); return objA; } protected void gvServceListing_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { HiddenField adtype = e.Item.FindControl("hdtype") as HiddenField; Image imgtype = e.Item.FindControl("imgtype") as Image; if (adtype != null) { if (Convert.ToString(adtype.Value) == "Premium") { imgtype.Visible = true; } else { imgtype.Visible = false; } } } catch (Exception ex) { } } #region Search protected void btnSubmit_Click(object sender, EventArgs e) { //string strCategories = String.Join(" , ", ddlCategory.Items.OfType().Where(r => r.Selected).Select(r => r.Text)).ToLower(); //Search with All if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdLocDateCategoryRepeats(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocDateCategoryRepeats(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Individual Search else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdLoc(Convert.ToString(txtLocation.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLoc(Convert.ToString(txtLocation.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdDate(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdDate(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdCategory(Convert.ToString(ddlCategory.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdCategory(Convert.ToString(ddlCategory.SelectedItem.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdRepeats(Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdRepeats(Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Two Field Search (Location & Others) else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdLocDate(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocDate(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdLocCategory(Convert.ToString(txtLocation.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocCategory(Convert.ToString(txtLocation.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdLocationRepeats(Convert.ToString(txtLocation.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocationRepeats(Convert.ToString(txtLocation.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Two Field Search (Date & Others) else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdDateCategory(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdDateCategory(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdDateRepeats(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdDateRepeats(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Two Field Search (Category & Repeats) else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdCategoryRepeats(Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdCategoryRepeats(Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Three Field Search (Location, Date & Others) else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) == 0) { rpPremiumEvents.DataSource = SearchAdLocDateCategory(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocDateCategory(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), "Free"); gvEvents.DataBind(); } else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) == 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdLocDateRepeats(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocDateRepeats(Convert.ToString(txtLocation.Text), Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Three Field Search (Location, Category & Repeats) else if (Convert.ToString(txtLocation.Text) != "" && Convert.ToString(txtDateFrom.Text) == "" && Convert.ToString(txtDateTo.Text) == "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdLocCategoryRepeats(Convert.ToString(txtLocation.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdLocCategoryRepeats(Convert.ToString(txtLocation.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } //Three Field Search (Date, Category & Repeats) else if (Convert.ToString(txtLocation.Text) == "" && Convert.ToString(txtDateFrom.Text) != "" && Convert.ToString(txtDateTo.Text) != "" && Convert.ToInt16(ddlCategory.SelectedIndex) != 0 && Convert.ToInt16(ddlRepeats.SelectedIndex) != 0) { rpPremiumEvents.DataSource = SearchAdDateCategoryRepeats(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Premium"); rpPremiumEvents.DataBind(); gvEvents.DataSource = SearchAdDateCategoryRepeats(Convert.ToDateTime(txtDateFrom.Text), Convert.ToDateTime(txtDateTo.Text), Convert.ToString(ddlCategory.SelectedItem.Text), Convert.ToString(ddlRepeats.SelectedItem.Text), "Free"); gvEvents.DataBind(); } } #endregion #region Individual Field Search public IQueryable SearchAdLoc(string strLocation, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.City == strLocation && objG.UserAdsDet.AdType == adtype select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, City = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, EventDate = objG.EventDate, Date = objG.EventDate, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdDate(DateTime datefrom, DateTime dateto, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdCategory(string strCategory, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.AdType == adtype && objG.Event_Category_Det.CategoryName == strCategory select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdRepeats(string strRepeat, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Repeats == strRepeat && objG.UserAdsDet.AdType == adtype select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Two Field Search(Location & Others) public IQueryable SearchAdLocDate(string strLocation, DateTime datefrom, DateTime dateto, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.City == strLocation && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdLocCategory(string strLocation, string strCategory, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.AdType == adtype && objG.UserAdsDet.City == strLocation && objG.Event_Category_Det.CategoryName == strCategory select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdLocationRepeats(string strLocation, string strRepeat, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Repeats == strRepeat && objG.UserAdsDet.AdType == adtype && objG.UserAdsDet.City == strLocation select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Two Field Search(Date & Others) public IQueryable SearchAdDateCategory(DateTime datefrom, DateTime dateto, string strCategory, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Event_Category_Det.CategoryName == strCategory && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdDateRepeats(DateTime datefrom, DateTime dateto, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Repeats == strRepeats && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Two Field Search(Category & Repeats) public IQueryable SearchAdCategoryRepeats(string strCategory, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Event_Category_Det.CategoryName == strCategory && objG.UserAdsDet.AdType == adtype && objG.Repeats == strRepeats select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Three Field Search(Location, Date & Others) public IQueryable SearchAdLocDateCategory(string strLocation, DateTime datefrom, DateTime dateto, string strCategory, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.City == strLocation && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) && objG.Event_Category_Det.CategoryName == strCategory select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdLocDateRepeats(string strLocation, DateTime datefrom, DateTime dateto, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.City == strLocation && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) && objG.Repeats == strRepeats select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } public IQueryable SearchAdLocCategoryRepeats(string strLocation, string strCategory, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.UserAdsDet.City == strLocation && objG.UserAdsDet.AdType == adtype && objG.Event_Category_Det.CategoryName == strCategory && objG.Repeats == strRepeats select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Three Field Search(Date, Category & Repeats) public IQueryable SearchAdDateCategoryRepeats(DateTime datefrom, DateTime dateto, string strCategory, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Event_Category_Det.CategoryName == strCategory && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) && objG.Repeats == strRepeats select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion #region Four Field Search(Location, Date, Category & Repeats) public IQueryable SearchAdLocDateCategoryRepeats(string strLocation, DateTime datefrom, DateTime dateto, string strCategory, string strRepeats, string adtype) { var objA = (from objG in dbEmup.Event_Creates where objG.UserAdsDet.Status == null && objG.Event_Category_Det.CategoryName == strCategory && objG.UserAdsDet.AdType == adtype && (Convert.ToDateTime(objG.EventDate) >= datefrom && Convert.ToDateTime(objG.EventDate) <= dateto) && objG.Repeats == strRepeats && objG.UserAdsDet.City == strLocation select new { AdId = objG.AdId, AdTitle = objG.UserAdsDet.AdTitle, Category = objG.UserAdsDet.CategoryDet.Categoryname, SubCategory = objG.UserAdsDet.SubCategoryDet.SubCategory, Location = objG.UserAdsDet.City, CategoryId = objG.UserAdsDet.CategoryId, SubcategoryId = objG.UserAdsDet.SubCategoryId, Name = objG.UserAdsDet.UserDet.Name, Date = objG.EventDate, EventDate = objG.EventDate, City = objG.UserAdsDet.City, StartTime = objG.StartTime, EndTime = objG.EndTime, AdEventDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdOrganizerDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdSupplierDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, AdVenueDetail = objG.UserAdsDet.City.Replace(",", "-") + "-" + objG.Event_Name.Replace(" ", "-").Replace(",", "").Replace(":", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("(", "").Replace(")", "").Replace("+", "").Replace("=", "").Replace("{", "").Replace("}", "").Replace(";", "").Replace("'", "").Replace("<", "").Replace(">", "").Replace("/", "").Replace("?", "").Replace("|", "").Trim() + "-" + objG.AdId, }).Take(100); return objA; } #endregion }