Update of /cvsroot/nugsoft/nugsoft/nUGSoftWeb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5057/nUGSoftWeb
Modified Files:
Registration.aspx Registration.aspx.cs
Log Message:
Added hook to error page, documentation, renamed checkphoto method.
Index: Registration.aspx.cs
===================================================================
RCS file: /cvsroot/nugsoft/nugsoft/nUGSoftWeb/Registration.aspx.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Registration.aspx.cs 20 Nov 2005 05:15:20 -0000 1.2
--- Registration.aspx.cs 4 Dec 2005 04:04:42 -0000 1.3
***************
*** 21,24 ****
--- 21,28 ----
}
+
+ /// <summary>
+ /// Saves the membership form's data.
+ /// </summary>
private void SaveData()
{
***************
*** 41,45 ****
! if (false == IsValidPhoto(member))
{
//TODO: handle error
--- 45,49 ----
! if (false == ProcessPhoto(member))
{
//TODO: handle error
***************
*** 70,73 ****
--- 74,78 ----
//TODO: e-mail to member for verification
//TODO: redirect
+ throw new ArgumentException("Test error");
}
else
***************
*** 78,85 ****
}
! private bool IsValidPhoto(Person member)
{
if (FileUpload1.HasFile)
{
string filename = FileUpload1.FileName;
string ext = System.IO.Path.GetExtension(filename).ToLower();
--- 83,96 ----
}
! /// <summary>
! /// Processes the photo, checking for correct extension and adds it to member record.
! /// </summary>
! /// <param name="member">The member to attach a valid photo to.</param>
! /// <returns>True if processed, false if not.</returns>
! private bool ProcessPhoto(Person member)
{
if (FileUpload1.HasFile)
{
+ //TODO: Add check of array to see if it's really a supported format?
string filename = FileUpload1.FileName;
string ext = System.IO.Path.GetExtension(filename).ToLower();
Index: Registration.aspx
===================================================================
RCS file: /cvsroot/nugsoft/nugsoft/nUGSoftWeb/Registration.aspx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Registration.aspx 20 Nov 2005 05:15:20 -0000 1.2
--- Registration.aspx 4 Dec 2005 04:04:42 -0000 1.3
***************
*** 1,3 ****
! <%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="Registration" Title="Untitled Page" %>
<%@ Register Assembly="nUGSoft.Controls" Namespace="nUGSoft.Controls" TagPrefix="cc1" %>
--- 1,5 ----
! <%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true"
! CodeFile="Registration.aspx.cs" Inherits="Registration" Title="New Memeber Registration"
! ErrorPage="Errors.aspx" %>
<%@ Register Assembly="nUGSoft.Controls" Namespace="nUGSoft.Controls" TagPrefix="cc1" %>
|