//-------------------------------------------- // Author : Santosh Poojari // Created Date : 22/02/2008 // Email ID : santosh.poojari@gmail.com //-------------------------------------------- #region References using System; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using Project.Practice.MVP.Domain; using Project.Practice.MVP.Presenter; using Project.Practice.MVP.Framework; using Project.Practice.MVP.ExceptionHandling; using Project.Practice.MVP.ExceptionHandling.CustomException; #endregion public partial class Calculation : CustomPage,ICalculationView { #region Private Members private CalculationPresenter m_Presenter = null; #endregion protected void Page_Load(object sender, EventArgs e) { try { m_Presenter = new CalculationPresenter((ICalculationView)this); if (ViewState["USER_KEY_VALUE"] == null) { throw new ViewLayerException("Code Behind Exception"); } } catch (Exception ex) { if (ExceptionHandleProvider.HandleException(ex, "Global Policy") == true) { throw ex; } } } #region ICalculationView Members public int Numbers1 { get { return Convert.ToInt32(txtNumber1.Text); } } public int Numbers2 { get { return Convert.ToInt32(txtNumber2.Text); } } public string Result { set { lblResult.Text = value; } } #endregion protected void Button1_Click(object sender, EventArgs e) { try { m_Presenter.AddNumbers(); } catch (Exception ex) { if (ExceptionHandleProvider.HandleException(ex, "Global Policy") == true) { throw ex; } } } public override string Error { set {pnlError.Visible = true; lblException.Text = value; ; } } }
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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)