예제 #1
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                TemplatesManager templatesManager = new TemplatesManager();
                string content = templatesManager.GetTemplate("ContactEmail.htm");
                content = content.Replace("{Name}", txtName.Text);
                content = content.Replace("{Email}", txtEmail.Text);
                content = content.Replace("{Telephone}", txtTelephone.Text);
                content = content.Replace("{Comment}", txtComment.Text);

                EmailManager.Instance.SendEmail(txtEmail.Text, new string[] { AppSettingsManager.Instance.ContactEmail }, "Contacto", content);

                lblMessage.Visible = true;
                ClearFields();
            }
        }
예제 #2
0
        public static IList<TrajectoryDTO> GetDeviceCoordinates(int deviceId)
        {
            TemplatesManager templatesManager = new TemplatesManager();
            string content = templatesManager.GetTemplate("MarkInfo.htm");

            ITrackingManager manager = IOCContainerFactory.Instance.CurrentContainer.Resolve<ITrackingManager>();

            // _basePage.UserContext.UserId
            IList<TrajectoryDTO> trajectories = manager.GetLastTrackByDeviceIdAndUserId(deviceId, 6);

            foreach (TrajectoryDTO trajectory in trajectories)
            {
                //trajectory.Routes = new List<RouteDTO>();
                TrackDTO track = trajectory.LastTrack;
                content = content.Replace("{Imagen}", track.ImagenUrl);
                track.Info = content.Replace("{DeviceName}", track.DeviceName);
            }

            return trajectories;
        }