protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { UserDaoImpl dao = new UserDaoImpl(); //ItemDaoImpl dao = new ItemDaoImpl(); //Credentials creds = dao.getCredentialsByEmail(TextBox1.Text.ToString()); //User user = dao.getUserByEmail(TextBox1.Text.ToString()); //List<Item> list = dao.getItemsByCategory(TextBox1.Text.ToString()); //Item item = dao.getItemByNumber(TextBox1.Text.ToString()); //Response.Write(list.Count); //list.ForEach(printItem ); //Response.Write(item.ToString()); //Item i = new Item() //{ // CategoryID = "CP", // UserID = 100, // ItemName = "TestItem", // ItemValue = 100, // AngelPrice = 75, // MinBid = 50, // Paid = false //}; User u = new User() { Email = "*****@*****.**", FirstName = "Tim", LastName = "Lenahan", Address = "123 Easy st", City = "Normal", State = "IL", Zip = 61761, Admin = true, Committee = false, Donor = false, Phone = "6303106285", Text = true }; dao.createUser(u); //int newID = dao.createItem(i); //Response.Write(i.ItemID); } }
public bool signUp(User u, Credentials c) { bool valid = false; userDao = new UserDaoImpl(); if (userDao.createUser(u)) { User = u; if (userDao.createCredentials(c)) { Credentials = c; valid = true; } } return valid; }
public bool signUp(User u, Credentials c) { bool valid = false; UserDaoImpl userDao = new UserDaoImpl(); userDao.createUser(u); if (true) { userDao.createCredentials(c); if (true) { Credentials creds = c; valid = true; Session["StartTime"] = DateTime.UtcNow; Session["Name"] = userEmailTxt.Text; Session["Admin"] = "No"; Response.Redirect("Profile.aspx"); } } return valid; }