Every day I die a little more...
-
How to generate an ASP.NET menu, if you are an evil genius First one must define what it is we are to show (apologies for the odd characters, it is badly endoded arabic):
private string memberMenu = @"<table border=0 cellpadding=1 cellspacing=1 width=100% dir=rtl style=font-family:Tahoma;font-size:12px;><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MembersResearchList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÃÈÍÇË æÏÑÇÓÇÊ\');return false;"" class=""navMenu"">ÃÈÍÇË æÏÑÇÓÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersExperience.aspx\');top.SetTitle(\'ÇáÎÈÑÇÊ\');return false;"" class=""navMenu"">ÇáÎÈÑÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersAcademicRank.aspx\');top.SetTitle(\'ÇáÑÊÈÉ ÇáÚáãíÉ\');return false;"" class=""navMenu"">ÇáÑÊÈÉ ÇáÚáãíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MemberQualificationList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ãÄåá ÇßÇÏíãí\');return false;"" class=""navMenu"">ãÄåá ÇßÇÏíãí</a></td></tr><tr><td><a href=""#"" onclick=""{0}"" class=""navMenu"">ÊÍãíá ÇáÓíÑÉ ÇáÐÇÊíÉ</a></td></tr><tr><td><a href=""#"" onclick=""{1}"" class=""navMenu"" title=""ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ"">ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ</a></td></tr><tr><td><a href=""#"" onclick=""window.open(\'loadEduGate.htm\'); return false;"" class=""navMenu"">ÇáÈæÇÈÉ ÇáÅáßÊÑæäíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MarksMainPage.aspx\');top.SetTitle(\'äÙÇã ÇáÚáÇãÇÊ ÇáÑÓãí áÃÚÖÇÁ ÇáåíÆÇÊ ÇáÊÏÑíÓíÉ ÈÌÇãÚÉ ÇáÈÊÑÇ\');return false;"" class=""navMenu"">äÙÇã ÇÏÎÇá ÇáÚáÇãÇÊ</a></td></tr></table>";
Then one must show it:
lblScript.Text = @"<script type='text/javascript'>document.getElementById('navContent').innerHTML='" + string.Format(memberMenu, @"top.SetLocation(\'\',\'\',\'ListOfMemberCVs.aspx?mid=" + (new FacultyMembers()).GetMemberByUserName(sUserName + "@uop.edu.jo").Rows[0]["membersID"].ToString() + @"&t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÇáÓíÑÉ ÇáÐÇÊíÉ\');return false;", @"top.SetLocation(\'\',\'\',\'../Courseslist/Default.aspx?d=" + ReserveTic
-
How to generate an ASP.NET menu, if you are an evil genius First one must define what it is we are to show (apologies for the odd characters, it is badly endoded arabic):
private string memberMenu = @"<table border=0 cellpadding=1 cellspacing=1 width=100% dir=rtl style=font-family:Tahoma;font-size:12px;><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MembersResearchList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÃÈÍÇË æÏÑÇÓÇÊ\');return false;"" class=""navMenu"">ÃÈÍÇË æÏÑÇÓÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersExperience.aspx\');top.SetTitle(\'ÇáÎÈÑÇÊ\');return false;"" class=""navMenu"">ÇáÎÈÑÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersAcademicRank.aspx\');top.SetTitle(\'ÇáÑÊÈÉ ÇáÚáãíÉ\');return false;"" class=""navMenu"">ÇáÑÊÈÉ ÇáÚáãíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MemberQualificationList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ãÄåá ÇßÇÏíãí\');return false;"" class=""navMenu"">ãÄåá ÇßÇÏíãí</a></td></tr><tr><td><a href=""#"" onclick=""{0}"" class=""navMenu"">ÊÍãíá ÇáÓíÑÉ ÇáÐÇÊíÉ</a></td></tr><tr><td><a href=""#"" onclick=""{1}"" class=""navMenu"" title=""ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ"">ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ</a></td></tr><tr><td><a href=""#"" onclick=""window.open(\'loadEduGate.htm\'); return false;"" class=""navMenu"">ÇáÈæÇÈÉ ÇáÅáßÊÑæäíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MarksMainPage.aspx\');top.SetTitle(\'äÙÇã ÇáÚáÇãÇÊ ÇáÑÓãí áÃÚÖÇÁ ÇáåíÆÇÊ ÇáÊÏÑíÓíÉ ÈÌÇãÚÉ ÇáÈÊÑÇ\');return false;"" class=""navMenu"">äÙÇã ÇÏÎÇá ÇáÚáÇãÇÊ</a></td></tr></table>";
Then one must show it:
lblScript.Text = @"<script type='text/javascript'>document.getElementById('navContent').innerHTML='" + string.Format(memberMenu, @"top.SetLocation(\'\',\'\',\'ListOfMemberCVs.aspx?mid=" + (new FacultyMembers()).GetMemberByUserName(sUserName + "@uop.edu.jo").Rows[0]["membersID"].ToString() + @"&t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÇáÓíÑÉ ÇáÐÇÊíÉ\');return false;", @"top.SetLocation(\'\',\'\',\'../Courseslist/Default.aspx?d=" + ReserveTic
In any application I scream a little every time I see a hard coded menu. FFS, it is as easy to parametrise it as it is to hard code and the latter is more extensible. If I caught one of my trained simians doing that it'd be bull-whip time.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
In any application I scream a little every time I see a hard coded menu. FFS, it is as easy to parametrise it as it is to hard code and the latter is more extensible. If I caught one of my trained simians doing that it'd be bull-whip time.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
You'd have a fit with our codebase, nothing (I and mean nothing) is well implemented. I'd call "Job Security" but the bloke who wrote the worst of it left. To add piquancy to the proceedings, I'm struggling to convince the powers that be that doing things properly will be quicker than doing things "quickly" as per the OP. Oh well, I can always resign.
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^] -
You'd have a fit with our codebase, nothing (I and mean nothing) is well implemented. I'd call "Job Security" but the bloke who wrote the worst of it left. To add piquancy to the proceedings, I'm struggling to convince the powers that be that doing things properly will be quicker than doing things "quickly" as per the OP. Oh well, I can always resign.
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^]The approach has to be to give them a route to a better application. "Throw it all away" will not work. Tell the PHB's that any bug fix will take 5x what would be expected because of the shyte code, but only 4x to reimplement. Stick to this. All new work, for a given value of 'new', should be done with the new approach and the legacy code updated as and when it needs to change. If possible, black-box the legacy stuff so that you don't have to go in there too often.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
You'd have a fit with our codebase, nothing (I and mean nothing) is well implemented. I'd call "Job Security" but the bloke who wrote the worst of it left. To add piquancy to the proceedings, I'm struggling to convince the powers that be that doing things properly will be quicker than doing things "quickly" as per the OP. Oh well, I can always resign.
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^]Same here. I have written applications that have been online for months without any problems and they whine about the time it took to get them to work that well. The old application fell apart every day and was almost unmaintainable, but this time and effort somehow does not count.
"Dark the dark side is. Very dark..." - Yoda ---
"Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi -
The approach has to be to give them a route to a better application. "Throw it all away" will not work. Tell the PHB's that any bug fix will take 5x what would be expected because of the shyte code, but only 4x to reimplement. Stick to this. All new work, for a given value of 'new', should be done with the new approach and the legacy code updated as and when it needs to change. If possible, black-box the legacy stuff so that you don't have to go in there too often.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
Yes, they don't have to know that in the end nothing of the old code will remain and that you gradually threw everything away. Hopefully the old application is not so twisted and dependent that every change triggers a chain reaction of subsequent changes. Then you have little chance to do it step by step.
"Dark the dark side is. Very dark..." - Yoda ---
"Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi -
The approach has to be to give them a route to a better application. "Throw it all away" will not work. Tell the PHB's that any bug fix will take 5x what would be expected because of the shyte code, but only 4x to reimplement. Stick to this. All new work, for a given value of 'new', should be done with the new approach and the legacy code updated as and when it needs to change. If possible, black-box the legacy stuff so that you don't have to go in there too often.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
Yes, that would be a good approach, but they've agreed to a re-write (on the grounds our current site really doesn't play well will googlebots) but they want the new system to be as patchy as the first. Naturally, there is some politics going on which is behind all this.
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^]