Searching for an answer has become clear with http://www.pluralsight-training.net

Several years ago I had a question that I asked countless times with really no answer or solution. I wanted to know “What does it take to change from a mid level developer to a senior level developer?” I was really wanting to discover this answer because I felt I was still really not a senior level developer. And I wanted to take that step to begin my career as a senior level developer. I am still not sure I have made this step to become a senior level developer. However I am on a “Journey to become a better developer!” I do however feel that I may have the answer to the question “How do you move from a mid level developer to a senior level developer.”  The answer is “http://www.pluralsight-training.net!” I feel that this training is very solid and really great to developing your skill-set. Software development really is the continuous strive to improve both your skill set and understand of just writing and developing code. I have taken several training classes from many places but this is by far the best I have ever had. With that being said I have been working on an MVC3 project and have been trying to develop a webgrid filter that is a linkbutton functionality. With the help with pluralsight-training, Dan Wahlin, Scott Allen I have been working on a solution for a couple of days now. I have been watching Dan Wahlin and jQuery, Scott Allen and MVC3 to get this webfilter developed.

I am hoping this will help someone to be able to develop a solution for some one. I am not sure this is the best way to develop this solution for MVC3 so understand this my be the wrong way to implement this code. But here goes nothing…

I first created a controller with an [HttpGet] method that looks like this:

public ActionResult AllUsers()
{
//var u = new UsersDao();
var uc = Membership.GetAllUsers();
var lstUser = new List();
foreach (MembershipUser membershipUser in uc)
{
var u = new UsersDao
{
UserName = membershipUser.UserName,
Email = membershipUser.Email,
Comment = membershipUser.Comment,
CreationDate = membershipUser.CreationDate,
LastLoginDate = membershipUser.LastLoginDate,
LastActivityDate = membershipUser.LastActivityDate,
LastLockoutDate = membershipUser.LastLockoutDate,
IsApproved = membershipUser.IsApproved,
IsLockedOut = membershipUser.IsLockedOut,
IsOnline = membershipUser.IsOnline,

};
lstUser.Add(u);
}
return View(lstUser);
}

I then created a .cshtml page

@using ConcurrentDevelopment.MvcSubmitExtensions.Html
@using DocuTech.DataLayer
@model List
@{
ViewBag.Title = "AllUsers";
}

AllUsers

var btnA = $('#A')

@Html.ValidationSummary(true, "AddUser was successful. Press Next to set up the roles for the user.")
@using (Html.BeginForm())
{

@{
var grid = new WebGrid(Model, defaultSort: "UserName", rowsPerPage: 5);
}

Users Grid View

@{
var sList = new List
{
"All", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
"L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
"W", "X", "Y", "Z"
};
}

@foreach (string s in sList)
{
@Html.SubmitLink(s,new {id = s})
}

Filter Grid: @Html.TextBox("letter") @Html.SubmitLink("Submit")

@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("UserName"),
grid.Column("Email"),
grid.Column("Comment"),
grid.Column("CreationDate"),
grid.Column("LastLoginDate"),
grid.Column("LastActivityDate"),
grid.Column("LastLockoutDate"),
grid.Column("IsApproved"),
grid.Column("IsOnline"),
grid.Column("IsLockedOut")))

}

I used a program written by Concurrent Development Ltd. which was a development for creating a Linkbutton. This code can be found here:

http://www.concurrentdevelopment.co.uk/blog/index.php/2011/02/asp-net-mvc-linkbutton-with-htmlhelper-extensions/

I then created a JavaScript file that handled the jQuery functionality that would handle the click event on the link buttons that would place the value you click in the filter TextBox. I used the ID value to develop the filter.


/*
--------------------------------------------------
All Required functions for the AllUsers.cshtml Page.
--------------------------------------------------
*/
$(document).ready(function () {
$('#A').click(function () {
//alert($('#A').html());

});
});

/*
---------------------------------------------------
Link function click event
---------------------------------------------------
*/
$(function () {
$('#A').click(function () {
$('#letter').val($('#A').attr('id'));
event.preventDefault();

});
});

$(function () {
$('#B').click(function () {
$('#letter').val($('#B').attr('id'));
});
});

$(function () {
$('#S').click(function() {
$('#letter').val($('#S').attr('id'));
event.preventDefault();
});
});

$(function () {
$('#All').click(function () {
$('#letter').val("");
});
});

I finally created this [HttpPost] method like this:

[HttpPost]
public ActionResult AllUsers(string letter)
{
var uc = Membership.GetAllUsers();
var lstUser = (from MembershipUser membershipUser in uc
select new UsersDao
{
UserName = membershipUser.UserName,
Email = membershipUser.Email,
Comment = membershipUser.Comment,
CreationDate = membershipUser.CreationDate,
LastLoginDate = membershipUser.LastLoginDate,
LastActivityDate = membershipUser.LastActivityDate,
LastLockoutDate = membershipUser.LastLockoutDate,
IsApproved = membershipUser.IsApproved,
IsLockedOut = membershipUser.IsLockedOut,
IsOnline = membershipUser.IsOnline,
}).Where(lst => lst.UserName.StartsWith(letter,true,null)).ToList();

return View(lstUser);
}

I think that this was a good experience in answering the question, “How do you move from a mid level to senior level developer.” I feel the only way to continue to improve the software development world is to continue to program a lot and new stuff that you dont know. I think that is accomplished is by watching awesome video’s by pluralsight-training by great people like Dan Wahlin, Scott Allen and all the other authors.

2 Comments on “Searching for an answer has become clear with http://www.pluralsight-training.net

  1. What you need to be asking yourself is how you can become a better developer in general. Remove the idea of hierarchy, and seek to become a software craftsman (http://manifesto.softwarecraftsmanship.org/). Focusing on junior/mid/senior should not be as important as striving to be the best at what you do, no matter what level a business says you are. That being said, sites like PluralSite, DestroyAllSoftware, and other screencast teaching sites are a great way to become better at what you do 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: