CodeMaid clean-up
This commit is contained in:
@@ -62,7 +62,8 @@ namespace VAR.Focus.Web.Pages
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool Controls_AreValid(ControlCollection controls) {
|
||||
public static bool Controls_AreValid(ControlCollection controls)
|
||||
{
|
||||
bool valid = true;
|
||||
foreach (Control control in controls)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace VAR.Focus.Web.Pages
|
||||
|
||||
private int _idBoard = 0;
|
||||
|
||||
private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra="width100pc", AllowEmpty = false };
|
||||
private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra = "width100pc", AllowEmpty = false };
|
||||
private CTextBox _txtDescription = new CTextBox { ID = "txtDescription", CssClassExtra = "width100pc", TextMode = TextBoxMode.MultiLine };
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Life cycle
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace VAR.Focus.Web.Pages
|
||||
Init += FrmBoard_Init;
|
||||
}
|
||||
|
||||
void FrmBoard_Init(object sender, EventArgs e)
|
||||
private void FrmBoard_Init(object sender, EventArgs e)
|
||||
{
|
||||
string strIDBoard = Context.GetRequestParm("idBoard");
|
||||
if (String.IsNullOrEmpty(strIDBoard) == false)
|
||||
@@ -43,19 +43,19 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Life cycle
|
||||
|
||||
#region UI Events
|
||||
|
||||
void btnAddBoard_Click(object sender, EventArgs e)
|
||||
private void btnAddBoard_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
||||
|
||||
Board board = Boards.Current.Boards_SetBoard(0, _txtTitle.Text, _txtDescription.Text, CurrentUser.Name);
|
||||
_idBoard = board.IDBoard;
|
||||
|
||||
Response.Redirect(string.Format("{0}?idBoard={1}",
|
||||
typeof(FrmBoard).Name,
|
||||
Response.Redirect(string.Format("{0}?idBoard={1}",
|
||||
typeof(FrmBoard).Name,
|
||||
_idBoard));
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ namespace VAR.Focus.Web.Pages
|
||||
{
|
||||
CButton btnEdit = (CButton)sender;
|
||||
int idBoard = Convert.ToInt32(btnEdit.CommandArgument);
|
||||
Response.Redirect(string.Format("{0}?idBoard={1}&returnUrl={2}",
|
||||
typeof(FrmBoardEdit).Name,
|
||||
Response.Redirect(string.Format("{0}?idBoard={1}&returnUrl={2}",
|
||||
typeof(FrmBoardEdit).Name,
|
||||
idBoard,
|
||||
typeof(FrmBoard).Name));
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion UI Events
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -169,7 +169,6 @@ namespace VAR.Focus.Web.Pages
|
||||
_txtDescription.PlaceHolder = "Description";
|
||||
pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", btnAddBoard));
|
||||
Controls.Add(pnlBoardAdd);
|
||||
|
||||
}
|
||||
|
||||
private void FrmBoard_InitBoard()
|
||||
@@ -194,7 +193,7 @@ namespace VAR.Focus.Web.Pages
|
||||
};
|
||||
Controls.Add(chatControl);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace VAR.Focus.Web.Pages
|
||||
private CButton _btnSave = new CButton { ID = "btnSave" };
|
||||
private CButton _btnExit = new CButton { ID = "btnExit" };
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Page life cycle
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
void FrmBoardEdit_Init(object sender, EventArgs e)
|
||||
private void FrmBoardEdit_Init(object sender, EventArgs e)
|
||||
{
|
||||
string strIDBoard = Context.GetRequestParm("idBoard");
|
||||
if (String.IsNullOrEmpty(strIDBoard) == false)
|
||||
@@ -50,7 +50,7 @@ namespace VAR.Focus.Web.Pages
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Page life cycle
|
||||
|
||||
#region UI Events
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion UI Events
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace VAR.Focus.Web.Pages
|
||||
Title = "Register";
|
||||
var lblTitle = new CLabel { Text = "Register", Tag = "h2" };
|
||||
Controls.Add(lblTitle);
|
||||
|
||||
|
||||
Controls.Add(FormUtils.CreateField("Title", _txtTitle));
|
||||
_txtTitle.NextFocusOnEnter = _txtTitle;
|
||||
_txtTitle.PlaceHolder = "Title";
|
||||
@@ -113,7 +113,6 @@ namespace VAR.Focus.Web.Pages
|
||||
_txtDescription.Text = board.Description;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,6 @@ namespace VAR.Focus.Web.Pages
|
||||
context.Response.Write("</code></pre>");
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion IHttpHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,9 @@ namespace VAR.Focus.Web.Pages
|
||||
{
|
||||
#region Declarations
|
||||
|
||||
Exception _ex = null;
|
||||
private Exception _ex = null;
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Page life cycle
|
||||
|
||||
@@ -22,12 +22,12 @@ namespace VAR.Focus.Web.Pages
|
||||
Init += FrmError_Init;
|
||||
}
|
||||
|
||||
void FrmError_Init(object sender, EventArgs e)
|
||||
private void FrmError_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitializeControls();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Page life cycle
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -60,6 +60,6 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ namespace VAR.Focus.Web.Pages
|
||||
|
||||
private CTextBox _txtNameEmail = new CTextBox { ID = "txtNameEmail", CssClassExtra = "width150px", AllowEmpty = false };
|
||||
private CTextBox _txtPassword = new CTextBox { ID = "txtPassword", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password };
|
||||
private CButton _btnLogin = new CButton { ID = "btnLogin"};
|
||||
private CButton _btnLogin = new CButton { ID = "btnLogin" };
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Page life cycle
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace VAR.Focus.Web.Pages
|
||||
InitializeControls();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Page life cycle
|
||||
|
||||
#region UI Events
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace VAR.Focus.Web.Pages
|
||||
Response.Redirect(Globals.DefaultHandler);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion UI Events
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -72,6 +72,6 @@ namespace VAR.Focus.Web.Pages
|
||||
Controls.Add(FormUtils.CreateField(String.Empty, new HyperLink { Text = "Register user", NavigateUrl = "FrmRegister" }));
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace VAR.Focus.Web.Pages
|
||||
private CLabel _lblSuccess = new CLabel { ID = "lblSuccess" };
|
||||
private CButton _btnExitSuccess = new CButton { ID = "btnExitSuccess" };
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Page life cycle
|
||||
|
||||
@@ -31,16 +31,16 @@ namespace VAR.Focus.Web.Pages
|
||||
Init += FrmRegister_Init;
|
||||
}
|
||||
|
||||
void FrmRegister_Init(object sender, EventArgs e)
|
||||
private void FrmRegister_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Page life cycle
|
||||
|
||||
#region UI Events
|
||||
|
||||
void btnRegister_Click(object sender, EventArgs e)
|
||||
private void btnRegister_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
||||
|
||||
@@ -63,12 +63,12 @@ namespace VAR.Focus.Web.Pages
|
||||
_lblSuccess.Text = String.Format("User {0} created sucessfully", user.Name);
|
||||
}
|
||||
|
||||
void btnExit_Click(object sender, EventArgs e)
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect(Globals.DefaultHandler);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion UI Events
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -102,11 +102,11 @@ namespace VAR.Focus.Web.Pages
|
||||
_btnExit.Text = "Exit";
|
||||
_btnExit.Click += btnExit_Click;
|
||||
|
||||
Panel pnlButtons=new Panel();
|
||||
Panel pnlButtons = new Panel();
|
||||
pnlButtons.Controls.Add(_btnRegister);
|
||||
pnlButtons.Controls.Add(_btnExit);
|
||||
_pnlRegister.Controls.Add(FormUtils.CreateField(String.Empty, pnlButtons));
|
||||
|
||||
|
||||
Controls.Add(_pnlSuccess);
|
||||
_pnlSuccess.Visible = false;
|
||||
|
||||
@@ -115,10 +115,8 @@ namespace VAR.Focus.Web.Pages
|
||||
_btnExitSuccess.Text = "Exit";
|
||||
_btnExitSuccess.Click += btnExit_Click;
|
||||
_pnlSuccess.Controls.Add(FormUtils.CreateField(String.Empty, _btnExitSuccess));
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace VAR.Focus.Web.Pages
|
||||
private bool _mustBeAutenticated = true;
|
||||
private User _currentUser = null;
|
||||
|
||||
#endregion
|
||||
#endregion Declarations
|
||||
|
||||
#region Properties
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace VAR.Focus.Web.Pages
|
||||
get { return _currentUser; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Properties
|
||||
|
||||
#region Life cycle
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace VAR.Focus.Web.Pages
|
||||
PreRender += PageCommon_PreRender;
|
||||
}
|
||||
|
||||
void PageCommon_PreInit(object sender, EventArgs e)
|
||||
private void PageCommon_PreInit(object sender, EventArgs e)
|
||||
{
|
||||
Session session = WebSessions.Current.Session_GetCurrent(Context);
|
||||
if (session != null)
|
||||
@@ -73,22 +73,22 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
void PageCommon_Init(object sender, EventArgs e)
|
||||
private void PageCommon_Init(object sender, EventArgs e)
|
||||
{
|
||||
CreateControls();
|
||||
}
|
||||
|
||||
void PageCommon_PreRender(object sender, EventArgs e)
|
||||
private void PageCommon_PreRender(object sender, EventArgs e)
|
||||
{
|
||||
_head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Title, Globals.TitleSeparator, Globals.Title);
|
||||
_btnLogout.Visible = (_currentUser != null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Life cycle
|
||||
|
||||
#region UI Events
|
||||
|
||||
void btnLogout_Click(object sender, EventArgs e)
|
||||
private void btnLogout_Click(object sender, EventArgs e)
|
||||
{
|
||||
WebSessions.Current.Session_FinalizeCurrent(Context);
|
||||
_currentUser = null;
|
||||
@@ -98,7 +98,7 @@ namespace VAR.Focus.Web.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion UI Events
|
||||
|
||||
#region Private methods
|
||||
|
||||
@@ -125,7 +125,6 @@ namespace VAR.Focus.Web.Pages
|
||||
_head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version)));
|
||||
_head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
|
||||
|
||||
|
||||
_body = new HtmlGenericControl("body");
|
||||
html.Controls.Add(_body);
|
||||
_form = new HtmlForm { ID = "formMain" };
|
||||
@@ -159,6 +158,6 @@ namespace VAR.Focus.Web.Pages
|
||||
_form.Controls.Add(_pnlContainer);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Private methods
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user