Git Product home page Git Product logo

asp.net-mvc-example-invoicing-app's Introduction

 

 

 

 

 

This project is abandoned.

 

 

 

 

 

 

 

ASP.NET MVC3 Invoicing Application

  • This is a sample invoicing application used for ASP.NET MVC3 training purposes.
  • This is a good code base to learn ASP.NET MVC3, since it covers many areas and development techniques.
  • I am using it as a personal invoicing tool for my freelancing activity, you may use it as well for this or any other purpose (it is very easy to customize to fit your needs)
  • The solution has been created with Visual Studio 2010 Express, but you can open it with other versions of VS 2010.
  • Unit tests have been written with NUnit. Moq has been used for object mocking.

Online Demo

Check the online demo here

How to best use this code:

  • This application shows how to create an ASP.NET MVC application from scratch. and how to use some of the cool features of ASP.NET MVC3 like:
    • Code First
    • Entity Framework and LINQ
    • Razor view engine
    • Custom Membership Provider pointing to your own database users table.
    • Partial views and partial actions (with independent OutputCache for high concurrency page rendering)
    • Html Helpers
    • Data Annotation validation
    • AJAX partial rendering
    • Custom T4 templates for customized scaffolding
    • NUnit for unit testing and Moq for object mocking.
  • Every major development on this invoicing app has been tagged (0.1, 0.2, etc...)
  • You can download each tag (starting with 0.1), check progress and move to the next when you understood everything that has been done.
  • Follow the change log (tag history) and enjoy!

Installation

  • Download the code and open with Visual Studio 2010 Express or above.
  • NuGet packages are included. If you have any problem please follow this instructions
  • By default the project is using SQL Server Compact database. You can easily change it to use SQL Server Express or above by modifying web.config file (connectionStrings section).
  • By using Code First and EF 4.1 the database will be recreated when you first run the project.

Altering connectionStrings section

Based on convention, EF will look for a connection strign named as the DBContext (in this case "InvoiceDB"), and will use it, so feel free to set the data provider you want:

 <!-- 
     By default (convention over configuration, the connection string with the same name as your DBContext will be used 
     You can select then wherever you will use SQL CE, SQL Serer Express Edition, etc, here. 
 -->
 <add name="InvoiceDB" connectionString="Data Source=|DataDirectory|InvoiceDB.sdf" providerName="System.Data.SqlServerCe.4.0" />
 <!--
 <add name="InvoiceDB" connectionString="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
 <add name="InvoiceDB" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=mssql2005a.active-ns.com;Initial Catalog=xxxxxxxxxx.org;user id=xxxxxxxxxxxx;password=xxxxxxxxxxx;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
 -->

Screenshots

Home

Home

Invoice Details

Invoice Details

Invoice (printed output)

Printed Invoice

Invoice list

Invoice list

Customer list

Customer list

Edit Customer

Customer list

Project unit tests

Unit testing

TAGS (change log):

0.21 10/05/2012

  • Improve performance in EF queries
  • Bug fixing.
  • Added warning if invoice due date is less than 5 days ahead.
  • Some improvements and fixing related to sorting tables.

0.20 19/04/2012

  • Bug fixing
  • General styling

0.19

  • Bug fixing
  • Added CLEditor WYSIWYG to proposal details
  • Added AdvancePaymentTax to purchases
  • Sorting by name (default)
  • Change print languaje by parameter (Invoice/Print?lan=es-ES)
  • Update to jQuery 1.7.2

0.18

  • Config tablesorter to handle datetime
  • Improved reports
  • CSS Styles
  • Other general improvements and fixes

0.17

  • Bug fixing in proposals.
  • Config tablesorter to handle decimals.
  • Added ProposalDetails field.
  • Other minor improvements.

0.16

  • Added "proposals". Proposals are invoices that don't have an invoice number yet. They become an invoice once the client approves it.
  • CSS improvements: added primary style to "create" buttons. Added nowrap html attribute to edit buttons td.
  • Added http://harvesthq.github.com/chosen/ jquery plugin to some extra dropdown menus in editor screens.
  • Added some help messages in invoices and proposals.

0.15

  • Added missing DLLS in Elmah and Moq packages (will work in restoring packages from config file instead of commiting binaries)
  • Added Chosen js plugin for dropdowns (cool stuff!) http://harvesthq.github.com/chosen/

0.14

  • Added globalization support in printing invoice. Added spanish resource file.
  • Adding and edition customer now works with a modal popup windows using AJAX.
  • Added InvoiceNumber field to Invoice so it can be defined and edited by the user.
  • Added ContactPerson and Notes fields to Customer. Changes in customer edition modal popup.
  • Database initializer configurable from web.config
  • Added PurchaseType (aka expense type) entity and table, in order to categorize expenses.
  • Added Profit and Loss report.
  • Partial view for redering money (negative balance in red)
  • CSS style for print media for printing invoices and expenses.
  • Many usability and formatting improvements. Changes in menu for easier access to items.
  • Default pagination size now is stored in web.config.

0.13

  • Support for SQL Server Compact Edition (by default). You can choose to other database provider in web.config.
  • New field on invoice: "AdvancePaymentTax"
  • New Reports controller for summary and reports (used in home page so far). Yearly summary, quarter summary, etc.
  • Better dummy data generation when database is re-created.
  • Search field for Providers.
  • Date search in Invoices
  • Paging on expenses (purchases)
  • Extra EditorTemplates and DisplayTemplates views.
  • Aggregated data in invoice list for a customer.
  • Lots of style and usability improvements. Overall improvements to prepare the application for a 1.0 version.
  • Search by date. Auto select Q1, Q2, Q3, Q4 dates interval in order to search by date.
  • Pie chart using Google Chart calls.
  • More coverage in unit testing. Added Moq reference for object mocking.

0.12

  • Added pagination functionality using https://github.com/martijnboland/MvcPaging library to some entities (pending the other ones)
  • Added NUnit testing project as example of how to include it.
  • Make "new", "edit" and delete invoice details work in new modal window, using AJAX and the twitter bootstrap css library.
  • Layout changes
  • Basic print view for invoices, with a custom layout for printing.
  • Added error handling by including Elmah from NuGet repository (try it by accessing http://localhost:xxxx/elmah.axd)
  • Added a custom functionality to HandleErrorAttribute so it logs to Elmah.

0.11

  • Added search functionality in Customer list.
  • Style and css modifications.
  • New screenshots

0.10

  • Added DueDate field to invoice.
  • Some bug fixing.
  • Alphabetical and "by name" search in Customer.
  • Support for ajax in alphabetical search.

0.9

0.8

  • Improved the way the invoice and invoicedetail entity play together in the application for better UX
    • Making the invoice details views always display with their invoice parent object on the left.
  • Added partial views for encapsulation (ex: edit and add)
  • Added footer with aggregate data to invoice details lists.

0.7

  • Added DateTime editor template to be able to edit datetime fields across de application
  • Added jQuery UI calendar functionality to datetime editor fields.
  • Set PAID / UNPAID display as text with style instead of checkbox

0.6

  • Added security so only authenticated users can access the app. To do so:
    • Added custom Membership Provider class (InvoicingMemembershipProvider)
    • Implement ValidateUser method on (InvoicingMemembershipProvider)
    • Change web.config to add InvoicingMemembershipProvider as default provider
    • Added [Authorize] attribute to controllers
    • Added User entity, added Users table to DBConext and dummy data generation in initializer.
    • Fixing css style in Account views.

0.5

  • Added PartialActions to Invoice and Purchase controllers to return unpaid invoices and recently purchased items.
  • Added RenderAction methods to Home.Index, in order to display data from the recently created partial actions.
  • Removed unnecessary columns from list views.

0.4

  • Added System.ComponentModel.DataAnnotations reference to validate model.
  • Added validation attributes to POCO entities, in order to create basic client and server side validation
  • Added DisplayName attribute (System.ComponentModel) to fields in order to rename fields in CRUD operations.

0.3

  • Added T4 CodeTemplates so we can control the scaffolding generation process. Modifications on those templates so they render Boostrap css style.
  • All CRUD view regenerated using the new T4 CodeTemplates
  • Added CompanyNumber field to Customer and Provider tables.
  • Added tablesorter javascript plugin for index pages.

0.2

  • Added Twitter Boostrap CSS library to the project.
  • Changed customer create view to apply boostrap styling on it (styles of other CRUD pages haven't been changed at this time, btw, we will do that next by touching the scaffolding generation)

0.1

  • Starting app.
  • Creating model by using POCO entities.
  • Use code first for creating database
  • Scaffolding basic CRUD operations

The Author

Ivan Loire, ASP.NET MVC Freelance

I make clients happy for a living while developing software, so contact me if you need custom modifications on this app, or help in other ASP.NET MVC project. I'm currently located in Spain.

Contact: www.iloire.com

LICENSE

Copyright (c) 2011 Iván Loire Mallén - www.iloire.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

asp.net-mvc-example-invoicing-app's People

Contributors

iloire avatar orthographic-pedant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asp.net-mvc-example-invoicing-app's Issues

Can you migrate this application?

Can you migrate to MVC5 and Latest Framework and re-upload this application?
Or if you have any tutorial how to do it please send me.
Or if anyone have alredi migrated can send me ?
Thank you a lot

linea de más

Creo que la línea 127 del archivo Models / Paging / Pager.cs está de más.

helper para menu

Iván,

Estoy comenzando a usar tu proyecto Invoicing-App y me está ayudando mucho. Aprovecho para hacerte una sugerencia para Menu.cshtml: condicionar la clase “active” usando un helper. Para eso se puede sacar cuál es el controlador y acción actual y pasarlo como parámetro:

Definir al inicio de Menu.cshtml una variable con el controlador-acción actual:

@{
    string currentControllerAction =         
ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString() + "/" + 
 ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString();
}

Y en el menú, condicionar la clase usando el helper:

<li class="@iloire_Facturacion.Helpers.MenuHelper.GetCssClassForMenu( currentControllerAction, "Invoice/Index")">
@Html.ActionLink("Invoices", "Index", "Invoice", new { proposal = false }, null)
</li>

El helper sería algo sencillo:

    public static class MenuHelper
    {
        public const string ACTIVE_MENU_CSS_CLASS = "active";
        public const string INACTIVE_MENU_CSS_CLASS = "inactive";

        public static string GetCssClassForMenu(string currentControllerAction, string menuControllerAction)
        {
            if (currentControllerAction == menuControllerAction)
                return ACTIVE_MENU_CSS_CLASS;
            else
                return INACTIVE_MENU_CSS_CLASS;
        }
    }

Referencias:
http://blog.janjonas.net/2011-02-15/aspnet-mvc_3-get-controller-action-razor-view
http://www.arrangeactassert.com/asp-net-mvc-view-best-practices-keep-logic-out-of-your-views/

failed to compile in VS2015

When I open solution in VS, first I get all references loaded with an exclamation mark, then I deleted and re-imported but still I couldn't load it.

I'm getting the error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies

Any help please?

cant login during test

Hi

I am attempting build this application for personal use, however I am encountering alot of issues, I have mailed you before but I havent gotten a response. Well some of the notes are in Spanish, and unfortunately I cannot read Spanish, and whenever I build the app I dont get any errors on build, but when I test it i cannot login.

And one last request, how can I put this application into an installer package?

Unable to download the zip file

Hi, I tried to download the zip file several times but failed. It is getting interrupted at 25% to 30% of download.

Let me know how can I download complete code without interruption.

Thanks in advance
Kishore

Requesting for the database

Dear,

You have developed application is so good. But I can't find the MSSql DB file or script file in the zip package. if you feel free kindly share the MSSQL DB. Then i can easily learn the ASP.NET MVC Application creation.

My Mail id : [email protected]
Skype id : mostafahrms5

I

How to include the Database for this app?

Dear,

You have developed application is so good. But I can't find the MSSql DB file or script file in the zip package. if you feel free kindly share the MSSQL DB. Then i can easily learn the ASP.NET MVC Application creation.

My Mail id : [email protected]
Skype id : yuva2achieve

I

Upgrade to MVC 5

Is here anybody try this app in VS 2013 ?
I would like to know how to migrate and use First Code to create database in Sqlexpress and use this app in MVC5,
Thanks in Advance

how do you change the currency

I am terribly sorry for disturbing you so much, but how do you change the currency? I am a novice programmer, so all the help is truly appreciated

Problem with Pop-Up

I migrated application to mvc5 and latest framework, now i have problem with Pop-Up window, i can` sell full. How to solve it?
untitled

SecurityException

I ran the project and commented out the two DB connection strings (I used SQL Compact) and then received this error:

System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

Immediately thinking about "medium trust" I commented that out, which I am not sure whether that's good. Anyway, after doing that when I type in "user" and "pass" I get a validation error that I entered the "wrong username/password". I put back the medium trust line and still get the SecurityException above.

Sorry, but I am new to programming. So if it's something obvious just let me know.

Looking at the Invoice DB table, it looks like it wasn't even created.

Build errors

Hello iloire,

When I download your latest version and try to build in VS2010 (on a Win7 Client), I get the following error;

The type or namespace name 'Elmah' could not be found (are you missing a using directive or an assembly reference?)

The Elmah reference is showing an exclamation mark. I could download the dll and add a new reference, but I feel it should be able to build directly after download. Or is that feeling incorrect?

(I tried adding a new reference again to the elmah.dll already, but then same problem with NUnit, so I felt it's better to check with you first if I'm doing something wrong)

Failed to find or load the registered .NET Framework Data Provider

When run solution i can see LogOn page but when click "Login" (with login =user, password = pass) it keep throwing above exception at method OverDueInvoices in InvoiceController.

I also try change key "DropDatabaseOnChange" to 1 because I think this will make system generate dummy data (since there is no sample db in package yet)

am unable to login.

where is invoice db.sdf file. am unable to login. am using vs 2013.
am installed sql server express also. am getting this error.
i want local db file. should i need to create local db file with same name ?

am entering same credentials.

here were some errors. Please fix them and try again
Wrong username/password

iloire_Facturacion.dll file is not founded

i guess the project dll file is created when it run perfectly . but i m having error of not having iloire_Facturacion.dll file and from that i cant access to run the project. now how could i create a dll file.?? needed some help . if anyone knows the ways to create it .
yes, i also tried to make a new web application with all same code and folders and tried to used that project dll in this one but not succeed.

About Concurrency when create invoice

Hi Iloire,

My doubt about the creation of next invoice number is that how you do you manage the concurrency if two or more users at same time create a new invoice?

You think is secure a InvoiceNumber = Max + 1 ?

thank in advance for your suggestion.

Vincenzo

jQuery is not reusable.

I think that you need to create a core JavaScript file.

This is going to take some remodelling to allow re usability for buttons like.

$('a.newCustomer').live('click', function () {

to be used on any page.

For example when I click proposal. It is obvious its for new customer. So I quickly want to add him.

I do not want to go edit customer... then proposal

This file should be loaded in Shared

any specific jQuery that only applies to ONE page should be loaded on that view - like UI effects, graphs or something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.