User control (optional)


namespace Extreme.CustomPermissions.Web.UserControls
{
    public partial class CustomPermissionsControl : UserControlBase<CustomPermissionPresentationModel>
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
 
        protected void bSave_Click(object sender, EventArgs e)
        {
            BindToPresentationModel();
            
            string error;
            if (!base.PresentationModel.Validate(out error))
            {
                lError.Text = error;
                return;
            }
 
            try
            {
                base.PresentationModel.CreateAndSaveNewEntity();
                (...)
            }
            catch (Exception ex)
            {
                lError.Text = "Technical exception: " + ex.ToString();
            }
        }
 
        private void BindToPresentationModel()
        {
            base.PresentationModel.CurrentEmployeeName = tbFirstName.Text;
            (...) 
        }
        (...)    
    }
}

Last edited Apr 28, 2011 at 11:59 AM by Extreme, version 5

Comments

No comments yet.