/// <summary> /// This method to add items to cart /// </summary> /// <param name="lst">list as a parameter</param> public void AddToCart(List <CartItems> lst) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); dal.AddToCart(lst); } catch (OSException ex) { throw ex; } }
/// <summary> /// this method is used to delete the product from cart based on productid /// </summary> /// <param name="id"> productid as parameter</param> public void DeleteFromCartById(int id) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); dal.DeleteFromCartById(id); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method retrieve the usercredentials record from database based on password /// </summary> /// <param name="name"> It is used to pass the password whose record is to be selected</param> /// <returns> usercredentials record found based on password passed</returns> public UserCredentials GetPassword(string name) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var pw = dal.GetPassword(name); return(pw); } catch (OSException ex) { throw ex; } }
/// <summary> /// this method retrieves all the items in cart from database /// </summary> /// <returns>cart items record from data base</returns> public List <CartItems> GetCartItems() { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var lstcart = dal.GetCartItems(); return(lstcart); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method retrieve all the productcategory records from database /// </summary> /// <returns>productcategory record from database</returns> public List <ProductCategory> GetAllCategories() { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var lstc = dal.GetAllCategories(); return(lstc); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method displays the products which are in cart list /// </summary> /// <param name="list">it is used to pass the cartlist whose record is to be selected</param> /// <returns>products are found</returns> public List <Products> ViewCart(string list) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var lstpro = dal.ViewCart(list); return(lstpro); } catch (OSException ex) { throw ex; } }
/// <summary> /// This Method retrieve the usercredentials record from database based on username /// </summary> /// <param name="name"> It is used to pass the username whose record is to be selected</param> /// <returns> usercredentials record found based on username passed</returns> public UserCredentials GetUserName(string name) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var user = dal.GetUserName(name); return(user); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method retrieve the products record from database based on product name /// </summary> /// <param name="productname"> It is used to pass the product name whose record is to be selected</param> /// <returns> product records found based on productname passed</returns> public List <Products> GetProductsByName(string productname) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var lstpro = dal.GetProductsByName(productname); return(lstpro); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method retrieve the product records from database based on category name /// </summary> /// <param name="cname">It is used to pass the category name whose record is to be selected </param> /// <returns> product records found based on category name passed</returns> public List <Products> GetProductsByCategoryName(string cname) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var lstc = dal.GetProductsByCategoryName(cname); return(lstc); } catch (OSException ex) { throw ex; } }
/// <summary> /// This method retrieve the product record from database based on product id /// </summary> /// <param name="id"> It is used to pass the product id whose record is to be selected </param> /// <returns> product record found based on product id passed</returns> public Products GetProductDetailsById(int id) { try { OSDataAccessLayer dal = new OSDataAccessLayer(); var pro = dal.GetProductDetailsById(id); return(pro); } catch (OSException ex) { throw ex; } }