public UserReference.IUser LoadUser(string reference) { UserReference.IUser user = null; if (reference == "some.identifier") { user = new User(); XmlSerializer reader = new XmlSerializer(user.GetType()); StreamReader file = new StreamReader(@"some.identifier.xml"); user = (User)reader.Deserialize(file); } return(user); }
// Notice how the Operations object is responsible for loading the // User object. Classical OO dictates elsewise, but component // engineering prefers separation. public UserReference.IUser LoadUser(string reference) { UserReference.IUser user = null; if (reference == "some.identifier") { user = new User(); StreamReader sr = new StreamReader(@"some.identifier.txt"); user.name = sr.ReadLine(); user.street = sr.ReadLine(); user.city = sr.ReadLine(); user.country = sr.ReadLine(); } return(user); }
public UserReference.IUser LoadUser(string reference) { DebugMgr.start(9, "XMLUserImpl.Operations.LoadUser"); DebugMgr.outputVar(9, "Reference", reference); GetLocalDirectory(); UserReference.IUser user = null; if (reference == "some.identifier") { user = new User(); XmlSerializer reader = new XmlSerializer(user.GetType()); StreamReader file = new StreamReader(Directory.GetCurrentDirectory() + "/some.identifier.xml"); user = (User)reader.Deserialize(file); } DebugMgr.end(9); return(user); }
// Notice how the Operations object is responsible for loading the // User object. Classical OO dictates elsewise, but component // engineering prefers separation. public UserReference.IUser LoadUser(string reference) { DebugMgr.start(9, "DbUserImpl.Operations.LoadUser"); DebugMgr.outputVar(9, "reference", reference); GetLocalDirectory(); UserReference.IUser user = null; if (reference == "some.identifier") { user = new User(); StreamReader sr = new StreamReader(Directory.GetCurrentDirectory() + "/some.identifier.txt"); user.name = sr.ReadLine(); user.street = sr.ReadLine(); user.city = sr.ReadLine(); user.country = sr.ReadLine(); } DebugMgr.end(9); return(user); }
protected void Page_Load(object sender, EventArgs e) { userRef = new UserReference.UserClient(); user = new UserReference.TUser(); if (Session["user"] != null) { UserLabel.Visible = false; UserBox.Visible = false; PassLabel.Visible = false; PasswordBox.Visible = false; LoginButton.Visible = false; LoginStatus.Text = "You are already logged in"; Logout.Visible = true; } else { } }
protected void Page_Load(object sender, EventArgs e) { userRef = new UserReference.UserClient(); newUser = new UserReference.TUser(); }
private void UserWindow_Load(object sender, EventArgs e) { userRef = new UserReference.UserClient(); refreshButton.PerformClick(); }
protected void Page_Load(object sender, EventArgs e) { userRef = new UserReference.UserClient(); InitWelcomeMessage(); }