Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version

The 3 Musketeers: - Model, View and Controller using ASP.NET MVC – Part 2

, 8 Sep 2009 CPOL
The 3 Musketeers: - Model, View and Controller using ASP.NET MVC – Part 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
namespace MvcApplication.Models
{
    public class clsCustomer
    {
        private string _strCustomerName;
        private string _strAddress;
        private double _dblSales;
        public string CustomerName
        {
            set
            {
                _strCustomerName = value;
            }
            get
            {
                return _strCustomerName;
            }
        }
        public string Address
        {
            set
            {
                _strAddress = value;
            }
            get
            {
                return _strAddress;
            }
        }
        public double Sales
        {
            set
            {
                _dblSales = value;
            }
            get
            {
                return _dblSales;
            }
        }
    }
    public class clsCustomers : CollectionBase
    {
        public clsCustomers()
        {
        }
        public void LoadCustomers()
        {
            Add("Shiv", "Mulund", 20);
            Add("Raju", "Mumbai", 20);
            Add("Manish", "Delhi", 20);
            Add("Lalu", "Nepal", 20);
            Add("Khadak", "Ratoli", 20);
            Add("Shaam", "Ghatkopar", 20);
        }
        void Add(string strCustomerName, string strAddress, double dblSales)
        {
            clsCustomer objCustomer = new clsCustomer();
            objCustomer.Address = strAddress;
            objCustomer.CustomerName = strCustomerName;
            objCustomer.Sales = dblSales;
            List.Add(objCustomer);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 9 Sep 2009
Article Copyright 2008 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid