public ObservableCollection <ProductModel> GetAllItems() { Items = new ObservableCollection <ProductModel>(); RestAPI = new RestAPI(); List <Model.Product> products = RestAPI.GetProducts(); if (products == null) { return(Items); } foreach (var item in products) { ProductModel productItem = new ProductModel() { Id = item.Id, ProductName = item.Name, ProductPrice = item.Price, ProductNewPrice = item.new_Price, ProductContext = item.Context, ProductStockCount = item.StockCount, ProductImages = item.Images, }; Items.Add(productItem); } return(Items); }
public ObservableCollection <ProductModel> GetFilterProduct(string name) { Items = new ObservableCollection <ProductModel>(); RestAPI = new RestAPI(); int search; foreach (var item in RestAPI.GetProducts()) { search = item.Name.IndexOf(name, 0, item.Name.Length); if (search == -1) { } else { ProductModel productItem = new ProductModel() { Id = item.Id, ProductName = item.Name, ProductPrice = item.Price, ProductNewPrice = item.new_Price, ProductContext = item.Context, ProductStockCount = item.StockCount, ProductImages = item.Images, }; Items.Add(productItem); } } return(Items); }
public ObservableCollection <SepetModel> GetAllItems() { sepetItems = new ObservableCollection <SepetModel>(); RestAPI = new RestAPI(); List <Sepet> sepet = RestAPI.GetSepet(); if (sepet == null) { return(sepetItems); } foreach (var item in sepet) { SepetModel sepetItem = new SepetModel() { Id = item.Id, ProductName = item.Name, ProductPrice = item.Price, ProductNewPrice = item.new_Price, ProductImages = item.Images, }; sepetItems.Add(sepetItem); } return(sepetItems); }
public ObservableCollection <CategoryModel> GetAllItems() { Items = new ObservableCollection <CategoryModel>(); RestAPI = new RestAPI(); List <Category> category = RestAPI.GetCategory(); if (category == null) { return(Items); } foreach (var item in category) { CategoryModel categoryItem = new CategoryModel() { Id = item.Id, CategoryName = item.Name, }; Items.Add(categoryItem); } return(Items); }
public ObservableCollection <SignupModel> GetAllItems() { Items = new ObservableCollection <SignupModel>(); RestAPI = new RestAPI(); List <Signup> sepet = RestAPI.GetSignup(); if (sepet == null) { return(Items); } foreach (var item in sepet) { SignupModel signupItem = new SignupModel() { Name = item.Name, Surname = item.Surname, Adress = item.Adress, Email = item.Email, Parola = item.Parola, }; Items.Add(signupItem); } return(Items); }
public SetCategories() { RestAPI = new RestAPI(); //AddItems(); }
public SetProducts() { RestAPI = new RestAPI(); //AddItems(); }
public SetSignup() { RestAPI = new RestAPI(); //AddItems(); }
public SetSepet() { RestAPI = new RestAPI(); //AddItems(); }