Inventory Management System RRS feed

  • Question

  • Now I'm developing Inventory Management System Using c# and SQL server for education purpose. I have a problem with updating inventory items when creating the Good Receiving Note. It means I want to add new quantity to existing quantity. 

    There are three tables; Inventory, GRN and Receiving Item. I wrote a code. but it is not working properly. if I execute this, only update GRN and Receiving Item.  Can you help me to solve this?


    Saturday, June 30, 2018 11:06 AM

All replies

  • Where is your code?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. profile for Sajeetharan at Stack Overflow, Q&A for professional and enthusiast programmers

    Saturday, June 30, 2018 12:49 PM
  • Besides showing code as suggested by Sajeetharan and if using TableAdapters where you have not written code see the following (which will also apply for other methods of interacting with databases).

    When one table is not inserted properly or updated a auto-incrementing primary key is not set when dealing with the majority of data access methods so make sure there is one set. This may or may not be the issue.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, June 30, 2018 1:34 PM
  • TableAdapters for education purposes? If I would like to write loading and saving data for education purpose I would choose Entity Framework to show differences between repository and DAO pattern and MVC(Web application)/MVVM (WPF, Razor pages) to presentation layer. This combination require small pieces of code only.

    I don't have experiences with TableAdapters because if I write application which connect to some environment (data, IO, other (web)services) I write layer for it. I don't expose data entities from this layer into next layer. 

    As example I write application to get/save data from/into database. There are some models in presentation layer. I create simple repository in datalayer project. Business layer is not here so I can create extension methods for each repository which can load data from database and map it into model object directly. So presenter or controller or view model doesn't know about data entity. They work with models only. When I would to save, model goes into repository extension method and there it is mapped into data entity. 

    I adapt this architecture as I want. Repository implementation in data layer could work with business object or DTO and extension methods are implemented as close as to presentation layer (service layer). So business layer doesn't know about extension methods. 

    So EF there could be very nice to implement repository/DAO pattern. Is there chance to implement repository/DAO pattern with TableAdapters?

    Saturday, June 30, 2018 5:52 PM
  • Hi Petr,

    >>Is there chance to implement repository/DAO pattern with TableAdapters?<<

    Maybe not with TableAdapters, but if you have a backend DataAccess class that makes use of DataAdapters instead of TableAdapters, then yes, you could easily implement a repository/DAO pattern. The DataAdapters would work with standalone DataSets/DataTables. You could use the DataSets as your DTOs (Data Transfer Object) ... or make use of POCO classes (Plain Old CLR Object) as well.

    Is that the best way to do this? It depends on what your application does ... quite often DataSets fit the bill nicely, but you could convert them to a POCO class if necessary for your application. Most people nowadays are loving EF ... sorry to say that I'm not one of them.

    ~~Bonnie DeWitt [C# MVP]

    Saturday, June 30, 2018 8:14 PM