Posted by Michael Horvath under Technology  SQL Server  .Net MVC  Embedded Systems  Test Automation  on Jul 30 2022

We have much experience in software development with a range of application project experience that can translate into productive freelance development. Early in our experiences we worked on embedded systems development where we programmed in a variety of microprocessor assembly languages, Ada, C, C++. We have experience with avionic software, medical device and manufacturing process controls. Embedded systems work was among some of our favorites; however, we also have worked in IT development where we have experience with relational database management systems such as Ingres, Oracle, RBase, and SQL Server. We have developed solutions for Unix and Windows platforms and have experience in working with Flexera's Install Shield software for creating install packages for Windows Desktop Applications. We have developed a variety of desktop applications including winform and Windows Presentation Foundation (WPF) as well as some hybrids of winform with WPF controls.

Our primary interest now is in helping other small businesses in whatever ways they may need. We are open for any ideas that you may have but don't have the in house skills to develop for your business.

Aside from software development work experience we have worked in retail and food service industries in our younger days. This gave us experience in point of sale as well as inventory control and food preparation. These skills may also aid us in developing a solution that will perfectly address an issue you may have in your day to day business.

Thanks for your time and attention to reading our posts on this blog site and may you be blessed today and always!

Tagged --no tags--
Posted by Michael Horvath under Technology  .Net MVC  on Apr 10 2020

Our main site includes a Buy page that allows our customers to purchase activation keys for the Windows Desktop applications they've downloaded from our site. This Buy page was originally fragmented in design that is there were more than one forms on the view page. These were causing a headache with keeping the data on the different forms persisting when interacting on the other forms. A friend of mine gave me advice that I should make these separate forms into one form and use different actions in my controller for the page to handle the various control inputs like button clicks, etc. It turned out to be great advice. This page now works great with none of the strange quirks that I had spent quite a bit of time trying to eliminate.

I have included the source code from my view page here to show how the view is implemented. The controller code is much like any controller code for a view and is not included in this post, but should anyone have any questions about that feel free to contact me. Here is a snippet from one of the controller actions though that show how this action is decorated to make the view work with the controller action.

...
        [HttpPost]
        [ValidateAntiForgeryToken]
        [MultipleButton(Name = "action", Argument = "BuySearch")]
        public ActionResult BuySearch([Bind(Include = "ID,Price")] tblPRESSInventory tblPRESSInventory, string sortOrder, string currentFilter, string searchString, string clearSearch, int? page, string currentEmail, string customerID, int productID = 1)
        {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.ProductID = productID;
            ViewBag.CurrentProductID = productID.ToString();
            ViewBag.CustomerID = customerID;

            bool alreadyPaid = false;

            var tempProduct = db2.tblPRESSInventories.Find(productID);
 ...
            return View(items.ToPagedList(pageNumber, pageSize));
        }
 ...

Also needed to make the MultipleButton decoration work is this class definition.

...
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class MultipleButtonAttribute : ActionNameSelectorAttribute
    {
        public string Name { get; set; }
        public string Argument { get; set; }

        public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
        {
            var isValidName = false;
            var keyValue = string.Format("{0}:{1}", Name, Argument);
            var value = controllerContext.Controller.ValueProvider.GetValue(keyValue);

            if (value != null)
            {
                controllerContext.Controller.ControllerContext.RouteData.Values[Name] = Argument;
                isValidName = true;
            }

            return isValidName;
        }
    }
...
    

Here's the view code, note that this is used as a partial view in a couple of other views so that code does not have to duplicate the page. Those views correspond to the actions like the example above the BuySearch action. Anyway here's the complete view code. Note that the file extension was changed to add a .txt to end of filename so that you can download this file. Not sure how to grant permission for you to download the file with its correct file extension.

Buy.cshtml

The last touch on the view page is the paged list pager controls displayed below the table of inventory items. This makes use of the PagedListRenderOptions to make the links in the pager control trigger post to the controller. That turned out to be fairly straightforward to implement once I knew where to look for help.

...
            @Html.PagedListPager(Model, page => Url.Action("Buy",
    new { page }), new PagedListRenderOptions { FunctionToTransformEachPageLink = (liTag, aTag) => { aTag.Attributes.Remove("href"); aTag.Attributes.Add("href", "javascript:void(0);"); aTag.Attributes.Add("onclick","updatePage('" + aTag.InnerHtml + "'," + Model.PageCount + ");"); liTag.InnerHtml = aTag.ToString(); return liTag; } })
...

I hope this helps someone who is having similar problems in implementing a form with multiple buttons that need post event handlers.

Thanks for reading and have a blessed day!

Tagged MVC Views 
Posted by Michael Horvath under Technology  .Net MVC  on Feb 27 2020

We've been working on updates to the sBlog.Net engine.  Changes are being made to the v3.0 git hub version that was downloaded and built/ deployed to our server.  We have added a new setting to the database backend that controls the number of years included in the archives panel of the sidebar.  The archives panel was also updated to display the month/year combinations in three columns instead of one so that this panel takes up less vertical screen space. We also have added a web.config setting to allow for emails to be sent to admin under certain conditions such as exception logging and user requests for login accounts.  The email handler was updated to work with our admin's smtp mail server.  A few changes to the styles to make the Bootswatch Slate theme consistent for authors page and comments.  A few patches to handle paging a little bit better when a user is on a blog page other than page one and they click the link for blog authors and the blog pages paging logic was inverted to make the next page increment to next higher page number and previous page to decrement to the next lower page number.

We also added a site icon which was setup with our logo.  Once our changes that are not specific to Horvath Software Solutions instance of sBlog.Net have been proven to work correctly and are in keeping with the design of orginal developer of sBlog.Net, we may publish our changes to the git hub repository.

Thanks for reading our post!

Tagged Blog Engine  .Net MVC