Ejemplo n.º 1
0
        private void UpdateDisclaimer()
        {
            // Disclaimer objDisc = new Disclaimer();
            Disclaimer objDisc = DesclaimerController.GetDisclaimerByMemberId(MemberId);

            objDisc.clubId                    = LoginUser.ClubId;
            objDisc.memberId                  = MemberId;
            objDisc.RFIDNo                    = txtRFIDCardNumber.Text;
            objDisc.date                      = DateTime.Now;
            objDisc.height                    = txtHeight.Text;
            objDisc.weight                    = txtWeight.Text;
            objDisc.frameSize                 = txtFrameSize.Text;
            objDisc.emergencyRefName1         = txtName1.Text;
            objDisc.emergencyRefRelationship1 = txtRelation1.Text;
            objDisc.emergencyRefMobNo1        = txtMobileno1.Text;
            objDisc.emergencyRefLandLineNo1   = txtLandline1.Text;
            objDisc.emeregencyArea1           = txtArea1.Text;
            objDisc.emergencyRefName2         = txtName2.Text;
            objDisc.emergencyRefRelationship2 = txtRelation2.Text;
            objDisc.emergencyRefMobNo2        = txtMobileno2.Text;
            objDisc.emergencyRefLandLineNo2   = txtLandline2.Text;
            objDisc.emeregencyArea2           = txtArea2.Text;
            objDisc.emergencyRefName3         = txtName3.Text;
            objDisc.emergencyRefRelationship3 = txtRelation3.Text;
            objDisc.emergencyRefMobNo3        = txtMobileno3.Text;
            objDisc.emergencyRefLandLineNo3   = txtLandline3.Text;
            objDisc.emeregencyArea3           = txtArea3.Text;
            objDisc.familyDoctorName          = txtFamDocName.Text;
            objDisc.familyDoctorMobileNumber  = txtFamDocNo.Text;

            objDisc = new DesclaimerController().UpdateDisclaimer(objDisc);
            new DisclaimerQuestionController().DeleteAllDisclaimerQuestionAnswerByDisclaimerId(objDisc.ID);

            InsertDisclaimerQuestionAnswers(objDisc);
        }
Ejemplo n.º 2
0
        private void BindDiscalimerValues()
        {
            Membership objMember = DesclaimerController.GetDisclaimerByRFIDNo(RFIDNumber);
            Disclaimer objDis    = DesclaimerController.GetDisclaimerByMemberId(MemberId);

            txtRFIDCardNumber.Text = objDis.RFIDNo;
            objDis.date            = UtillController.ConvertDateTime(Convert.ToDateTime(txtDate.Text).ToString().Substring(0, 10));
            txtHeight.Text         = objDis.height;
            txtWeight.Text         = objDis.weight;
            txtFrameSize.Text      = objDis.frameSize;
            txtName1.Text          = objDis.emergencyRefName1;
            txtRelation1.Text      = objDis.emergencyRefRelationship1;
            txtMobileno1.Text      = objDis.emergencyRefMobNo1;
            txtLandline1.Text      = objDis.emergencyRefLandLineNo1;
            txtArea1.Text          = objDis.emeregencyArea1;
            txtName2.Text          = objDis.emergencyRefName2;
            txtRelation2.Text      = objDis.emergencyRefRelationship2;
            txtMobileno2.Text      = objDis.emergencyRefMobNo2;
            txtLandline2.Text      = objDis.emergencyRefLandLineNo2;
            txtArea2.Text          = objDis.emeregencyArea2;
            txtName3.Text          = objDis.emergencyRefName3;
            txtRelation3.Text      = objDis.emergencyRefRelationship3;
            txtMobileno3.Text      = objDis.emergencyRefMobNo3;
            txtLandline3.Text      = objDis.emergencyRefLandLineNo3;
            txtArea3.Text          = objDis.emeregencyArea3;
            txtFamDocName.Text     = objDis.familyDoctorName;
            txtFamDocNo.Text       = objDis.familyDoctorMobileNumber;
            new DesclaimerController().UpdateDisclaimer(objDis);
        }
        public void Execute(AddUpdateDisclaimerCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            var existing = _unitOfWork.Context.Set <Disclaimer>().FirstOrDefault(x => x.DisclaimerId == command.DisclaimerId);

            if (existing != null)
            {
                existing.IsAgreed = command.IsAgreed;
            }
            else
            {
                var disclaimer = new Disclaimer
                {
                    DisclaimerId       = command.DisclaimerId,
                    IsAgreed           = command.IsAgreed,
                    AssessorDomainName = _userPrincipalProvider.CurrentUserName
                };

                _unitOfWork.Context.Set <Disclaimer>().Add(disclaimer);
            }
        }
Ejemplo n.º 4
0
 public DisclaimerViewModel BuildDisclaimerViewModel(Disclaimer disclaimer)
 {
     return(new DisclaimerViewModel()
     {
         TermsAndConditionsEnabled = disclaimer == null || !disclaimer.IsAgreed,
         IsAgreed = disclaimer != null && disclaimer.IsAgreed,
         DisclaimerId = disclaimer != null ? disclaimer.DisclaimerId : Guid.Empty
     });
 }
Ejemplo n.º 5
0
        public ActionResult CreateDisclaimer()
        {
            var disclaimer = new Disclaimer
            {
                LastUpdate = DateTime.Now,
            };

            return(View(disclaimer));
        }
Ejemplo n.º 6
0
        public void IndexGET_GivenDisclaimer_DisclaimerViewModelBuilderShouldBeCalled()
        {
            var disclaimer = new Disclaimer();

            A.CallTo(() => _queryDispatcher.Dispatch <DisclaimerByUserQuery, Disclaimer>(A <DisclaimerByUserQuery> ._)).Returns(disclaimer);

            _controller.Index();

            A.CallTo(() => _disclaimerViewModelBuilder.BuildDisclaimerViewModel(disclaimer)).MustHaveHappened(Repeated.Exactly.Once);
        }
        public void BuildDisclaimerViewModel_GivenDisclaimerIsNotAgreed_IsAgreedPropertyShouldBeMapped()
        {
            var disclaimer = new Disclaimer()
            {
                IsAgreed = false
            };

            var result = _builder.BuildDisclaimerViewModel(disclaimer);

            result.IsAgreed.Should().BeFalse();
        }
        public void BuildDisclaimerViewModel_GivenDisclaimerIsNotNullAndHasNotBeenAgreed_TermsAndConditionsPropertyShouldBeTrue()
        {
            var disclaimer = new Disclaimer()
            {
                IsAgreed = false
            };

            var result = _builder.BuildDisclaimerViewModel(disclaimer);

            result.TermsAndConditionsEnabled.Should().BeTrue();
        }
Ejemplo n.º 9
0
 public ActionResult EditDisclaimer(Disclaimer disclaimer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(disclaimer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     disclaimer.Description = Server.HtmlDecode(disclaimer.Description);
     return(View(disclaimer));
 }
Ejemplo n.º 10
0
 public ActionResult CreateDisclaimer(Disclaimer disclaimer)
 {
     if (ModelState.IsValid)
     {
         db.Disclaimers.Add(disclaimer);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     disclaimer.Description = Server.HtmlDecode(disclaimer.Description);
     return(View(disclaimer));
 }
Ejemplo n.º 11
0
        public void DisclaimerTest()
        {
            var        northArrowS = new Disclaimer();
            Disclaimer northArrowD = null;

            Assert.DoesNotThrow(() => northArrowD = SandD(northArrowS, GetFormatter()));
            Assert.IsNotNull(northArrowD);

            var eqc = new DisclaimerEqualityComparer();

            Assert.IsTrue(eqc.Equals(northArrowS, northArrowD), eqc.ToString());
        }
        public void BuildDisclaimerViewModel_GivenDisclaimer_DisclaimerIdShouldBeSet()
        {
            var disclaimerId = Guid.NewGuid();

            var disclaimer = new Disclaimer()
            {
                DisclaimerId = disclaimerId
            };

            var result = _builder.BuildDisclaimerViewModel(disclaimer);

            result.DisclaimerId.Should().Be(disclaimerId);
        }
Ejemplo n.º 13
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var disclaimer = new Disclaimer();

            var result = disclaimer.ShowDialog();

            if (result == DialogResult.Yes)
            {
                TVTEditorApplication.Instance.Initialize();
                Application.Run(new MainForm());
            }
        }
Ejemplo n.º 14
0
        public void TestHttp(string kmlWebResource, string description)
        {
            var m = new Map(new Size(500, 300));

            m.BackColor = Color.White;

            KmlProvider p = null;

            var request = WebRequest.Create(kmlWebResource);

            using (var response = request.GetResponse())
            {
                if (response.ContentType == "None" || response.ContentType.Contains("vnd.google-earth.kml"))
                {
                    var s = response.GetResponseStream();
                    p = KmlProvider.FromKml(s);
                }

                else if (response.ContentType.Contains("vnd.google-earth.kmz"))
                {
                    p = KmlProvider.FromKmz(response.GetResponseStream(), "doc.kml");
                }
            }

            var l = new VectorLayer(p.ConnectionID, p);

            l.Theme = p.GetKmlTheme();
            m.Layers.Add(l);

            // Takes ages to render
//            var labelLayer = new LabelLayer("Labels");
//            labelLayer.DataSource = p;
//            labelLayer.LabelColumn = "Name";
//            m.Layers.Add(labelLayer);

            ZoomToExtentsWithMargin(m);

            var disclaimer = new Disclaimer();

            disclaimer.Text   = kmlWebResource;
            disclaimer.Anchor = MapDecorationAnchor.LeftTop;
            m.Decorations.Add(disclaimer);

            using (var img = m.GetMap())
                img.Save(System.IO.Path.Combine(UnitTestsFixture.GetImageDirectory(this), description + ".png"), ImageFormat.Png);
        }
Ejemplo n.º 15
0
        private void InsertDisclaimerQuestionAnswers(Disclaimer objDis)
        {
            try
            {
                //insert Question Answer....
                foreach (ListViewItem lstQuestionList in lstQuestions.Items)
                {
                    //hdnFldQuestionId,hdnFldQuestionTypeId,txtQuestionAnswer,lstQuestionOptions
                    HiddenField hdnFldQuestionId     = (HiddenField)lstQuestionList.FindControl("hdnFldQuestionId");
                    HiddenField hdnFldQuestionTypeId = (HiddenField)lstQuestionList.FindControl("hdnFldQuestionTypeId");
                    TextBox     txtQuestionAnswer    = (TextBox)lstQuestionList.FindControl("txtQuestionAnswer");
                    ListView    lstQuestionOptions   = (ListView)lstQuestionList.FindControl("lstQuestionOptions");

                    if (Convert.ToInt32(hdnFldQuestionTypeId.Value) == 1) // single type
                    {
                        DisclaimerQuestionAnswer objDisQueAnswer = new DisclaimerQuestionAnswer();
                        objDisQueAnswer.disclaimerId = objDis.ID;
                        objDisQueAnswer.questionId   = Convert.ToInt64(hdnFldQuestionId.Value);
                        objDisQueAnswer.answerText   = txtQuestionAnswer.Text;
                        objDisQueAnswer = new DisclaimerQuestionController().InsertDisclaimerQuestionAnswer(objDisQueAnswer);
                    }
                    else if (Convert.ToInt32(hdnFldQuestionTypeId.Value) == 2)// multi type
                    {
                        foreach (ListViewItem lstOptionList in lstQuestionOptions.Items)
                        {
                            //hdnFldOptionId,chkOptions
                            HiddenField hdnFldOptionId = (HiddenField)lstOptionList.FindControl("hdnFldOptionId");
                            CheckBox    chkOptions     = (CheckBox)lstOptionList.FindControl("chkOptions");
                            if (chkOptions.Checked)
                            {
                                DisclaimerQuestionAnswer objDisQueAnswer = new DisclaimerQuestionAnswer();
                                objDisQueAnswer.disclaimerId = objDis.ID;
                                objDisQueAnswer.questionId   = Convert.ToInt64(hdnFldQuestionId.Value);
                                objDisQueAnswer.optionId     = Convert.ToInt64(hdnFldOptionId.Value);
                                objDisQueAnswer = new DisclaimerQuestionController().InsertDisclaimerQuestionAnswer(objDisQueAnswer);
                            }
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 16
0
        public static IDisclaimer ToDisclaimer(this HashEntry[] hashEntry)
        {
            var disclaimer = new Disclaimer();

            var hashDict = hashEntry.ToDictionary();

            if (hashDict.TryGetValue(nameof(disclaimer.Id), out var id))
            {
                disclaimer.Id = id;
            }

            if (hashDict.TryGetValue(nameof(disclaimer.LykkeEntityId), out var lykkeEntityId))
            {
                disclaimer.LykkeEntityId = lykkeEntityId;
            }

            if (hashDict.TryGetValue(nameof(disclaimer.Type), out var type))
            {
                disclaimer.Type = Enum.Parse <DisclaimerType>(type);
            }

            if (hashDict.TryGetValue(nameof(disclaimer.Name), out var name))
            {
                disclaimer.Name = name;
            }

            if (hashDict.TryGetValue(nameof(disclaimer.Text), out var text))
            {
                disclaimer.Text = text;
            }

            if (hashDict.TryGetValue(nameof(disclaimer.StartDate), out var startDate))
            {
                disclaimer.StartDate = DateTime.Parse(startDate).ToUniversalTime();
            }

            if (hashDict.TryGetValue(nameof(disclaimer.ShowOnEachAction), out var showOnEachAction))
            {
                disclaimer.ShowOnEachAction = Convert.ToBoolean(showOnEachAction);
            }

            return(disclaimer);
        }
Ejemplo n.º 17
0
        public Disclaimer UpdateDisclaimer(Disclaimer objDisclaimer)
        {
            try
            {
                objDisclaimer.updateDate = DateTime.Now;
                using (var context = new FitnessCenterEntities())
                {
                    context.Disclaimers.Attach(context.Disclaimers.Single(varL => varL.ID == objDisclaimer.ID));
                    context.Disclaimers.ApplyCurrentValues(objDisclaimer);

                    context.SaveChanges();
                    return(objDisclaimer);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 18
0
        public void TestKmlStyles(string testDataFile, string description)
        {
            // NB additional symbols at http://kml4earth.appspot.com/icons.html
            var m = new Map(new Size(500, 300));

            m.BackColor = Color.AliceBlue;

            KmlProvider p;

            if (testDataFile.ToLower().EndsWith(".kml"))
            {
                p = KmlProvider.FromKml(TestUtility.GetPathToTestFile(testDataFile));
            }
            else
            {
                p = KmlProvider.FromKmz(TestUtility.GetPathToTestFile(testDataFile));
            }

            var l = new VectorLayer(p.ConnectionID, p);

            l.Theme = p.GetKmlTheme();

            m.Layers.Add(l);

            var labelLayer = new LabelLayer("Labels");

            labelLayer.DataSource          = p;
            labelLayer.LabelStringDelegate = (fdr) => ((Placemark)fdr["Object"]).Name;
            labelLayer.Style.Font          = new Font(labelLayer.Style.Font.FontFamily, 8f);
            m.Layers.Add(labelLayer);

            ZoomToExtentsWithMargin(m);

            var disclaimer = new Disclaimer();

            disclaimer.Text   = $"{description} \nOpen **{testDataFile}** in GoogleEarth for comparison";
            disclaimer.Anchor = MapDecorationAnchor.LeftTop;
            m.Decorations.Add(disclaimer);

            using (var img = m.GetMap())
                img.Save(System.IO.Path.Combine(UnitTestsFixture.GetImageDirectory(this), testDataFile + ".png"), ImageFormat.Png);
        }
Ejemplo n.º 19
0
        public Disclaimer InsertDisclaimer(Disclaimer objDisclaimer)
        {
            try
            {
                objDisclaimer.insertDate = DateTime.Now;
                objDisclaimer.isActive   = true;
                objDisclaimer.isDeleted  = false;

                using (var context = new FitnessCenterEntities())
                {
                    context.Disclaimers.AddObject(objDisclaimer);
                    context.SaveChanges();
                    return(objDisclaimer);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 20
0
        private void InsertDisclaimer()
        {
            try
            {
                Disclaimer objDis    = new Disclaimer();
                Membership objMember = new Membership();

                objDis.memberId                  = MemberId;
                objDis.clubId                    = LoginUser.ClubId;
                objDis.RFIDNo                    = txtRFIDCardNumber.Text;
                objDis.date                      = DateTime.Now;
                objDis.height                    = txtHeight.Text;
                objDis.weight                    = txtWeight.Text;
                objDis.frameSize                 = txtFrameSize.Text;
                objDis.emergencyRefName1         = txtName1.Text;
                objDis.emergencyRefRelationship1 = txtRelation1.Text;
                objDis.emergencyRefMobNo1        = txtMobileno1.Text;
                objDis.emergencyRefLandLineNo1   = txtLandline1.Text;
                objDis.emeregencyArea1           = txtArea1.Text;
                objDis.emergencyRefName2         = txtName2.Text;
                objDis.emergencyRefRelationship2 = txtRelation2.Text;
                objDis.emergencyRefMobNo2        = txtMobileno2.Text;
                objDis.emergencyRefLandLineNo2   = txtLandline2.Text;
                objDis.emeregencyArea2           = txtArea2.Text;
                objDis.emergencyRefName3         = txtName3.Text;
                objDis.emergencyRefRelationship3 = txtRelation3.Text;
                objDis.emergencyRefMobNo3        = txtMobileno3.Text;
                objDis.emergencyRefLandLineNo3   = txtLandline3.Text;
                objDis.emeregencyArea3           = txtArea3.Text;
                objDis.familyDoctorName          = txtFamDocName.Text;
                objDis.familyDoctorMobileNumber  = txtFamDocNo.Text;

                objDis = new DesclaimerController().InsertDisclaimer(objDis);
                InsertDisclaimerQuestionAnswers(objDis);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void BindProduct(ProductInfo_V02 product, bool showAllInventory, Dictionary <string, SKU_V01> allSKUS)
        {
            lbProductName.Text    = product.DisplayName;
            lbOverview.Text       = product.Overview;
            pDetails.InnerHtml    = product.Details ?? string.Empty;
            lbDetails.Visible     = pDetails.InnerHtml != string.Empty;
            pBenefits.InnerHtml   = product.Benefits ?? string.Empty;
            lbKeyBenefits.Visible = pBenefits.InnerHtml != string.Empty;
            pUsage.InnerHtml      = product.Usage ?? string.Empty;
            lbUsage.Visible       = pUsage.InnerHtml != string.Empty;
            pQuickFacts.InnerHtml = product.FastFacts ?? string.Empty;
            lbFastFacts.Visible   = pQuickFacts.InnerHtml != string.Empty;
            imgProduct.Src        = product.DefaultSKU.ImagePath ?? string.Empty;

            // icons
            if (product.Icons != null)
            {
                addIcons(product.Icons);
                tabIcons.Visible = product.Icons != null && product.Icons.Count > 0;
            }
            else
            {
                tabIcons.Visible = false;
            }

            // Disclaimers
            if (product.Disclaimers != null)
            {
                Disclaimer.DataSource = (from p in product.Disclaimers
                                         select p.Description);
                Disclaimer.DataBind();
                divDisclaimer.Visible = product.Disclaimers.Count > 0;
            }
            else
            {
                divDisclaimer.Visible = false;
            }
            populateProducts(product, showAllInventory, allSKUS);
        }
Ejemplo n.º 22
0
        void ReleaseDesignerOutlets()
        {
            if (Description != null)
            {
                Description.Dispose();
                Description = null;
            }

            if (Disclaimer != null)
            {
                Disclaimer.Dispose();
                Disclaimer = null;
            }

            if (DisclaimerCenterYAccessibilityConstraint != null)
            {
                DisclaimerCenterYAccessibilityConstraint.Dispose();
                DisclaimerCenterYAccessibilityConstraint = null;
            }

            if (DisclaimerCenterYNormalConstraint != null)
            {
                DisclaimerCenterYNormalConstraint.Dispose();
                DisclaimerCenterYNormalConstraint = null;
            }

            if (GetStartedButton != null)
            {
                GetStartedButton.Dispose();
                GetStartedButton = null;
            }

            if (Title != null)
            {
                Title.Dispose();
                Title = null;
            }
        }
        /*
         * Shows disclaimer for a first time Run
         */
        private void showDisclaimer()
        {
            //Properties.Settings.Default["FirstRun"] = false;

            bool firstRun = (bool)Properties.Settings.Default["FirstRun"];

            if (firstRun == true)
            //if(true)
            {
                //First application run
                //Update setting
                Properties.Settings.Default["FirstRun"] = false;
                //Save setting
                Properties.Settings.Default.Save();

                Disclaimer disclaimer = new Disclaimer();
                disclaimer.ShowDialog();
            }
            else
            {
                //Not first time of running application.
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        ///     Gets the current map.
        /// </summary>
        /// <returns>The map.</returns>
        private SharpMap.Map GetMap()
        {
            var map = new SharpMap.Map(new Size(1, 1))
            {
                BackColor = Color.FromArgb(255, 246, 243, 236)
            };
            var disclaimer = new Disclaimer
            {
                Font   = new Font("Arial", 7f, FontStyle.Italic),
                Text   = "Geodata from OpenStreetMap (CC-by-SA)\nTransformed to Shapefile by geofabrik.de",
                Anchor = MapDecorationAnchor.CenterBottom
            };

            map.Decorations.Add(disclaimer);
            var encoding         = Encoding.UTF8;
            var transparentStyle = new VectorStyle
            {
                Fill          = Brushes.Transparent,
                EnableOutline = true,
                Line          = { Brush = Brushes.Transparent },
                Outline       = { Brush = Brushes.Transparent },
                Symbol        = null
            };

            #region cuba

            var cubaLayer = new VectorLayer("cuba",
                                            new ShapeFile(Path.Combine(ShapeDir, "admin.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                Style = new VectorStyle
                {
                    EnableOutline = true,
                    Fill          = Brushes.FloralWhite
                },
                SmoothingMode   = SmoothingMode.AntiAlias,
                ClippingEnabled = true
            };
            map.Layers.Add(cubaLayer);

            #endregion

            #region landuse layer

            var landuseStyle = transparentStyle.Clone();
            landuseStyle.Fill = new SolidBrush(Color.FromArgb(255, 246, 243, 236));
            var landuseLayer = new VectorLayer("landuse",
                                               new ShapeFile(Path.Combine(ShapeDir, "gis.osm_landuse_a_free_1.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                Style           = landuseStyle,
                SmoothingMode   = SmoothingMode.AntiAlias,
                ClippingEnabled = true
            };
            var landuseTheme = new CustomTheme(row =>
            {
                var caseVal     = (string)row["fclass"];
                caseVal         = caseVal.ToLowerInvariant();
                var returnStyle = landuseStyle.Clone();

                switch (caseVal)
                {
                case "forest":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 221, 230, 213));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 221, 230, 213));
                    break;

                case "park":
                case "grass":
                case "national_park":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 200, 225, 175));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 200, 225, 175));
                    break;

                case "residential":
                case "commercial":
                case "retail":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 231, 227, 216));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 231, 227, 216));
                    break;

                case "industrial":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 221, 216, 210));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 221, 216, 210));
                    break;

                case "military":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 221, 220, 215));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 221, 220, 215));
                    break;

                case "wood":
                case "nature_reserve":
                case "farm":
                case "cemetery":
                case "water":
                case "riverbank":
                case "allotments":
                case "meadow":
                case "recreation_ground":
                case "quarry":
                case "orchard":
                case "vineyard":
                case "heath":
                case "scrub":
                    returnStyle = null;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            });
            landuseLayer.Theme = landuseTheme;
            map.Layers.Add(landuseLayer);

            #endregion

            #region road layer

            var roadsLayer = new VectorLayer("roads",
                                             new ShapeFile(Path.Combine(ShapeDir, "gis.osm_roads_free_1.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                SmoothingMode   = SmoothingMode.AntiAlias,
                ClippingEnabled = true,
                Style           = transparentStyle
            };
            roadsLayer.DataSource.Open();
            var roadsExtents = roadsLayer.DataSource.GetExtents();
            var themeRoads   = new CustomTheme(row =>
            {
                var returnStyle = new VectorStyle
                {
                    Line          = new Pen(new SolidBrush(Color.FromArgb(255, 240, 240, 160))),
                    EnableOutline = true,
                    Outline       = new Pen(new SolidBrush(Color.Black), 1)
                };

                switch ((string)row["fclass"])
                {
                case "rail":
                    returnStyle.Fill             = Brushes.White;
                    returnStyle.Line.DashPattern = new[] { 4f, 4f };
                    returnStyle.Line.Width       = 4;
                    returnStyle.EnableOutline    = true;
                    returnStyle.Outline.Brush    = Brushes.Black;
                    returnStyle.Outline.Width    = 6;
                    break;

                case "canal":
                    returnStyle.Fill          = Brushes.Aqua;
                    returnStyle.Outline.Brush = Brushes.DarkBlue;
                    returnStyle.Outline.Width = 5;
                    break;

                case "cycleway":
                case "footway":
                case "pedestrian":
                    returnStyle.Line.Brush     = Brushes.DarkGray;
                    returnStyle.Line.DashStyle =
                        DashStyle.Dot;
                    returnStyle.Line.Width = 1;
                    returnStyle.MaxVisible = roadsExtents.Width * 0.025d;
                    break;

                case "living_street":
                case "residential":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 2;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.DarkGray;
                    returnStyle.Outline.Width = 4;
                    returnStyle.MaxVisible    = roadsExtents.Width * 0.075d;
                    break;

                case "primary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 7;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.Outline.Width = 11;
                    break;

                case "secondary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 6;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.MaxVisible    = roadsExtents.Width * 0.15d;
                    returnStyle.Outline.Width = 10;
                    break;

                case "tertiary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 5;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.MaxVisible    = roadsExtents.Width * 0.3d;
                    returnStyle.Outline.Width = 9;
                    break;

                case "path":
                case "track":
                case "unclassified":
                    returnStyle.Line.Brush     = Brushes.DarkGray;
                    returnStyle.Line.DashStyle =
                        DashStyle.DashDotDot;
                    returnStyle.Line.Width = 1;
                    returnStyle.MaxVisible = roadsExtents.Width * 0.0125d;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            });
            roadsLayer.Theme = themeRoads;
            map.Layers.Add(roadsLayer);

            #endregion

            #region water layer

            var waterLayer = new VectorLayer("water",
                                             new ShapeFile(Path.Combine(ShapeDir, "gis.osm_water_a_free_1.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                Style           = transparentStyle.Clone(),
                SmoothingMode   = SmoothingMode.AntiAlias,
                ClippingEnabled = true
            };
            waterLayer.DataSource.Open();
            var waterExtents = waterLayer.DataSource.GetExtents();
            var waterTheme   = new CustomTheme(row =>
            {
                var returnStyle = new VectorStyle
                {
                    EnableOutline = true,
                    MaxVisible    = waterExtents.Width * 0.05
                };
                switch ((string)row["fclass"])
                {
                case "water":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 165, 190, 220));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 165, 190, 220));
                    break;

                case "river":
                    returnStyle.Fill          = new SolidBrush(Color.FromArgb(255, 165, 190, 220));
                    returnStyle.Outline.Brush = new SolidBrush(Color.FromArgb(255, 165, 190, 220));
                    returnStyle.Outline.Width = 2;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            });
            waterLayer.Theme = waterTheme;
            map.Layers.Add(waterLayer);

            #endregion

            #region waterways layer

            var waterwaysLayer = new VectorLayer("waterways",
                                                 new ShapeFile(Path.Combine(ShapeDir, "gis.osm_waterways_free_1.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                Style           = transparentStyle.Clone(),
                SmoothingMode   = SmoothingMode.AntiAlias,
                ClippingEnabled = true
            };
            waterwaysLayer.DataSource.Open();
            var waterwaysExtents = waterwaysLayer.DataSource.GetExtents();
            var waterwaysTheme   = new CustomTheme(row =>
            {
                var returnStyle = new VectorStyle
                {
                    EnableOutline = false,
                    MaxVisible    = waterwaysExtents.Width * 0.05
                };
                switch ((string)row["fclass"])
                {
                case "river":
                    returnStyle.Line.Brush = new SolidBrush(Color.FromArgb(255, 165, 190, 220));
                    returnStyle.Line.Width = 2;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            });
            waterwaysLayer.Theme = waterwaysTheme;
            map.Layers.Add(waterwaysLayer);

            #endregion

            #region points

            var pointsLayer = new VectorLayer("points",
                                              new ShapeFile(Path.Combine(ShapeDir, "gis.osm_pois_free_1.shp"), true, false, 4326)
            {
                Encoding = encoding
            })
            {
                Style = transparentStyle.Clone()
            };
            pointsLayer.DataSource.Open();
            var pointsExtents = pointsLayer.DataSource.GetExtents();
            var pointsTheme   = new CustomTheme(row =>
            {
                var returnStyle = new VectorStyle
                {
                    SymbolScale = 0.3f,
                    MaxVisible  = pointsExtents.Width * 0.0125d
                };
                switch ((string)row["fclass"])
                {
                case "bank":
                    returnStyle.Symbol = GetBitmap("bank");
                    break;

                case "hospital":
                    returnStyle.Symbol = GetBitmap("hospital-o");
                    break;

                case "bar":
                    returnStyle.Symbol = GetBitmap("beer");
                    break;

                case "embassy":
                    returnStyle.Symbol = GetBitmap("town");
                    break;

                case "parking":
                    returnStyle.Symbol = GetBitmap("parking");
                    break;

                case "pub":
                    returnStyle.Symbol = GetBitmap("restaurant");
                    break;

                case "cinema":
                    returnStyle.Symbol = GetBitmap("cinema");
                    break;

                case "zoo":
                    returnStyle.Symbol = GetBitmap("zoo");
                    break;

                case "theatre":
                    returnStyle.Symbol = GetBitmap("theatre");
                    break;

                case "monument":
                case "memorial":
                    returnStyle.Symbol = GetBitmap("monument");
                    break;

                case "restaurant":
                    returnStyle.Symbol = GetBitmap("restaurant");
                    break;

                case "sport":
                    returnStyle.Symbol = GetBitmap("pitch");
                    break;

                case "airport":
                    returnStyle.Symbol = GetBitmap("airport");
                    break;

                case "college":
                case "university":
                    returnStyle.Symbol = GetBitmap("college");
                    break;

                case "cafe":
                    returnStyle.Symbol = GetBitmap("cafe");
                    break;

                case "fire":
                    returnStyle.Symbol = GetBitmap("fire");
                    break;

                case "police":
                    returnStyle.Symbol = GetBitmap("police");
                    break;

                case "fuel":
                    returnStyle.Symbol = GetBitmap("fuel");
                    break;

                case "nightclub":
                    returnStyle.Symbol = GetBitmap("music");
                    break;

                case "museum":
                    returnStyle.Symbol = GetBitmap("museum");
                    break;

                case "hotel":
                case "hostel":
                case "guesthouse":
                    returnStyle.Symbol = GetBitmap("hotel");
                    break;

                case "fast_food":
                    returnStyle.Symbol = GetBitmap("food");
                    break;

                case "pharmacy":
                    returnStyle.Symbol = GetBitmap("pharmacy");
                    break;

                default:
                    returnStyle.Symbol = GetBitmap("map-marker");
                    break;
                }
                return(returnStyle);
            });
            pointsLayer.Theme = pointsTheme;
            map.Layers.Add(pointsLayer);

            #endregion

            return(map);
        }
Ejemplo n.º 25
0
        //protected void btnNext1_Click(object sender, EventArgs e)

        protected void Details()
        {
            Membership objMember = DesclaimerController.GetDisclaimerByRFIDNo(MemberId);
            Lead       objLead   = LeadController.GetLeadById(objMember.LeadId);
            DateTime   dob;
            int        age = 0;

            txtRFIDCardNumber.Text = objMember.RFIDCardNumber;
            dob                     = (DateTime)objLead.dateOfBirth;
            age                     = DateTime.Now.Year;
            age                     = age - dob.Year;
            txtAge.Text             = Convert.ToString(age);
            txtDate.Text            = Convert.ToString(objLead.insertDate).Substring(0, 10);
            txtName.Text            = objLead.firstName;
            txtRegNumber.Text       = Convert.ToString(objMember.AgreementNo);
            txtAddress.Text         = objLead.address;
            txtCity.Text            = objLead.city;
            txtEmail.Text           = objLead.Email;
            txtMobileNumber.Text    = objLead.mobileNumber;
            txtSex.Text             = objLead.gender;
            lblAgreeNum.Text        = objMember.AgreementNo;
            lblTitle.Text           = objMember.Title + " " + objLead.firstName + " " + objLead.lastName + " ";
            pnlLeadsDetails.Visible = true;
            updtpnl1.Visible        = true;
            MeasurementPanelVisibility(true, false);
            pnlOffice.Visible       = true;
            pnlLeadsDetails.Visible = true;
            updtpnl1.Visible        = true;
            Pnlnext1.Visible        = false;
            pnlSave.Visible         = true;
            Disclaimer objDis = DesclaimerController.GetDisclaimerByMemberId(MemberId);

            txtRFIDCardNumber.Text = objMember.RFIDCardNumber;
            txtDate.Text           = Convert.ToString(DateTime.Now).Substring(0, 10);
            if (objDis == null)
            {
                txtHeight.Text     = "";
                txtWeight.Text     = "";
                txtFrameSize.Text  = "";
                txtName1.Text      = "";
                txtRelation1.Text  = "";
                txtMobileno1.Text  = "";
                txtLandline1.Text  = "";
                txtArea1.Text      = "";
                txtName2.Text      = "";
                txtRelation2.Text  = "";
                txtMobileno2.Text  = "";
                txtLandline2.Text  = "";
                txtArea2.Text      = "";
                txtName3.Text      = "";
                txtRelation3.Text  = "";
                txtMobileno3.Text  = "";
                txtLandline3.Text  = "";
                txtArea3.Text      = "";
                txtFamDocName.Text = "";
                txtFamDocNo.Text   = "";
            }
            else
            {
                txtHeight.Text     = objDis.height;
                txtWeight.Text     = objDis.weight;
                txtFrameSize.Text  = objDis.frameSize;
                txtName1.Text      = objDis.emergencyRefName1;
                txtRelation1.Text  = objDis.emergencyRefRelationship1;
                txtMobileno1.Text  = objDis.emergencyRefMobNo1;
                txtLandline1.Text  = objDis.emergencyRefLandLineNo1;
                txtArea1.Text      = objDis.emeregencyArea1;
                txtName2.Text      = objDis.emergencyRefName2;
                txtRelation2.Text  = objDis.emergencyRefRelationship2;
                txtMobileno2.Text  = objDis.emergencyRefMobNo2;
                txtLandline2.Text  = objDis.emergencyRefLandLineNo2;
                txtArea2.Text      = objDis.emeregencyArea2;
                txtName3.Text      = objDis.emergencyRefName3;
                txtRelation3.Text  = objDis.emergencyRefRelationship3;
                txtMobileno3.Text  = objDis.emergencyRefMobNo3;
                txtLandline3.Text  = objDis.emergencyRefLandLineNo3;
                txtArea3.Text      = objDis.emeregencyArea3;
                txtFamDocName.Text = objDis.familyDoctorName;
                txtFamDocNo.Text   = objDis.familyDoctorMobileNumber;



                // new DesclaimerController().UpdateDisclaimer(objDis);

                //BindQuestions();
            }
        }
Ejemplo n.º 26
0
        public void ClaimDetails()
        {
            SetMethods.ImplicitlyWait(10);
            JTTitle.EnterText("ABCDEFGHIJKLMNOP");
            JobTitleDes.EnterText("Test Automation Engineer");
            Qualification.EnterText("ISTQB");
            DateAppointed.EnterText("03-06-2019");
            OutSide.Clicks();
            Salary.EnterText("123456");
            //SalaryLevelArrow.Clicks();
            SalaryLevelvalue.EnterText("5");
            OutSide.Clicks();

            /*//Look at the output for i-Frames count
             * SetMethods.HowmanyIFrames();
             *
             * PropertiesCollection.driver.SwitchTo().Frame(0);*/
            //SalaryLevelvalue.Clicks();

            /*//Switch back to your parent frame
             * PropertiesCollection.driver.SwitchTo().DefaultContent();
             * //PropertiesCollection.driver.SwitchTo().ParentFrame();*/

            UniqueCaseNo.EnterText("AB015OH03");
            CaseType.EnterText("Short Period");
            OutSide.Clicks();
            CaseOrigin.EnterText("New");
            OutSide.Clicks();
            LeaveCycle.EnterText("2019-2021");
            OutSide.Clicks();
            IncidentStartDate.EnterText("11-03-2020");
            OutSide.Clicks();
            IncidentEndDate.EnterText("15-03-2020");
            OutSide.Clicks();

            //Scrolling down the page
            SetMethods.ScrollById("DD22D8EF4EF14AA1ACC97772D3D130D7-bodyEl");

            EmployeeSignedDate.EnterText("16-03-2020");
            MedCertificateBrowse.Clicks();
            Thread.Sleep(1500);

            //AutoIT
            SetMethods.AutoITUpload("Open", "C:\\Users\\TailorJ\\Downloads\\Fake ID.pdf");
            Thread.Sleep(1000);
            MedCertificateUpload.Clicks();
            Thread.Sleep(1000);

            //Alert handeling - enter either Accept or Cancel
            SetMethods.Alert("Accept");

            Thread.Sleep(15000);
            /*SetMethods.WaitAlertState(60, true);*/

            //Alert handeling - enter either Accept or Cancel
            /*SetMethods.Alert("Accept");*/

            //Need to write a method for Action class in SetMethods
            Actions builder = new Actions(Configuration.PropertiesCollection.driver);

            builder.SendKeys(Keys.Enter);

            Disclaimer.Clicks();
            Status.EnterText("Save as Draft");
            Update.Clicks();
            Thread.Sleep(1000);
            SetMethods.SwitchtoAnotherWindow("Parent");
            //SetMethods.SwitchtoParentWindow();
            Thread.Sleep(1000);
            Search.Clicks();
            Start.Clicks();
            Thread.Sleep(2000);
            Search_Refresh.Clicks();
            SetMethods.ScrollById("frmHMSTILsubmissionListing-lblFormCode");
        }
Ejemplo n.º 27
0
 public void AcceptCookieDisclaimer() => Disclaimer.Confirm();
Ejemplo n.º 28
0
        private static Map InitializeMapOsm(float angle)
        {
            //Transparent style
            VectorStyle transparentStyle = new VectorStyle();

            transparentStyle.Fill          = Brushes.Transparent;
            transparentStyle.EnableOutline = true; //otherwise all the fancy theming stuff won't work!
            transparentStyle.Line.Brush    = Brushes.Transparent;
            transparentStyle.Outline.Brush = Brushes.Transparent;
            transparentStyle.Symbol        = null;

            VectorStyle transparentStyle2 = new VectorStyle();

            transparentStyle2.Fill          = Brushes.Transparent;
            transparentStyle2.EnableOutline = true; //otherwise all the fancy theming stuff won't work!
            transparentStyle2.Line.Brush    = Brushes.Transparent;
            transparentStyle2.Outline.Brush = Brushes.Transparent;
            transparentStyle2.Symbol        = null;

            //Initialize a new map
            Map map = new Map();

            map.BackColor = Color.Cornsilk;

            var encoding = System.Text.Encoding.UTF8;

            //Set up the countries layer
            VectorLayer layNatural = new VectorLayer("Natural");

            //Set the datasource to a shapefile in the App_data folder
            layNatural.DataSource = new ShapeFile(string.Format("{0}/natural.shp", PathOsm), true)
            {
                Encoding = encoding
            };
            //Set default style to draw nothing
            layNatural.Style = transparentStyle;
            //Set theme
            ThemeViaDelegate theme = new ThemeViaDelegate(layNatural.Style, "type");

            theme.GetStyleFunction = delegate(FeatureDataRow row)
            {
                string caseVal = (String)row["type"];
                caseVal = caseVal.ToLowerInvariant();
                VectorStyle returnStyle = new VectorStyle();

                switch (caseVal)
                {
                case "forest":
                    returnStyle.Fill          = Brushes.ForestGreen;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.DarkGreen;
                    break;

                case "water":
                    returnStyle.Fill          = Brushes.Aqua;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.DarkBlue;
                    break;

                case "riverbank":
                    returnStyle.Fill          = Brushes.Peru;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.OrangeRed;
                    break;

                case "park":
                    returnStyle.Fill          = Brushes.PaleGreen;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.DarkGreen;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            };
            layNatural.Theme = theme;
            layNatural.SRID  = 31466;

            VectorLayer layRoads = new VectorLayer("Roads");

            layRoads.DataSource = new ShapeFile(string.Format("{0}/roads.shp", PathOsm))
            {
                Encoding = encoding
            };
            layRoads.DataSource.Open();
            _roadsExtents = layRoads.DataSource.GetExtents();
            //layRoads.DataSource.Close();
            layRoads.Style = transparentStyle;
            ThemeViaDelegate themeRoads = new ThemeViaDelegate(transparentStyle, "type");

            themeRoads.GetStyleFunction = delegate(FeatureDataRow row)
            {
                VectorStyle returnStyle = new VectorStyle();

                switch ((String)row["type"])
                {
                case "rail":
                    returnStyle.Fill             = Brushes.White;
                    returnStyle.Line.DashPattern = new float[] { 4f, 4f };                                      //;System.Drawing.Drawing2D.DashStyle.Dash;
                    returnStyle.Line.Width       = 4;
                    returnStyle.EnableOutline    = true;
                    returnStyle.Outline.Brush    = Brushes.Black;
                    returnStyle.Outline.Width    = 6;
                    break;

                case "canal":
                    returnStyle.Fill          = Brushes.Aqua;
                    returnStyle.Outline.Brush = Brushes.DarkBlue;
                    returnStyle.Outline.Width = 5;
                    break;

                case "cycleway":
                case "footway":
                case "pedestrian":
                    returnStyle.Line.Brush     = Brushes.DarkGray;
                    returnStyle.Line.DashStyle =
                        DashStyle.Dot;
                    returnStyle.Line.Width = 1;
                    returnStyle.MaxVisible = _roadsExtents.Width * 0.05d;
                    break;

                case "living_street":
                case "residential":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 2;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.DarkGray;
                    returnStyle.Outline.Width = 4;
                    returnStyle.MaxVisible    = _roadsExtents.Width * 0.15d;
                    break;

                case "primary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 7;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.Outline.Width = 11;
                    break;

                case "secondary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 6;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.MaxVisible    = _roadsExtents.Width * 0.3d;
                    returnStyle.Outline.Width = 10;
                    break;

                case "tertiary":
                    returnStyle.Line.Brush    = Brushes.LightGoldenrodYellow;
                    returnStyle.Line.Width    = 5;
                    returnStyle.EnableOutline = true;
                    returnStyle.Outline.Brush = Brushes.Black;
                    returnStyle.MaxVisible    = _roadsExtents.Width * 0.6d;
                    returnStyle.Outline.Width = 9;
                    break;

                case "path":
                case "track":
                case "unclassified":
                    returnStyle.Line.Brush     = Brushes.DarkGray;
                    returnStyle.Line.DashStyle =
                        DashStyle.DashDotDot;
                    returnStyle.Line.Width = 1;
                    returnStyle.MaxVisible = _roadsExtents.Width * 0.025d;
                    break;

                default:
                    returnStyle = null;
                    break;
                }
                return(returnStyle);
            };
            layRoads.Theme = themeRoads;
            layRoads.SRID  = 31466;

            VectorLayer layRail = new VectorLayer("Railways");

            layRail.DataSource = new ShapeFile(string.Format("{0}/railways.shp", PathOsm))
            {
                Encoding = encoding
            };
            layRail.Style.Line.Brush       = Brushes.White;
            layRail.Style.Line.DashPattern = new float[] { 4f, 4f };//;System.Drawing.Drawing2D.DashStyle.Dash;
            layRail.Style.Line.Width       = 4;
            layRail.Style.EnableOutline    = true;
            layRail.Style.Outline.Brush    = Brushes.Black;
            layRail.Style.Outline.Width    = 6;

            VectorLayer layWaterways = new VectorLayer("Waterways");

            layWaterways.Style      = transparentStyle;
            layWaterways.DataSource = new ShapeFile(string.Format("{0}/waterways.shp", PathOsm))
            {
                Encoding = encoding
            };
            layRoads.Style = transparentStyle;
            ThemeViaDelegate themeWater = new ThemeViaDelegate(transparentStyle, "type");

            themeWater.GetStyleFunction = delegate(FeatureDataRow row)
            {
                VectorStyle returnStyle = new VectorStyle();
                returnStyle.Line.Brush    = Brushes.Aqua;
                returnStyle.EnableOutline = true;
                Int32 lineWidth = 1;
                switch ((String)row["type"])
                {
                case "canal":
                case "derelict_canal":
                    lineWidth = 2;
                    break;

                case "drain":
                    returnStyle.EnableOutline = false;
                    break;

                case "stream":
                    lineWidth = 2;
                    break;

                default:
                    //returnStyle = null;
                    break;
                }
                returnStyle.Line.Width    = lineWidth;
                returnStyle.Outline.Brush = Brushes.DarkBlue;
                returnStyle.Outline.Width = lineWidth + 1;
                return(returnStyle);
            };
            layWaterways.Theme = themeWater;
            layWaterways.SRID  = 31466;

            VectorLayer layPoints = new VectorLayer("Points");

            layPoints.DataSource = new ShapeFile(string.Format("{0}/points.shp", PathOsm))
            {
                Encoding = encoding
            };
            layPoints.Style = transparentStyle2;
            ThemeViaDelegate themePoints = new ThemeViaDelegate(transparentStyle2, "type");

            themePoints.GetStyleFunction = delegate(FeatureDataRow row)
            {
                VectorStyle returnStyle = new VectorStyle();
                switch ((String)row["type"])
                {
                case "bank":
                    returnStyle.Symbol = new Bitmap("Images/Bank.gif");
                    break;

                case "hospital":
                    returnStyle.Symbol = new Bitmap("Images/Medical-Facility.gif");
                    break;

                case "hotel":
                    returnStyle.Symbol = new Bitmap("Images/Hotel.gif");
                    break;

                case "restaurant":
                case "fast-food":
                    returnStyle.Symbol = new Bitmap("Images/Restaurant.gif");
                    break;

                case "parking":
                    returnStyle.Symbol = new Bitmap("Images/Car.gif");
                    break;

                default:
                    Bitmap tmp = new Bitmap(1, 1);
                    tmp.SetPixel(0, 0, Color.Transparent);
                    returnStyle.Symbol = tmp;
                    break;
                }
                return(returnStyle);
            };
            layPoints.Theme   = themePoints;
            layWaterways.SRID = 31466;

            var layLabel = new LabelLayer("Road Labels");

            layLabel.DataSource  = layRoads.DataSource;
            layLabel.LabelColumn = "Name";

            //Add layers to Map
            map.Layers.Add(layNatural);
            map.Layers.Add(layWaterways);
            map.Layers.Add(layRail);
            map.Layers.Add(layRoads);
            map.Layers.Add(layPoints);
            map.Layers.Add(layLabel);

            ShapeProvider sp = new ShapeProvider(string.Format("{0}/obepath.shp", PathOsm))
            {
                Encoding = encoding
            };
            VectorLayer vl = new VectorLayer("obepath", sp);

            vl.SRID = 31466;
            var bmp = new Bitmap("Images/Car.gif");

            bmp.MakeTransparent(bmp.GetPixel(0, 0));
            vl.Style.Symbol = bmp;

            VariableLayerCollection.Interval = 500;
            map.VariableLayers.Add(vl);

            //Restrict zoom
            map.MaximumZoom = layRoads.Envelope.Width * 0.75d;
            map.Zoom        = layRoads.Envelope.Width * 0.2d;;
            map.Center      = layRoads.Envelope.Centre;

            var disclaimer = new Disclaimer
            {
                Font   = new Font(FontFamily.GenericSansSerif, 7f, FontStyle.Italic),
                Text   = "Geodata from OpenStreetMap (CC-by-SA)\nTransformed to Shapefile by geofabrik.de",
                Anchor = MapDecorationAnchor.CenterBottom
            };

            map.Decorations.Add(disclaimer);
            transparentStyle2.MaxVisible = map.MaximumZoom * 0.3;

            Matrix mat = new Matrix();

            mat.RotateAt(angle, map.WorldToImage(map.Center));
            map.MapTransform = mat;

            return(map);
        }