コード例 #1
0
        public void GetVar_NameNotRegistered()
        {
            SiteVariables vars = new SiteVariables(landscape, ecoregionsMap);

            ISiteVar <bool> fetchedVar = vars.GetVar <bool>("Should not exist");

            Assert.IsNull(fetchedVar);
        }
コード例 #2
0
ファイル: Header.ascx.cs プロジェクト: AlbertodAragon/git
        protected void Page_Load(object sender, EventArgs e)
        {
            short siteId;

            SiteVariables vars = new SiteVariables();

            siteId = short.Parse(vars["siteid"]);

            NavPopulator navPopulator = new NavPopulator(ref navigation, siteId, 0, "", "", false);
            //NavPopulator navPopulator = new NavPopulator(ref navigation, siteId, 0, "", "", false);
        }
コード例 #3
0
		public void GetVar()
		{
			ISiteVar<bool> var = landscape.NewSiteVar<bool>();
			string name = "My Site Variable";
			SiteVariables vars = new SiteVariables(landscape, ecoregionsMap);
			vars.RegisterVar(var, name);

			ISiteVar<bool> fetchedVar = vars.GetVar<bool>(name);
			Assert.IsNotNull(fetchedVar);
			Assert.AreEqual(var, fetchedVar);
		}
コード例 #4
0
		public void Init()
		{
			bool[,] array = new bool[0,0];
			DataGrid<bool> grid = new DataGrid<bool>(array);
			landscape = new Landscape.Landscape(grid);

			Ecoregions.IDataset ecoregions = new Ecoregions.Dataset(null);
			ecoregionsMap = new Ecoregions.Map(Data.MakeInputPath("ecoregions-0by0.gis"),
			                                   ecoregions);
			siteVars = new SiteVariables(landscape, ecoregionsMap);
		}
コード例 #5
0
        public void Init()
        {
            bool[,] array = new bool[0, 0];
            DataGrid <bool> grid = new DataGrid <bool>(array);

            landscape = new Landscape.Landscape(grid);

            Ecoregions.IDataset ecoregions = new Ecoregions.Dataset(null);
            ecoregionsMap = new Ecoregions.Map(Data.MakeInputPath("ecoregions-0by0.gis"),
                                               ecoregions);
            siteVars = new SiteVariables(landscape, ecoregionsMap);
        }
コード例 #6
0
        public void GetVar()
        {
            ISiteVar <bool> var  = landscape.NewSiteVar <bool>();
            string          name = "My Site Variable";
            SiteVariables   vars = new SiteVariables(landscape, ecoregionsMap);

            vars.RegisterVar(var, name);

            ISiteVar <bool> fetchedVar = vars.GetVar <bool>(name);

            Assert.IsNotNull(fetchedVar);
            Assert.AreEqual(var, fetchedVar);
        }
コード例 #7
0
ファイル: default.aspx.cs プロジェクト: AlbertodAragon/git
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.PageID = 1111;

            short         siteId;
            SiteVariables vars = new SiteVariables();

            siteId = short.Parse(vars["siteid"]);

            PageTextPopulator pageTextPopulator;

            pageTextPopulator = new PageTextPopulator(1111, 1, siteId);
            this.HPText       = pageTextPopulator.Body;
        }
コード例 #8
0
ファイル: Content.aspx.cs プロジェクト: AlbertodAragon/git
        protected void Page_Load(object sender, EventArgs e)
        {
            short  siteId;
            string defaultSectionUrl, defaultPageUrl, section, page;

            page    = Request.QueryString["page"];
            section = Request.QueryString["section"];

            SiteVariables     vars;
            PageTextPopulator pageTextPopulator = null;

            vars              = new SiteVariables();
            siteId            = short.Parse(vars["siteid"]);
            defaultSectionUrl = vars["defaultsectionurl"];
            defaultPageUrl    = vars["defaultpageurl"];

            // if no default section/page url then show default page
            if (section == null && page == null)
            {
                Server.Transfer("/PageNotFound.aspx");
            }
            else if (page == null)
            {
                pageTextPopulator = new PageTextPopulator(section, 1, siteId, string.Empty);
            }
            else
            {
                pageTextPopulator = new PageTextPopulator(page, 1, siteId, section);
            }

            if (pageTextPopulator.PageId == 0)
            {
                Server.Transfer("/PageNotFound.aspx");
            }
            else
            {
                Page.Title     = pageTextPopulator.PageTitle + " - " + vars["sitename"];
                this.PageTitle = pageTextPopulator.PageTitle;
                this.BodyText  = pageTextPopulator.Body;

                Master.MetaTitle       = string.IsNullOrEmpty(pageTextPopulator.SeoTitle) ? pageTextPopulator.PageTitle : pageTextPopulator.SeoTitle;
                Master.MetaDescription = pageTextPopulator.SeoDesc;
                Master.MetaKeywords    = pageTextPopulator.SeoKeywords;
                Master.PageID          = pageTextPopulator.PageId;

                Slideshow.ParentID = pageTextPopulator.PageId;
            }
        }
コード例 #9
0
        public void GetVar_TypeMismatch()
        {
            ISiteVar <bool> var  = landscape.NewSiteVar <bool>();
            string          name = "My Site Variable";
            SiteVariables   vars = new SiteVariables(landscape, ecoregionsMap);

            vars.RegisterVar(var, name);

            try {
                ISiteVar <int> fetchedVar = vars.GetVar <int>(name);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            short         siteId;
            SiteVariables vars = new SiteVariables();

            siteId = short.Parse(vars["siteid"]);

            PageTextPopulator pageTextPopulator;

            pageTextPopulator = new PageTextPopulator(585, 1, siteId);
            this.NeighText    = pageTextPopulator.Body;

            /*Property property = new Property(new SiteData().ConnectionString);
             * property.PropertyType = int.Parse(Request.QueryString["propertytype"]);
             * property.LoadTypeInformation();
             *
             * PropertyItem mypropertyType = property.PropertyItems[0];
             *
             * this.Title = mypropertyType.Title;
             * this.BodyText = mypropertyType.Standfirst;
             * this.FloorplanImage = mypropertyType.Image;*/
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string urlID = Request.QueryString["blog"];

            if (urlID != null)
            {
                /*DAL.BlogList blogList = new DAL.BlogList(new SiteData().ConnectionString, urlID);*/

                DAL.BlogList blogList = new DAL.BlogList(new SiteData().ConnectionString);
                blogList.TableName = this.TableName;
                blogList.UrlId     = urlID;
                blogList.LoadByUrlId();

                if (blogList.Blogs.Count == 0)
                {
                    Server.Transfer("/PageNotFound.aspx");
                }
                else
                {
                    rptBlogs.DataSource = blogList.Blogs;
                    rptBlogs.DataBind();

                    SiteVariables vars = new SiteVariables();
                    Page.Title = blogList.Blogs[0].Title + " - Blogs - " + vars["sitename"];
                }

                if (this.TableName == "stories")
                {
                    this.LinkBack = "Journey";
                }
                else
                {
                    this.LinkBack = this.TableName;
                }
            }
        }
コード例 #12
0
		protected void Page_Load(object sender, EventArgs e)
		{
			string referer, subject;

			referer = Request.ServerVariables["http_referer"];
			subject = "Event";

			if (Request.IsLocal || (referer.IndexOf("lyons") > 0 && subject != null))
			{
				string body, outcome, fromName, logText = string.Empty, connectionString = string.Empty, notes;
				string title_id = string.Empty, source_id = string.Empty, country_id = string.Empty;
				string reason_id = string.Empty, applicantId;

		/*		if (string.IsNullOrEmpty(Request.Form["ftitle_id"]))
				{
					title_id = "0";
				}
				else
				{
					title_id = Request.Form["ftitle_id"].ToString().Split('|')[0];
				}
				*/
			
 
				SiteVariables vars = new SiteVariables();

				fromName = Request.Form["ffirst-name"] + " " + Request.Form["flast-name"];

				body = "<p>A User has sent the following " + subject + " Request From Lyons Place Website.</p>";

				foreach (String sItem in Request.Form)
				{
					body += "<p>" + sItem.Substring(1).ToUpper() + ": " + Request.Form[sItem] + "</p>";

					logText += "\"" + Request.Form[sItem] + "\",";					
				}

				LogFile logFile = new LogFile();
				logFile.LogFileName = "contact-us.txt";
				logFile.AddLine(logText);

				notes = "Interested in " + Request.Form["finterested"] + Environment.NewLine + Environment.NewLine
					+ Request.Form["fcomments"];

				List<string> applicant = new List<string>();
				//applicant.Add(title_id);
				applicant.Add(Request.Form["ffirst-name"]);
				applicant.Add(Request.Form["flast-name"]);
				applicant.Add(Request.Form["fmobile"]);
				applicant.Add(Request.Form["femail"]);
				applicant.Add(Request.Form["fguestnumber"]);
			
				applicant.Add("3"); // development Id

				if (Request.IsLocal)
				{
					connectionString = "Server=localhost;Database=almacantar;Uid=root;Pwd=jhp5uck5;Allow Zero Datetime=True;";
				}
				else
				{
					connectionString = "Server=mysql.surgesolutions.co.uk;Database=almacantar;Uid=almacantar_user;Pwd=*d3v3!0pm3nt5*;Allow Zero Datetime=True;";
				}

				//CommonFeatures commonFeatures = new CommonFeatures(connectionString);
				//applicantId = commonFeatures.RecordApplicantInCRM(applicant);

				if (!Request.IsLocal)
				{
			//		GenFolders(fromName + "-" + applicantId);
				}

				Email oEmail = new Email();
				oEmail.SMTPServer = "smtp.socketlabs.com";
				oEmail.CredentialUsername = "******";
				oEmail.CredentialPassword = "******";
				oEmail.EnableSsl = false;

				oEmail.FromName = vars["fromname"];
				oEmail.EmailFrom = vars["emailfrom"];
				//oEmail.ReplyToName = fromName;
				//oEmail.ReplyTo = Request.Form["femail"];
				oEmail.ToName = vars["toname"];
				oEmail.EmailTo = vars["emailto2"];
				oEmail.Subject = subject + " Request From Lyons Place website";   
				oEmail.IsBodyHtml = true;
				oEmail.Body = body;

				outcome = oEmail.SendEmail();
                //outcome = "EMAIL SENT";

				if (outcome == "EMAIL SENT")
				{
					Response.Write("OK");
				}
				else
				{
					Response.Write("f");
				}
			}
		}
コード例 #13
0
		public void GetVar_NameNotRegistered()
		{
			SiteVariables vars = new SiteVariables(landscape, ecoregionsMap);

			ISiteVar<bool> fetchedVar = vars.GetVar<bool>("Should not exist");
			Assert.IsNull(fetchedVar);
		}
コード例 #14
0
		public void GetVar_TypeMismatch()
		{
			ISiteVar<bool> var = landscape.NewSiteVar<bool>();
			string name = "My Site Variable";
			SiteVariables vars = new SiteVariables(landscape, ecoregionsMap);
			vars.RegisterVar(var, name);

			try {
				ISiteVar<int> fetchedVar = vars.GetVar<int>(name);
			}
			catch (System.Exception exc) {
				Data.Output.WriteLine(exc.Message);
				throw;
			}
		}
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string referer, subject;

            referer = Request.ServerVariables["http_referer"];
            subject = Request.Form["fsubject"];

            if (Request.IsLocal || (referer.IndexOf("lyons") > 0 && subject != null))
            {
                string         body, outcome, fromName, logText = string.Empty, connectionString = string.Empty, notes;
                string         title_id = string.Empty, source_id = string.Empty, country_id = string.Empty;
                string         reason_id = string.Empty, applicantId, utmSessionId, utmSource = string.Empty, utmCampaign = string.Empty;
                CommonFeatures commonFeatures;

                if (Request.IsLocal)
                {
                    connectionString = "Server=localhost;Database=almacantar;Uid=root;Pwd=jhp5uck5;Allow Zero Datetime=True;";
                }
                else
                {
                    connectionString = "Server=mysql.surgesolutions.co.uk;Database=almacantar;Uid=almacantar_user;Pwd=*d3v3!0pm3nt5*;Allow Zero Datetime=True;";
                }

                if (string.IsNullOrEmpty(Request.Form["ftitle"]))
                {
                    title_id = "0";
                }
                else
                {
                    title_id = Request.Form["ftitle"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["fenquiry-source"]))
                {
                    source_id = "0";
                }
                else
                {
                    source_id = Request.Form["fenquiry-source"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["fcountry"]))
                {
                    country_id = "0";
                }
                else
                {
                    country_id = Request.Form["fcountry"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["freason-for-purchase"]))
                {
                    reason_id = "0";
                }
                else
                {
                    reason_id = Request.Form["freason-for-purchase"].ToString().Split('|')[0];
                }

                SiteVariables vars = new SiteVariables();

                fromName = Request.Form["ffirst-name"] + " " + Request.Form["flast-name"];

                body = "<p>A User has sent the following " + subject + " Request From Lyons Place Website.</p>";

                foreach (String sItem in Request.Form)
                {
                    if (!string.IsNullOrEmpty(sItem))
                    {
                        body += "<p>" + sItem.Substring(1).ToUpper() + ": " + Request.Form[sItem] + "</p>";
                    }
                    logText += "\"" + Request.Form[sItem] + "\",";
                }

                commonFeatures = new CommonFeatures(connectionString);

                utmSessionId = CommonFeatures.ReadCookie("utmc");

                if (!string.IsNullOrEmpty(utmSessionId))
                {
                    UTMItem utmItem = commonFeatures.GetUTMForExport(utmSessionId);

                    if (!string.IsNullOrEmpty(utmItem.ID))
                    {
                        body    += "<p>UTM Campaign: " + utmItem.Campaign + "</p>";
                        logText += "\"" + utmItem.Campaign + "\",";

                        // save utm
                        utmItem.PageUrl       = "ProcessForm.aspx";
                        utmItem.PageName      = "REGD";
                        utmItem.SessionID     = utmSessionId;
                        utmItem.DevelopmentID = "3";
                        commonFeatures.RecordUTM(utmItem);

                        source_id   = "38";
                        utmSource   = utmItem.Source;
                        utmCampaign = utmItem.Campaign;
                    }
                }

                LogFile logFile = new LogFile();
                logFile.LogFileName = "contact-us-" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt";
                logFile.AddLine(logText + "\"" + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss") + "\"");

                notes = "Interested in " + Request.Form["interested"] + Environment.NewLine + Environment.NewLine
                        + Request.Form["fcomments"];

                List <string> applicant = new List <string>();
                applicant.Add(title_id);
                applicant.Add(Request.Form["ffirst-name"]);
                applicant.Add(Request.Form["flast-name"]);
                applicant.Add(Request.Form["fmobile"]);
                applicant.Add(Request.Form["femail"]);
                applicant.Add(source_id);
                applicant.Add(country_id);
                applicant.Add(reason_id);
                applicant.Add(notes);
                applicant.Add("3");                 // development Id
                applicant.Add(utmSessionId);
                applicant.Add(utmSource);
                applicant.Add(utmCampaign);
                applicantId = commonFeatures.RecordApplicantInCRM(applicant);

                if (!Request.IsLocal)
                {
                    GenFolders(fromName + "-" + applicantId);
                }

                Email oEmail = new Email();
                oEmail.SMTPServer         = "smtp.socketlabs.com";
                oEmail.CredentialUsername = "******";
                oEmail.CredentialPassword = "******";
                oEmail.EnableSsl          = false;

                oEmail.FromName    = fromName;
                oEmail.EmailFrom   = vars["emailfrom"];
                oEmail.ReplyToName = fromName;
                oEmail.ReplyTo     = Request.Form["femail"];
                oEmail.ToName      = vars["toname"];
                oEmail.EmailTo     = vars["emailto"];
                oEmail.Subject     = subject + " Request From Lyons Place website";
                oEmail.IsBodyHtml  = true;
                oEmail.Body        = body;

                outcome = oEmail.SendEmail();

                body = "Hi James Guilfoyle,"
                       + "<br /><br />"
                       + "Please see the new lead below."
                       + "<br /><br />"
                       + "<strong>" + fromName + "</strong>: https://www.almacantar.surgesolutions.co.uk/applicant-profile/" + applicantId;

                oEmail.ToName  = "James Guilfoyle";
                oEmail.EmailTo = "*****@*****.**";
                oEmail.Subject = "Lyons Place - New Lead";
                oEmail.Body    = body;

                outcome = oEmail.SendEmail();

                Response.Write("OK");
            }
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            short  siteId;
            string ddHtml;

            if (Session["utm"] != null || !string.IsNullOrEmpty(CommonFeatures.ReadCookie("utmc")))
            {
                this.UTMSession = true;
            }
            else
            {
                this.UTMSession = false;
            }

            SiteVariables vars = new SiteVariables();

            siteId = short.Parse(vars["siteid"]);

            NavPopulator navPopulator;

            navPopulator = new NavPopulator(ref footernav, siteId, 0, "", "", "", 2);

            currentyear.Text = DateTime.Now.Year.ToString();


            //country of residence

            ListBox listBox = new ListBox(new SiteData().ConnectionString);

            listBox.LoadCountryOfResidence();

            ddHtml = "<select onchange=\"LabelAnimationSelect('fcountry')\" id=\"fcountry\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.CountryDropDown = ddHtml;

            //Reason of purchase

            listBox.ListBoxItems.Clear();
            listBox.LoadReasonOfPurchase();

            ddHtml = "<select onchange=\"LabelAnimationSelect('freason-for-purchase')\" id=\"freason-for-purchase\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.ReasonPurchaseDropDown = ddHtml;

            //enquiry Source

            listBox.ListBoxItems.Clear();
            listBox.LoadEnquirySource();

            ddHtml = "<select onchange=\"LabelAnimationSelect('fenquiry-source')\" id=\"fenquiry-source\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.EnquirySourceDropDown = ddHtml;

            //title dropdown

            listBox.ListBoxItems.Clear();
            listBox.LoadTitles();

            ddHtml = "<select onchange=\"LabelAnimationSelect('ftitle')\" id=\"ftitle\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.TitleDropDown = ddHtml;



            /*****  Footer nav content *****/

            PageTextPopulator pageTextPopulator;

            pageTextPopulator   = new PageTextPopulator(1129, 1, siteId);
            this.CoockieContent = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;

            pageTextPopulator     = new PageTextPopulator(1130, 1, siteId);
            this.DisclaimerContet = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;

            pageTextPopulator   = new PageTextPopulator(1131, 1, siteId);
            this.PrivacyContent = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;


            /*********** session cookie policy ******/

            //string aaaa = Context.Session["lp-cookie"].ToString();
        }