Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
QuestionEPPLUS Excel Pin
Member 916988721-Aug-12 14:37
Member 916988721-Aug-12 14:37 
QuestionUsing IList.Contains<> to search nested members? Pin
JoeRip21-Aug-12 14:25
JoeRip21-Aug-12 14:25 
SuggestionRe: Using IList.Contains<> to search nested members? Pin
Matt T Heffron21-Aug-12 15:11
professionalMatt T Heffron21-Aug-12 15:11 
GeneralRe: Using IList.Contains to search nested members? Pin
JoeRip21-Aug-12 15:15
JoeRip21-Aug-12 15:15 
GeneralRe: Using IList.Contains to search nested members? Pin
Matt T Heffron21-Aug-12 15:27
professionalMatt T Heffron21-Aug-12 15:27 
AnswerRe: Using IList.Contains<> to search nested members? Pin
BobJanova22-Aug-12 0:41
BobJanova22-Aug-12 0:41 
Questionplz help with ghe following.... Pin
joy madalane21-Aug-12 12:59
joy madalane21-Aug-12 12:59 
AnswerRe: plz help with ghe following.... Pin
Wes Aday21-Aug-12 15:49
professionalWes Aday21-Aug-12 15:49 
JokeRe: plz help with ghe following.... Pin
Mycroft Holmes21-Aug-12 20:07
professionalMycroft Holmes21-Aug-12 20:07 
AnswerRe: plz help with ghe following.... Pin
OriginalGriff21-Aug-12 21:09
mveOriginalGriff21-Aug-12 21:09 
GeneralRe: plz help with ghe following.... Pin
joy madalane21-Aug-12 21:27
joy madalane21-Aug-12 21:27 
GeneralRe: plz help with ghe following.... Pin
OriginalGriff21-Aug-12 21:47
mveOriginalGriff21-Aug-12 21:47 
QuestionDifferent object depending on variable value Pin
suzyb21-Aug-12 3:50
suzyb21-Aug-12 3:50 
AnswerRe: Different object depending on variable value Pin
OriginalGriff21-Aug-12 4:06
mveOriginalGriff21-Aug-12 4:06 
GeneralRe: Different object depending on variable value Pin
Pete O'Hanlon21-Aug-12 4:31
mvePete O'Hanlon21-Aug-12 4:31 
AnswerRe: Different object depending on variable value Pin
Pete O'Hanlon21-Aug-12 4:40
mvePete O'Hanlon21-Aug-12 4:40 
The big issue you have here is that properties in the derived type aren't present in the base type, so you can't really declare app as BaseApplication. Well, you can, but you need to cast to the derived type to access the properties. What you could do is something like this though:
C#
BaseApplication app = null;
switch (courseType)
{
  case "31":
    app = CreateStudentApplication();
    break;
}

if (app != null)
{
  app.Save();
}
....

private StudentApplication CreateStudentApplication()
{
  StudentApplication app = new StudentApplication();
  SetBaseInformation(app);
  app.SupportNeeds = SupportNeeds.Text;
  return app;
}

private void SetBaseInformation(BaseApplication application)
{
  application.FirstName = FirstName.Text;
  application.LastName = LastName.Text;
}

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

AnswerRe: Different object depending on variable value Pin
Eddy Vluggen21-Aug-12 4:53
professionalEddy Vluggen21-Aug-12 4:53 
GeneralRe: Different object depending on variable value Pin
suzyb21-Aug-12 5:40
suzyb21-Aug-12 5:40 
GeneralRe: Different object depending on variable value Pin
Eddy Vluggen21-Aug-12 5:46
professionalEddy Vluggen21-Aug-12 5:46 
AnswerRe: Different object depending on variable value Pin
jschell22-Aug-12 8:50
jschell22-Aug-12 8:50 
QuestionAutomatically optimize all tables in a MySQL database Pin
Alagiri.periyasamy@merrillcorp.com21-Aug-12 1:46
Alagiri.periyasamy@merrillcorp.com21-Aug-12 1:46 
AnswerRe: Automatically optimize all tables in a MySQL database Pin
Eddy Vluggen21-Aug-12 1:51
professionalEddy Vluggen21-Aug-12 1:51 
GeneralRe: Automatically optimize all tables in a MySQL database Pin
Alagiri.periyasamy@merrillcorp.com21-Aug-12 2:05
Alagiri.periyasamy@merrillcorp.com21-Aug-12 2:05 
AnswerRe: Automatically optimize all tables in a MySQL database Pin
Eddy Vluggen21-Aug-12 2:17
professionalEddy Vluggen21-Aug-12 2:17 
QuestionLinq - Conditions for two categories in parallel Pin
Ronenb21-Aug-12 1:18
Ronenb21-Aug-12 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.