123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- using System;
- using System.IO;
- using System.Collections.Generic;
- using System.Data.Entity;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Met_Fam
- {
- public partial class Goods
- {
- private string typeOfGoods;
- public string TypeOfGoods
- {
- get { return typeOfGoods; }
- set { typeOfGoods = value; }
- }
- }
- public partial class Goods
- {
- private int countfForBuing = 1;
- public int CountfForBuing
- {
- get { return countfForBuing; }
- set { countfForBuing = value; }
- }
- }
- public class Product
- {
- public List<Goods> gds;
- public Product()
- {
- gds = product();
- }
- public List<Goods> product()
- {
- List<Goods> goods = new List<Goods>();
- Goods buff;
- List<Goods> bdgoods = DataBase.BaseModel.Goods.ToList();
- foreach (Goods good in bdgoods)
- {
- buff = new Goods();
- buff.ID_Goods = good.ID_Goods;
- buff.Title_Goods = good.Title_Goods;
- buff.Price_Goods = good.Price_Goods;
- buff.Buying_Goods = good.Buying_Goods;
- buff.Picture = good.Picture;
- buff.Description = good.Description;
- buff.ID_Type_Goods = good.ID_Type_Goods;
- Type_Goods type_Goods = DataBase.BaseModel.Type_Goods.FirstOrDefault(x => x.ID_Type_Goods == good.ID_Type_Goods);
- buff.TypeOfGoods = type_Goods.Title_Type_Goods;
- goods.Add(buff);
- }
- return goods;
- }
- }
- public class Users
- {
- public List<User> usr;
- public Users()
- {
- usr = newuser();
- }
- public List<User> newuser()
- {
- List<User> users = new List<User>();
- User buff;
- List<User> bdusers = DataBase.BaseModel.User.ToList();
- foreach (User user in bdusers)
- {
- buff = new User();
- buff.ID_User = user.ID_User;
- buff.Surname_User = user.Surname_User;
- buff.Name_User = user.Name_User;
- buff.Login_User = user.Login_User;
- buff.Password_User = user.Password_User;
- buff.Phone_User = user.Phone_User;
- buff.Address = user.Address;
- buff.ID_Role = user.ID_Role;
- users.Add(buff);
- }
- return users;
- }
- }
- public class Video
- {
- public List<Videos> videos;
- List<int> buingVM;
- public Video(List<int> buing)
- {
- buingVM = buing;
- videos = newvideo();
- }
- public List<Videos> newvideo()
- {
- List<Videos> video = new List<Videos>();
- Videos buff;
- List<Videos> bdvideos = DataBase.BaseModel.Videos.ToList();
- foreach (Videos vid in bdvideos)
- {
- buff = new Videos();
- buff.ID_Video = vid.ID_Video;
- buff.Video = vid.Video;
- buff.ID_User = vid.ID_User;
- buff.ID_Goods = vid.ID_Goods;
- foreach (int i in buingVM)
- {
- if (i == buff.ID_Goods)
- {
- video.Add(buff);
- }
- }
- }
- return video;
- }
- }
- public class BGoods
- {
- public List<Buying_Goods> bg;
- public BGoods()
- {
- bg = newvideo();
- }
- public List<Buying_Goods> newvideo()
- {
- List<Buying_Goods> bgood = new List<Buying_Goods>();
- Buying_Goods buff;
- List<Buying_Goods> bdvideos = DataBase.BaseModel.Buying_Goods.ToList();
- foreach (Buying_Goods vid in bdvideos)
- {
- buff = new Buying_Goods();
- buff.ID_Buying_Goods = vid.ID_Buying_Goods;
- buff.ID_Goods = vid.ID_Goods;
- buff.ID_User = vid.ID_User;
- buff.Data_Buying_Goods = vid.Data_Buying_Goods;
- buff.Quantity = vid.Quantity;
- bgood.Add(buff);
- }
- return bgood;
- }
- }
- }
|