public JsonResult about(string MyChecked)
 {
     About n = new About();
     AboutData nd = new AboutData();
     var array = MyChecked.Split(',');
     if (MyChecked != "" && MyChecked != null)
     {
         for (var i = 0; i < array.Length; i++)
         {
             //var Original = nd.Get().ToList().Where(a => a.num.ToString() == array[i]).SingleOrDefault();
             //var DelPath = System.IO.Path.Combine(Server.MapPath("~/upload//"), Original.pic1);
             //System.IO.File.Delete(DelPath);
             //if (Original.jsonimg != "no_img.jpg")
             //{
             //    var jsonstr = JsonConvert.DeserializeObject<List<jsonSer>>(Original.jsonimg);
             //    var DelJsonPath = Server.MapPath("~/upload/photograhy/");
             //    foreach (var j in jsonstr)
             //    {
             //        var DelJsonPathing = System.IO.Path.Combine(DelJsonPath, j.content);
             //        System.IO.File.Delete(DelJsonPathing);
             //    }
             //}
             n.num = Convert.ToInt32(array[i]);
             n.isdel = 1;
             n.udate = DateTime.Now;
             nd.Delete(n);
         }
     }
     return Json("");
 }
        public void UnExecute(DomainModelMsSqlServerContext context)
        {
            _aboutData         = _commandDto.Payload.ToObject <AboutData>();
            _aboutData.Deleted = true;
            var entity = context.AboutData.First(t => t.Id == _aboutData.Id);

            entity.Deleted = true;
            _logger.LogDebug("Unexecuted");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Set the about data
        /// </summary>
        /// <param name="aboutData">The about data</param>
        /// <param name="aboutButtonResource">The about button resource</param>
        /// <param name="sendLicensing">Send licensing information</param>
        /// <param name="vendorId">The vendor id for hardware</param>
        /// <param name="watermark">Watermark for annotation</param>
        public void SetAboutData(AboutData aboutData, Uri aboutButtonResource, bool sendLicensing, string vendorId, string watermark)
        {
            _aboutData           = aboutData;
            _aboutButtonResource = aboutButtonResource;
            _sendLicensing       = sendLicensing;
            _vendorId            = vendorId;

            this.Title = _aboutData.ProductName;
            coreInterface.SetBranding(_aboutData, _aboutButtonResource, watermark);
        }
        public AboutActivity()
        {
            InitializeComponent();

            AboutData ad = GetInstructions().Result;

            tos.Text = ad.appTOS;
            privacyPolicyText.Text   = ad.appPrivacyPolicy;
            appInstructionsText.Text = ad.appInstructions;

            website_link.Text = hyperlink;
        }
Ejemplo n.º 5
0
        protected override async Task OnInitializedAsync()
        {
            Data = CacheService.Get <AboutData>("AboutData");
            if (Data == null)
            {
                Data = await ViewDataService.GetAboutViewModel().ConfigureAwait(false);

                CacheService.Add("AboutData", Data, Data.MaxAge);
            }

            AboutData        = Data.PageData;
            InterestingLinks = Data.InterestingLinks;
            DotNetLinks      = Data.DotNetLinks;
        }
        public void Execute(DomainModelMsSqlServerContext context)
        {
            _aboutData = _commandDto.Payload.ToObject <AboutData>();
            if (_aboutData.Id > 0)
            {
                _aboutData.Deleted = false;
                context.AboutData.Update(_aboutData);
            }
            else
            {
                context.AboutData.Add(_aboutData);
            }

            _logger.LogDebug("Executed");
        }
        public void Execute(DomainModelMsSqlServerContext context)
        {
            _previousAboutData = new AboutData();

            var aboutData = _commandDto.Payload.ToObject <AboutData>();
            var entity    = context.AboutData.First(t => t.Id == aboutData.Id);

            _previousAboutData.Description = entity.Description;
            _previousAboutData.Deleted     = entity.Deleted;
            _previousAboutData.Id          = entity.Id;

            entity.Description = aboutData.Description;
            entity.Deleted     = aboutData.Deleted;
            _logger.LogDebug("Executed");
        }
Ejemplo n.º 8
0
        /**
         * @brief get all the informations of the widgets for the about.json
         *
         * @return a string
         */
        public string GetAboutData(string ipClient)
        {
            AboutData res = new AboutData();
            var       serializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };

            res.Client = new ClientData
            {
                Host = ipClient
            };
            res.Server = GetServer();

            return(JsonConvert.SerializeObject(res, Formatting.Indented, serializerSettings));
        }
Ejemplo n.º 9
0
 private void PrintAboutData(AboutData aboutData, string language, int tabNum)
 {
     foreach (var field in aboutData.Fields)
     {
         StringBuilder sb = new StringBuilder();
         for (int j = 0; j < tabNum; ++j)
         {
             sb.Append("\t");
         }
         sb.Append($"Key: {field}");
         var value = aboutData.GetField(field, language);
         sb.Append("\t");
         sb.Append(ArgValueToString(value));
         Log.WriteLine(sb.ToString());
     }
 }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AboutData data = new AboutData();

            AboutTitle.Text = data.TitleAbout;
            AboutApp.Text   = data.DataAboutApplication;

            AboutCalcTitle.Text = data.AboutCalcTitle;
            AboutCalcText.Text  = data.AboutCalc;

            AboutCalcAreaTitle.Text = data.AboutCalcTitle + " площади.";
            AboutCalcAreaText.Text  = data.DataAboutCalcArea;

            AboutCalcVolumeTitle.Text = data.AboutCalcTitle + " объема.";
            AboutCalcVolumeText.Text  = data.DataAboutCalcVolume;
        }
Ejemplo n.º 11
0
    public override void Init()
    {
        base.Init();
        UGUIEventListener.Get(aboutBtn.gameObject).onClick    = (g) => { SelectPanel(1); };
        UGUIEventListener.Get(serviceBtn.gameObject).onClick  = (g) => { SelectPanel(2); };
        UGUIEventListener.Get(policyBtn.gameObject).onClick   = (g) => { SelectPanel(3); };
        UGUIEventListener.Get(proclaimBtn.gameObject).onClick = (g) => { SelectPanel(4); };
        if (dataList.Count > 0)
        {
            return;
        }
        JsonData jd = JsonMapper.ToObject(BundleManager.Instance.GetJson(ConstantUtils.usConfig));

        for (int i = 0; i < jd.Count; i++)
        {
            AboutData data = JsonMapper.ToObject <AboutData>(JsonMapper.ToJson(jd[i]));
            dataList.Add(data);
        }
    }
Ejemplo n.º 12
0
        public ActionResult About()
        {
            var viewModel = new AboutData();

            //LINQ finds how many properties in each sity
            viewModel.propertyCityGroup =
                from property in db.Properties
                group property by property.City into propertyGroup
                select new PropertyCityGroup()
            {
                City          = propertyGroup.Key,
                PropertyCount = propertyGroup.Count()
            };

            // Raw SQL query to find the avg rent amount paid
            // by all Tenants over all time, grouped by City
            string query =
                "SELECT City, CAST(AVG(RateMonthly) AS NUMERIC(16,2)) AS AVGRentAmount " +
                "FROM Property, Lease " +
                "WHERE ID=PropertyID " +
                "GROUP BY City " +
                "ORDER BY CITY";

            viewModel.rentCityGroup = db.Database.SqlQuery <RentCityGroup>(query);

            // RAW SQL query does full outer join on property and tenant
            // result is a fat table with null values when property is not occupied
            // or tenant is not a current occupant
            query =
                "SELECT Name, Street, City, State, Zip, Email " +
                "FROM TENANT FULL JOIN PROPERTY " +
                "ON TENANT.PropertyID = PROPERTY.ID";

            viewModel.tenantPropertyGroup = db.Database.SqlQuery <TenantPropertyGroup>(query);

            return(View(viewModel));
        }
Ejemplo n.º 13
0
        public static void Main()
        {
            _runApp = true;

            Obany.Core.Logging.ExceptionLogged         += new Obany.Core.Logging.ExceptionLoggedEventHandler(Logging_ExceptionLogged);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            if (!Obany.Core.FrameworkVersionDetection.IsInstalled(Obany.Core.FrameworkVersion.Fx35))
            {
                string cult = Thread.CurrentThread.CurrentUICulture.ToString();
                MessageBox.Show(Obany.Core.CultureHelper.GetStringForLanguage(ShumbiDiscover.Properties.AppResources.ResourceManager, "DOTNET35", cult),
                                Obany.Core.CultureHelper.GetStringForLanguage(Obany.UI.Properties.Resources.ResourceManager, "INFORMATION", cult),
                                MessageBoxButton.OK, MessageBoxImage.Exclamation);
                _runApp = false;
            }
            else
            {
                if (!IsAlreadyRunning())
                {
                    _aboutData = new AboutData();
                    _aboutData.Contributors = "Martyn Janes\nJustin Staines";
                    _aboutData.Version      = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                    _aboutData.VersionTag   = "";
                    _aboutData.Copyright    = "© 2009,2010 Shumbi Ltd";
                    _aboutData.Patents      = "GB0914269.6, GB0914723.2";

#if BAMBOO
                    _aboutData.ProductName         = "Bamboo Explore";
                    _aboutData.PoweredBy           = "Shumbi Discover";
                    _aboutData.CompanyNamePlain    = "Wacom";
                    _aboutData.Copyright          += "\n© 2009,2010 Wacom Europe GmbH";
                    _aboutData.WebSite             = "www.wacom.eu/bamboo/explore";
                    _aboutData.ProductIconResource = new Uri("/BambooExplore;component/Resources/Product.png", UriKind.Relative);
                    _aboutData.CompanyIconResource = new Uri("/BambooExplore;component/Resources/Company.png", UriKind.Relative);

                    Uri           aboutButtonResource  = new Uri("/BambooExplore;component/Resources/AboutButton.png", UriKind.Relative);
                    Uri           themeUri             = new Uri("/BambooExplore;component/Themes/Theme.xaml", UriKind.Relative);
                    bool          sendLicensing        = true;
                    bool          testHardware         = true;
                    string        hardwareFailResource = "TABLETREQUIRED";
                    string        vendorId             = "056A";
                    List <string> checkProductsIds     = new List <string>();
                    checkProductsIds.Add("00D0"); // Bamboo Touch (Maple T)
                    checkProductsIds.Add("00D1"); // Bamboo Touch (Maple S PT)
                    checkProductsIds.Add("00D2"); // Bamboo Touch (Maple Fun S PT)
                    checkProductsIds.Add("00D3"); // Bamboo Touch (Maple Fun M PT)
                    checkProductsIds.Add("00D4"); // Bamboo Touch (Maple One S P)
                    checkProductsIds.Add("00D5"); // Bamboo Touch (Maple One M P)
                    checkProductsIds.Add("00D6"); // Bamboo Touch (Maple PT S)
                    checkProductsIds.Add("00D7"); // Bamboo Touch (Maple Fun PT S)
                    checkProductsIds.Add("00D8"); // Bamboo Touch (Maple PT M)
                    checkProductsIds.Add("00D9"); // Bamboo Touch (Maple T S)
                    checkProductsIds.Add("00DA"); // Bamboo Touch (Maple Fun PT S (Special Edition))
                    checkProductsIds.Add("00DB"); // Bamboo Touch (Maple Fun PT M (Special Edition))
                    bool   flicksAllowed = true;
                    string watermark     = "";
#else
                    _aboutData.ProductName         = "Shumbi Discover";
                    _aboutData.CompanyNamePlain    = "Shumbi";
                    _aboutData.ProductSubName      = "";
                    _aboutData.WebSite             = "shumbi.com/shumbidiscover";
                    _aboutData.ProductIconResource = new Uri("/ShumbiDiscover;component/Resources/Product.png", UriKind.Relative);
                    _aboutData.CompanyIconResource = new Uri("/ShumbiDiscover;component/Resources/Company.png", UriKind.Relative);

                    Uri           aboutButtonResource  = new Uri("/ShumbiDiscover;component/Resources/AboutButton.png", UriKind.Relative);
                    Uri           themeUri             = new Uri("/ShumbiDiscover;component/Themes/Theme.xaml", UriKind.Relative);
                    bool          sendLicensing        = true;
                    bool          testHardware         = false;
                    string        hardwareFailResource = "";
                    string        vendorId             = "";
                    List <string> checkProductsIds     = new List <string>();
                    bool          flicksAllowed        = false;
                    string        watermark            = _aboutData.ProductName;
#endif

                    if (testHardware)
                    {
                        if (!string.IsNullOrEmpty(vendorId))
                        {
                            List <string> detectedProductIds = ShumbiDiscover.MainWindow.GetVendorProductIds(vendorId);

                            bool found = false;

                            if (checkProductsIds.Count == 0)
                            {
                                found = detectedProductIds.Count > 0;
                            }
                            else
                            {
                                for (int i = 0; i < detectedProductIds.Count && !found; i++)
                                {
                                    if (checkProductsIds.Contains(detectedProductIds[i]))
                                    {
                                        found = true;
                                    }
                                }
                            }

                            if (!found)
                            {
                                string cult = Thread.CurrentThread.CurrentUICulture.ToString();

                                _runApp = false;

                                MessageBox.Show(Obany.Core.CultureHelper.GetStringForLanguage(ShumbiDiscover.Properties.AppResources.ResourceManager, hardwareFailResource, cult),
                                                _aboutData.ProductName + " " + Obany.Core.CultureHelper.GetStringForLanguage(Obany.UI.Properties.Resources.ResourceManager, "INFORMATION", cult),
                                                MessageBoxButton.OK, MessageBoxImage.Exclamation);
                            }
                        }
                    }

                    if (_runApp)
                    {
                        SplashScreen splashScreen = new SplashScreen("Resources\\SplashScreen.png");
                        splashScreen.Show(true);
                        splashScreen.Close(TimeSpan.FromMilliseconds(3000));

                        App app = new App();
                        app.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
                        app.InitializeComponent();

                        ShumbiDiscover.MainWindow mainWindow = new MainWindow();
                        mainWindow.SetAboutData(_aboutData, aboutButtonResource, sendLicensing, vendorId, watermark);
                        mainWindow.SetFlicksAllowed(flicksAllowed);

                        app.Run(mainWindow);
                    }
                }
            }
        }
 /// <summary>
 /// Set the application branding
 /// </summary>
 /// <param name="aboutData">The about information</param>
 /// <param name="aboutButtonResource">The resource to use for the about button</param>
 /// <param name="waterMark">Watermark for annotation</param>
 public void SetBranding(AboutData aboutData, Uri aboutButtonResource, string waterMark)
 {
     _aboutData = aboutData;
     if (aboutButtonResource != null)
     {
         Image image = new Image();
         image.Height = 48;
         image.Source = new BitmapImage(aboutButtonResource);
         buttonAboutImage.Content = image;
     }
     _waterMark = waterMark;
 }
Ejemplo n.º 15
0
        private async Task StartService()
        {
            serviceBus = new BusAttachment("About Service Example", true);
            serviceBus.Start();
            serviceBus.Connect();
            Log.WriteLine($"BusAttachment connect succeeded. BusName {serviceBus.UniqueName}");
            Session sessionOpts = new Session(TrafficType.Messages, false, Proximity.Any, Transport.Any);

            sessionPortListener = new SessionPortListener();
            sessionPortListener.AcceptSessionJoiner += SessionPortListener_AcceptSessionJoiner;
            sessionPortListener.SessionJoined       += SessionPortListener_SessionJoined;
            var sessionPort = ASSIGNED_SESSION_PORT;

            serviceBus.BindSessionPort(sessionPort, sessionOpts, sessionPortListener);

            var aboutData = new AboutData("en");

            byte[] appId = { 0x01, 0xB3, 0xBA, 0x14,
                             0x1E, 0x82, 0x11, 0xE4,
                             0x86, 0x51, 0xD1, 0x56,
                             0x1D, 0x5D, 0x46, 0xB0 };
            aboutData.AppId = appId;
            aboutData.SetDeviceName("My Device Name", "en");
            aboutData.DeviceId = "93c06771-c725-48c2-b1ff-6a2a59d445b8";
            aboutData.SetAppName("Application", "en");
            aboutData.SetManufacturer("Manufacturer2", "en");
            aboutData.ModelNumber = "123456";
            aboutData.SetDescription("A poetic description of this application", "en");
            aboutData.DateOfManufacture = "2014-03-24";
            aboutData.SoftwareVersion   = "0.1.2";
            aboutData.HardwareVersion   = "0.0.1";
            aboutData.SupportUrl        = "http://www.example.org";

            /*
             * The default language is automatically added to the `SupportedLanguages`
             * Users don't have to specify the AJSoftwareVersion its automatically added
             * to the AboutData/
             * Adding Spanish Localization values to the AboutData. All strings MUST be
             * UTF-8 encoded.
             */
            aboutData.SetDeviceName("Mi dispositivo Nombre", "es");
            aboutData.SetAppName("aplicación", "es");
            aboutData.SetManufacturer("fabricante", "es");
            aboutData.SetDescription("Una descripción poética de esta aplicación", "es");
            if (!aboutData.IsValid("en"))
            {
                Log.WriteLine("failed to setup about data.");
            }

            string xmlInterface = "<node>\n" +
                                  $"<interface name='{INTERFACE_NAME}'>\n" +
                                  "  <method name='Echo'>\n" +
                                  "    <arg name='out_arg' type='s' direction='in' />\n" +
                                  "    <arg name='return_arg' type='s' direction='out' />\n" +
                                  "  </method>\n" +
                                  "</interface>\n" +
                                  "</node>";

            Log.WriteLine(xmlInterface);
            serviceBus.CreateInterfacesFromXml(xmlInterface);
            busObject = create_my_alljoyn_busobject(serviceBus, "/example/path");
            serviceBus.RegisterBusObject(busObject);
            var aboutObj = new AboutObj(serviceBus, false);

            aboutObj.Announce(sessionPort, aboutData);
            Log.WriteLine("AboutObj Announce Succeeded.");
            Log.WriteLine("*********************************************************************************");
            Log.WriteLine("*********************************************************************************");

            while (!cancelSource.IsCancellationRequested)
            {
                await Task.Delay(10);
            }
        }
 internal About(AboutData data)
 {
     Data = data;
 }