Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameApplication"/> class.</summary>
        /// <remarks><para>
        /// This constructor performs the following actions:
        /// </para><list type="bullet"><item>
        /// Call <see cref="ApplicationUtility.CheckSingleInstance"/> to make sure that the current
        /// user is not already running another instance of the <see cref="GameApplication"/>.
        /// </item><item>
        /// Call <see cref="FilePaths.CheckUserFolders"/> to make sure that the current user has
        /// write permission in the directories that hold user-specific data.
        /// </item><item>
        /// Attach a handler to the <see cref="Application.DispatcherUnhandledException"/> event
        /// that calls <see cref="ApplicationUtility.OnUnhandledException"/>.
        /// </item><item>
        /// Create a global instance of the <see cref="ApplicationOptions"/> class and load the
        /// current user settings.</item></list></remarks>

        public GameApplication()
        {
            // make sure this is the only instance
            if (!ApplicationUtility.CheckSingleInstance())
            {
                Application.Current.Shutdown(-1);
                return;
            }

            // make sure we can create user files
            if (!FilePaths.CheckUserFolders())
            {
                Application.Current.Shutdown(-2);
                return;
            }

            // hook up custom exception handler
            Application.Current.DispatcherUnhandledException += OnUnhandledException;

            // read user settings from Hexkit Game options file
            ApplicationOptions options = ApplicationOptions.CreateInstance();

            // select user-defined display theme, if any
            if (options.View.Theme != DefaultTheme.System)
            {
                DefaultThemeSetter.Select(options.View.Theme);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            StringBuilder SB           = new StringBuilder();
            DataTable     ProductTable = (DataTable)ViewData["Products"];
            DataView      ProductView  = ProductTable.DefaultView;

            foreach (DataRowView aRowView in ProductView)
            {
                SB.Append("<li><div class=\"product-photo\"><a href=\"");
                string path = "/Product/Details/" + aRowView["ProductID"].ToString();
                SB.Append(ApplicationUtility.FormatURL(path));
                SB.Append("\"><img alt=\"");
                SB.Append(aRowView["ProductName"].ToString());
                SB.Append("\" src=\"");
                SB.Append(aRowView["ProductPhoto"].ToString());
                SB.Append("-thumb.jpg\"></img></a></div><div class=\"product-desc\"><h3 class=\"product-title\"><a href=\"");
                SB.Append(ApplicationUtility.FormatURL(path));
                SB.Append("\">");
                SB.Append(aRowView["ProductName"].ToString());
                SB.Append("</a></h3><p class=\"product-price\">");
                decimal discounted = Convert.ToDecimal(aRowView["UnitPrice"].ToString()) - Convert.ToDecimal(aRowView["Discount"].ToString());
                SB.Append(discounted);
                SB.Append("<del>");
                SB.Append(aRowView["UnitPrice"].ToString());
                SB.Append("</del></p></div></li>");
                litCategoryDesc.Text = aRowView["ProductCat"].ToString();
                litCategoryName.Text = aRowView["ProductCat"].ToString();
            }
            litProductThumb.Text = SB.ToString();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles the <see cref="CommandBinding.Executed"/> event for the <see
        /// cref="ApplicationCommands.Help"/> command.</summary>
        /// <param name="sender">
        /// The <see cref="Object"/> where the event handler is attached.</param>
        /// <param name="args">
        /// An <see cref="ExecutedRoutedEventArgs"/> object containing event data.</param>
        /// <remarks>
        /// <b>HelpExecuted</b> opens the application help file on the help page for the current tab
        /// page of the <see cref="ShowFactions"/> dialog.</remarks>

        private void HelpExecuted(object sender, ExecutedRoutedEventArgs args)
        {
            args.Handled = true;

            // default to dialog help page
            string helpPage = "DlgShowFactions.html";

            // show help for specific tab page
            if (GeneralTab.IsSelected)
            {
                helpPage = "DlgShowFactionsGeneral.html";
            }
            else if (AssetsTab.IsSelected)
            {
                helpPage = "DlgShowFactionsAssets.html";
            }
            else if (ClassesTab.IsSelected)
            {
                helpPage = "DlgShowFactionsClasses.html";
            }
            else if (VariablesTab.IsSelected)
            {
                helpPage = "DlgShowFactionsVars.html";
            }
            else if (ConditionsTab.IsSelected)
            {
                helpPage = "DlgShowFactionsConditions.html";
            }

            ApplicationUtility.ShowHelp(helpPage);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds one row for each ability of the specified <see cref="EntityClass"/>.</summary>
        /// <param name="entityClass">
        /// The <see cref="EntityClass"/> whose abilities to show.</param>
        /// <remarks>
        /// <b>CreateAbilityRows</b> calls <see cref="CreateAbilityRow"/> for each ability of the
        /// specified <paramref name="entityClass"/>, if any.</remarks>

        private void CreateAbilityRows(EntityClass entityClass)
        {
            // effects & upgrades have no abilities
            if (entityClass.Category == EntityCategory.Effect ||
                entityClass.Category == EntityCategory.Upgrade)
            {
                return;
            }

            // insert separator if required
            if (Items.Count > 0)
            {
                ApplicationUtility.AddSeparator(this);
            }

            switch (entityClass.Category)
            {
            case EntityCategory.Unit:
                UnitClass unitClass = (UnitClass)entityClass;
                CreateAbilityRow(Global.Strings.LabelCapture, unitClass.CanCapture);
                break;

            case EntityCategory.Terrain:
                TerrainClass terrainClass = (TerrainClass)entityClass;
                CreateAbilityRow(Global.Strings.LabelCapturePassive, terrainClass.CanCapture);
                CreateAbilityRow(Global.Strings.LabelDestroyPassive, terrainClass.CanDestroy);
                break;
            }
        }
Exemplo n.º 5
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            this.Title = string.Empty;
            this.IsDoingServiceOperation = true;
            this.Glyphs.Clear();

            var xml = ApplicationUtility.LoadResource(navigationContext.Uri.ToRelativeUriFromQuery());

            Task.Factory.StartNew<IEnumerable<XElement>>(() =>
            {
                XNamespace svg = "http://www.w3.org/2000/svg";

                //You cannot stop .NET from condensing entities so load as string:
                xml = xml.Replace("unicode=\"&#", "unicode=\"&amp;#");
                var svgFont = XDocument.Parse(xml);

                var fontElement = svgFont.Descendants(svg + "font").FirstOrDefault();
                if (fontElement == null) svgFont.Descendants("font").FirstOrDefault();
                if (fontElement != null) this.Title = fontElement.ToAttributeValueOrNull("id");
                else this.Title = "[font ID not found]";

                var glyphs = svgFont.Descendants(svg + "glyph");
                if (!glyphs.Any()) glyphs = svgFont.Descendants("glyph");

                return glyphs;

            }).ContinueWith(task =>
            {
                task.Result.ForEachInEnumerable(i => this.Glyphs.Add(new SvgGlyphViewModel(i)));
                this.IsDoingServiceOperation = false;
            },
            TaskScheduler.FromCurrentSynchronizationContext());
        }
Exemplo n.º 6
0
        /// <summary>
        ///     Prints the version of MA to the log file.
        /// </summary>
        public static void PrintVersion()
        {
            PrintMessage("[Version Info]");
            var assemblyData = ApplicationUtility.GetAssemblyData();

            PrintMessage("\t" + assemblyData);

            var myDomain         = AppDomain.CurrentDomain;
            var assembliesLoaded = myDomain.GetAssemblies();

            PrintMessage("\tLoaded Assemblies");
            foreach (var subAssembly in assembliesLoaded)
            {
                var subName = subAssembly.GetName();
                PrintMessage(string.Format("\t\t{0} - version {1}",
                                           subName,
                                           subName.Version));
            }

            PrintMessage("[System Information]");
            var systemData = ApplicationUtility.GetSystemData();

            PrintMessage("\t" + systemData);
            PrintMessage("[LogStart]");
        }
Exemplo n.º 7
0
        /// <summary>
        /// Handles the <see cref="Application.DispatcherUnhandledException"/> event for the <see
        /// cref="EditorApplication"/>.</summary>
        /// <param name="sender">
        /// The <see cref="Object"/> sending the event.</param>
        /// <param name="args">
        /// A <see cref="DispatcherUnhandledExceptionEventArgs"/> object containing event data.
        /// </param>
        /// <remarks>
        /// <b>OnUnhandledException</b> handles all uncaught exceptions for the <see
        /// cref="EditorApplication"/> by gathering all relevant application data and then calling
        /// <see cref="ApplicationUtility.OnUnhandledException"/> for further processing.</remarks>

        private void OnUnhandledException(object sender,
                                          DispatcherUnhandledExceptionEventArgs args)
        {
            // store information about the exception
            StringBuilder info = new StringBuilder();

            info.Append(args.Exception);
            info.Append(Environment.NewLine);
            info.Append(Environment.NewLine);

            MasterSection   scenario     = MasterSection.Instance;
            Action <String> saveScenario = null;

            if (scenario == null)
            {
                info.Append("Scenario instance is null. ");
                info.Append(Environment.NewLine);
            }
            else
            {
                // delegate to save scenario data
                saveScenario = scenario.SaveAll;

                // collect various Hexkit Editor information
                foreach (ScenarioSection section in SectionUtility.AllSections)
                {
                    info.AppendFormat("Scenario.Section.{0}: {1} ",
                                      section, scenario.SectionPaths.GetPath(section));
                    info.Append(Environment.NewLine);
                }
            }

            // invoke common exception handler
            ApplicationUtility.OnUnhandledException(info.ToString(), null, saveScenario, null);
        }
Exemplo n.º 8
0
        public async Task <IActionResult> CreateAmazonAccount(int id)
        {
            var username     = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service      = new InstituteRepositoryService(connString);
            var institute    = (await service.GetInstituteById(id)).Name;
            var bucketSevice = new AmazonS3Service();
            var bucketName   = GetName(institute);
            await bucketSevice.CreateBucketToS3(bucketName);

            var iamService   = new AmazonIAMService();
            var iamUserName  = GetName(institute);
            var accesKeyInfo = await iamService.CreateIAMUser("/", iamUserName);

            var amazonAccountModel = new InstituteAmazonAccount()
            {
                AccessKey   = accesKeyInfo.AccessKey,
                Actor       = username,
                BucketName  = bucketName,
                IamUsername = iamUserName,
                InstituteId = id,
                SecretKey   = accesKeyInfo.SecurityKey
            };
            await service.CreateInstituteAmazonAccount(amazonAccountModel);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Cloud account created successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
Exemplo n.º 9
0
    public static void GetInstallApplists()
    {
        Dictionary <string, object> dict = new Dictionary <string, object>();

        AndroidJavaClass  Player   = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject Activity = Player.GetStatic <AndroidJavaObject>("currentActivity");

        AndroidJavaObject PackageManager = Activity.Call <AndroidJavaObject>("getPackageManager");
        //int GET_SIGNATURES = PackageManager.GetStatic<int>("GET_SIGNATURES");
        //int ntemp = PackageManager.GetStatic<int>("GET_UNINSTALLED_PACKAGES");
        int GET_UNINSTALLED_PACKAGES   = 8192; // Constant Value: 8192 (0x00002000) GET_UNINSTALLED_PACKAGES
        AndroidJavaObject appInfoLists = PackageManager.Call <AndroidJavaObject>("getInstalledApplications", GET_UNINSTALLED_PACKAGES);

        int nSize = appInfoLists.Call <int>("size");

        dict["device_id"] = ApplicationUtility.GetDeviceId();
        int nIndex = 1;

        for (int i = 0; i < nSize; i++)
        {
            AndroidJavaObject appinfo = appInfoLists.Call <AndroidJavaObject>("get", i);
            string            key     = "appk" + nIndex;
            dict[key] = appinfo.Get <string>("className");
            if (dict[key] == null)
            {
                continue;
            }
            nIndex++;
            if (i % 15 == 0 && i > 0)
            {
                dict.Clear();
                dict["device_id"] = ApplicationUtility.GetDeviceId();
            }
        }
    }
        public void Should_Return_A_String_For_Application_Title()
        {
            // act
            var result = ApplicationUtility.GetApplicationTitle();

            // assert
            Assert.True(string.IsNullOrWhiteSpace(result) == false);
        }
Exemplo n.º 11
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            var xaml    = ApplicationUtility.LoadResource(navigationContext.Uri.ToRelativeUriFromQuery());
            var control = ApplicationUtility.LoadResource <UserControl>(xaml);

            this.CurrentVisual = control;
            this.Title         = control.Tag.ToString();
            this.XamlSource    = xaml;
        }
        private void OnEnable()
        {
            if (!ApplicationUtility.IsReady() || Application.isPlaying)
            {
                return;
            }

            EditorApplication.delayCall += CheckPowerInspectorIsOpen;
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            linkBackToMainPage.NavigateUrl
                = ApplicationUtility.FormatURL("/Students/StudentList");
            string ErrorMessage = ViewData["ERROR"].ToString();

            litErrorMessage.Text = ErrorMessage;
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            linkAddStudent.NavigateUrl =
                ApplicationUtility.FormatURL("/Students/AddStudent");

            DataTable StudentsTable = (DataTable)ViewData["Students"];
            DataView  StudentsView  = StudentsTable.DefaultView;

            StudentsView.Sort = "ID Desc";

            StringBuilder SB = new StringBuilder();

            SB.Append("<table style=\"width: 99%;\" ");
            SB.Append("rules=\"all\" border=\"1px\" ");
            SB.Append("cellspacing=\"0px\" cellpadding=\"4px\">");

            SB.Append("<tr style=\"background-color: Silver; color: white; ");
            SB.Append("font-weight: bold\">");
            foreach (DataColumn aColumn in StudentsTable.Columns)
            {
                SB.Append("<td>");
                SB.Append(aColumn.ColumnName);
                SB.Append("</td>");
            }
            SB.Append("<td>&nbsp;</td>");
            SB.Append("</tr>");

            foreach (DataRowView aRowView in StudentsView)
            {
                SB.Append("<tr>");
                foreach (DataColumn aColumn in StudentsTable.Columns)
                {
                    SB.Append("<td>");
                    SB.Append(aRowView[aColumn.ColumnName].ToString());
                    SB.Append("</td>");
                }

                string ID = aRowView["ID"].ToString();
                SB.Append("<td>");
                SB.Append("<a href=\"");
                SB.Append(ApplicationUtility.FormatURL("/Students/DeleteStudent"));
                SB.Append("?ID=");
                SB.Append(ID);
                SB.Append("\">Delete this student</a>");
                SB.Append("</td>");
                SB.Append("</tr>");
            }

            SB.Append("</table>");

            litStudentDetail.Text = SB.ToString();
        }
Exemplo n.º 15
0
    public static void CreatePlayerData()
    {
        _data          = new PlayerData();
        _data.DeviceId = ApplicationUtility.GetDeviceId();
        _data.FileNo   = SystemDataMgr.Data.LatestFileNo;
        _data.Nick     = "Haruhi";

        SystemDataMgr.Data.LatestFileNo++;
        SystemDataMgr.Data.ContiuneFileNo = _data.FileNo;
        SavePlayerData();
    }
Exemplo n.º 16
0
        static void Main(string[] args)
        {
            Console.WriteLine(ApplicationUtility.GetApplicationTitle());

            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseUrls("http://*:505")
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            StringBuilder SB = new StringBuilder();

            SB.Append("<input type=\"hidden\" id=\"hidAddstudentActionURL\" value=\"");
            SB.Append(ApplicationUtility.FormatURL("/Students/AddStudentAction"));
            SB.Append("\" />");
            linkCancelAddStudent.NavigateUrl
                = ApplicationUtility.FormatURL("/Students/StudentList");
            litAddStudentActionHidden.Text = SB.ToString();
        }
Exemplo n.º 18
0
        public static string GetLgaName(int id, string stateCode)
        {
            var lga = ApplicationUtility.GetLga(id, stateCode);

            if (lga != null)
            {
                return(lga.LgaName);
            }
            else
            {
                return("");
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyListView"/> class.</summary>

        public PropertyListView()
        {
            InitializeComponent();
            ApplicationUtility.ApplyDefaultStyle(this);

            // hide Category column by default
            ((GridView)View).Columns.Remove(PropertyCategoryColumn);

            // adjust column width of Property list view
            DependencyPropertyDescriptor.FromProperty(
                ListView.ActualWidthProperty, typeof(ListView))
            .AddValueChanged(this, OnPropertyWidthChanged);
        }
Exemplo n.º 20
0
        public PackedXamlIndexViewModel()
        {
            this._regionManager = ServiceLocator.Current.GetInstance <IRegionManager>();
            this._clientContentRegionNavigation = this.GetClientContentRegionNavigation(this._regionManager);

            this.Index = ApplicationUtility
                         .ListPackedResources(Assembly.GetExecutingAssembly(), 48)
                         .Select(i =>
            {
                i.ResourceIndicator = new Uri(string.Format("PackedXamlView?{0}",
                                                            Uri.EscapeUriString(i.ResourceIndicator.OriginalString)), UriKind.Relative);
                return(i);
            });
        }
Exemplo n.º 21
0
        // Method used to get the available external plugins
        private async Task GetPlugins()
        {
            // Query the plugin factory to get a list of all the assemblies that contain an 'IScrobbleSource' class
            List <Plugin> typedPlugins = await PluginFactory.GetPluginsOfType(ApplicationUtility.ApplicationPath(), typeof(IScrobbleSource)).ConfigureAwait(false);

            // Local list of all the plugins
            ScrobbleFactory.ScrobblePlugins = new List <IScrobbleSource>();

            // Track whether or not new plugins have been discovered and don't have associated enabled/disabled state in the
            // current user settings
            bool requiresSettingsToBeSaved = false;

            // Iterate each of the available plugins
            foreach (Plugin pluginItem in typedPlugins)
            {
                // Conver the plugin into the base type that we know about
                var pluginInstance = pluginItem.PluginInstance as IScrobbleSource;

                // Add this plugin to internal list
                ScrobbleFactory.ScrobblePlugins.Add(pluginInstance);

                // Check if we have any settings for this plugin
                if (Core.Settings.ScrobblerStatus.Count(item => item.Identifier == pluginInstance.SourceIdentifier) == 0)
                {
                    // No?  Add a default instance of the settings for this plugin, defaulting it to 'off'
                    Core.Settings.ScrobblerStatus.Add(new LastFM.Common.Classes.ScrobblerSourceStatus()
                    {
                        Identifier = pluginInstance.SourceIdentifier, IsEnabled = false
                    });

                    // Mark the fact that we need to update the users settings file
                    requiresSettingsToBeSaved = true;
                }
            }

            // Create an instance of the iTunes Scrobble plugin and add it to the list
            ScrobbleFactory.ScrobblePlugins.Add(new iTunesScrobblePlugin());

            // Create an instance of the Windows Media Player Scrobble plugin and add it to the list
            // and assign the host form for the Media Player interop control
            ScrobbleFactory.ScrobblePlugins.Add(new WindowsMediaScrobbleSource(_playerForm));

            // If we need to update the users settings file
            if (requiresSettingsToBeSaved)
            {
                // Automatically save the settings file
                Core.SaveSettings();
            }
        }
Exemplo n.º 22
0
        public static IQueryable <dynamic> GetStates()
        {
            var            states    = ApplicationUtility.GetStates();
            List <dynamic> formatted = new List <dynamic>();

            foreach (var f in states)
            {
                formatted.Add(new
                {
                    Code = f.StateCode,
                    Name = f.StateName
                });
            }
            return(formatted.AsQueryable());
        }
Exemplo n.º 23
0
        private void DisplayAnalysis(MultiAlignAnalysis analysis)
        {
            // Change the title
            var version = ApplicationUtility.GetEntryAssemblyData();

            Title = string.Format("{0} - {1}", version, analysis.MetaData.AnalysisName);

            var model = new AnalysisViewModel(analysis);

            CurrentAnalysis = model;
            StateModerator.CurrentViewState = ViewState.AnalysisView;
            var recent = new RecentAnalysis(analysis.MetaData.AnalysisPath,
                                            analysis.MetaData.AnalysisName);

            GettingStartedViewModel.CurrentWorkspace.AddAnalysis(recent);
        }
Exemplo n.º 24
0
        public async Task <IActionResult> EbookSearch(EBookSearch model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new PublisherRepositoryService(connString);
            var result   = await service.EbookSearch(model);

            var response = new GenericResponse <List <EBookDetail> >()
            {
                IsSuccess    = true,
                Message      = "Data fetched successfully.",
                ResponseCode = 200,
                Result       = result
            };

            return(Ok(response));
        }
Exemplo n.º 25
0
        public async Task <IActionResult> CreateInstituteAssociation(PublisherAssociationModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new PublisherRepositoryService(connString);
            await service.CreatePublisherInstituteAssociation(model.InstituteId, model.PublisherId, username);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Publisher Institute Association created successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
        public async Task <IActionResult> Deactive(DeactiveGroupSubscriptionModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new StudentClassificationRepository(connString);
            await service.DeactiveGroupSubscription(model, username);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Subscription deactivated successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
        public async Task <IActionResult> Put(int id, OptionalGroupUpdateModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new StudentClassificationRepository(connString);
            await service.UpdateGroup(id, model, username);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Optional group updated successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
Exemplo n.º 28
0
        public async Task <IActionResult> DeleteUser(int Id)
        {
            var service  = new UserRepositoryService(connString);
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            await service.DeleteUser(Id, username);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "User deleted successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
Exemplo n.º 29
0
        public async Task <IActionResult> Create(PeriodModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new PeriodRepository(connString);
            await service.CreatePeriod(model);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Period created successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }
Exemplo n.º 30
0
        public async Task <IActionResult> UpdateEbook(EbookUpdateModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new PublisherRepositoryService(connString);
            await service.UpdateEbook(model, username);

            var response = new GenericResponse <string>()
            {
                IsSuccess    = true,
                Message      = "Ebook updated successfully.",
                ResponseCode = 200,
                Result       = "Success"
            };

            return(Ok(response));
        }