//Same but womens public static List <Product> GetWomensProducts() { List <Product> products = new List <Product>(); products = DataAccessLogic.GetWomensProducts(); return(products); }
//Returns a single product model to be displayed public static Product GetProduct(int productID) { Product product = new Product(); product = DataAccessLogic.GetProduct(productID); return(product); }
protected void Page_Load(object sender, EventArgs e) { //Response.Redirect("http://www.google.com?id=45&name=abc"); //chnage Application["language"] = "english"; Cache["language"] = "english"; Session["something"] = "56"; if (!Page.IsPostBack) { ListItem[] expertise = { new ListItem("C#"), new ListItem("ASP.NET"), new ListItem("SQL"), new ListItem("MVC") }; lstExpertise.Items.AddRange(expertise); } DataAccessLogic obj = new DataAccessLogic(); // var dataList = obj.GetAssessments(); //var dataList = obj.GetAssessmentsTable(); var dataList = (obj.GetAssessmentsDataSet()).Tables[0]; grdAssessments.DataSource = dataList; grdAssessments.DataBind(); var lang = Convert.ToString(Application["language"]); var langCache = Convert.ToString(Cache["language"]); var session = Convert.ToString(Session["something"]); }
protected void btnSumbit_Click(object sender, EventArgs e) { Server.Transfer("/About.aspx", true); if (Page.IsValid) { string expertise = lstExpertise.SelectedItem.Text; string Qualification = chkQualification.SelectedItem.Text; var input = new Assessment() { id = 1, firstname = txtFirstName.Text, lastname = textLastName.Text, email = txtEmail.Text, age = Convert.ToInt32(txtAge.Text), Gender = (rdGender.SelectedIndex == 1) ? 2 : 1, expertise = expertise, country = ddlCountry.SelectedItem.Text, qualification = Qualification }; DataAccessLogic obj = new DataAccessLogic(); obj.SaveAssessment(input); //bool res = obj.Register(txtEmail.Text,txtPassword.Text); var dataList = obj.GetAssessments(); grdAssessments.DataSource = dataList; grdAssessments.DataBind(); } }
//Get's a user account public static UserAccount GetUser(string username) { UserAccount user = new UserAccount(); user = DataAccessLogic.GetUser(username); return(user); }
//Gets all the items in a users purchase history public static List <CHProduct> GetHistoryItems(string username) { List <CHProduct> products = new List <CHProduct>(); products = DataAccessLogic.GetHistoryItems(username); return(products); }
protected void grdAssessments_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataAccessLogic obj = new DataAccessLogic(); grdAssessments.PageIndex = e.NewPageIndex; var dataList = obj.GetAssessments(); grdAssessments.DataSource = dataList; grdAssessments.DataBind(); }
//Same but for admin accounts public static int AdminLogin(string username, string password) { int result = DataAccessLogic.AdminLogin(username, password); if (result == 2) { return(2); } else if (result == 1) { return(1); } else { return(0); } }
//Reactivates the account public static void ReinstateAccount(string username) { DataAccessLogic.ReinstateAccount(username); return; }
//Suspends a user's account public static void SuspendAccount(string username) { DataAccessLogic.SuspendAccount(username); return; }
//Same but admin public static void AddAdmin(string username, string password, string email) { DataAccessLogic.AddAdmin(username, password, email); return; }
//Adds a product matching the ID to the users cart public static void AddToCart(string username, int productID) { DataAccessLogic.AddToCart(username, productID); return; }
//Passes a user's credentials to be added to the database in the DAL public static void AddUser(string username, string password) { DataAccessLogic.AddUser(username, password); return; }
//Deletes an item from the database public static void DeleteItem(int productID) { DataAccessLogic.DeleteItem(productID); return; }
//Updates a item matching the productID with provided details public static Product UpdateItem(int id, string name, string manufacturer, string description, string materials, decimal price, string category) { Product product = DataAccessLogic.UpdateItem(id, name, manufacturer, description, materials, price, category); return(product); }
//Updates the stored imagepath to be consistent with others public static void UpdateImagePath(int productID, string imagePath) { DataAccessLogic.UpdateImagePath(productID, imagePath); return; }
//Moves the user's cart to history upon successful checkout public static void CartToHistory(string username) { DataAccessLogic.CartToHistory(username); return; }