Click here to Skip to main content
11,710,943 members (82,158 online)
Click here to Skip to main content
Add your own
alternative version

Differences between MVC and MVP for Beginners

, 23 Nov 2011 CPOL 134.3K 2.3K 117
This article aims to describe MVC and MVP in simple terms
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MVPTester
{
    public partial class MVCView : Form, IViewBase
    {
        public MVCView()
        {
            InitializeComponent();

            
        }



         public string UserName
        {
            get
            {
                return txtUsername.Text;
            }
            set
            {
                txtUsername.Text = value;
            }

        }

         public string Email
        {
            get
            {
                return txtEmail.Text;
            }

            set
            {
                txtEmail.Text = value;

            }

        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            new Controller(this).Save();
        }

        public void ChangedState(object sender, EventArgs e)
        {
            ConcreteModel concModel = (ConcreteModel)sender;

            int total  = concModel.GetTotalRecords();
            MessageBox.Show("The total count in the database is: " + total.ToString());

        }


    

    }
}

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

John T.Emmatty
Software Developer (Senior) WEPA
India India
My aim is to write articles in plain English without any convoluted or periphrastic statements.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150819.1 | Last Updated 23 Nov 2011
Article Copyright 2011 by John T.Emmatty
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid