Click here to Skip to main content
15,879,326 members
Articles / Database Development / SQL Server / SQL Server 2008

Architecture Guide: Windows Forms, Generics, Auto-Mapper, Entity Framework, Framework Design, and many more..

Rate me:
Please Sign up or sign in to vote.
4.93/5 (39 votes)
12 Dec 2013CPOL15 min read 140.8K   3.8K   175  
Architecting a Windows Forms based system on top of a framework. This will help you develop a form based application faster.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Demo.Framework;
using Demo.Core.Models;
using Demo.Common;

namespace Demo.Core.Controls.ChildControls
{
    public partial class MaterialData : BaseData<MaterialView>
    {
        public MaterialData()
        {
            InitializeComponent();
        }

        public override void SetBindingSource(ref BindingSource DemoBindingSource)
        {
            DemoBindingSource = this.meterialViewBindingSource;
        }

        protected override void _DemoBindingSource_DataSourceChanged(object sender, EventArgs e)
        {
            this.tagCombo1.SelectedValue = this.BindedView.SelectedTag.Id;
        }

        public override MaterialView MapIt(int Id)
        {
            MaterialView mtView = new MaterialView();
            mtView.Id = Id;
            mtView.Description = this.descriptionTextBox.Text;
            mtView.Name = this.nameTextBox.Text;
            if (this.tagCombo1.SelectedValue != null)
                mtView.SelectedTag = (TagView)this.tagCombo1.SelectedItem;
            return mtView;
        }
    }
}

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)


Written By
Architect Virtusa Pvt. Ltd.
Sri Lanka Sri Lanka
In-depth coverage of Microsoft .Net, Cloud and many other cutting-edge Technologies.

- The Mandelbrot set – someone has called it the thumb-print of God – is one of the most beautiful and remarkable discoveries in the entire history of mathematics. My profile picture is generated with that equation.

You may contact Nirosh for Consultations, Code Reviews and Architecture Guide Workshops via c_nir*o*sh@hotmail.com (Remove * to use)



View Nirosh L.W.C.'s profile on LinkedIn


Other Links

Comments and Discussions