Example #1
0
 public static int GetId(ClothesTypes itemChoise, ClothesContext db)
 {
     while (true)
     {
         try
         {
             Console.Write("Enter item's Id: ");
             var id = Convert.ToInt32(Console.ReadLine());
             if ((db.Tops.Find(id) == null && itemChoise == ClothesTypes.Tops) || (db.Pants.Find(id) == null && itemChoise == ClothesTypes.Pants) || (db.Shoes.Find(id) == null && itemChoise == ClothesTypes.Shoes))
             {
                 Misc.ConsoleLog(ConsoleColor.Yellow, $"Sorry, there is no {itemChoise} in DataBase with such ID, exit (Y/N)?");
                 string temp = Console.ReadLine();
                 if (temp == "Y" || temp == "y")
                 {
                     return(-1);
                 }
             }
             else
             {
                 return(id);
             }
         }
         catch (Exception)
         {
             Misc.ConsoleLog(ConsoleColor.Yellow, "Incorrect Id, try again");
         }
     }
 }
Example #2
0
 public SqlInventoryRepo(ClothesContext context)
 {
     _context = context;
 }
Example #3
0
 public ClothesRepository(ClothesContext clothesContext)
 {
     this.clothesContext = clothesContext;
 }
 public ProductImagesRepository(ClothesContext context) : base(context)
 {
 }
Example #5
0
 public DepartmentRepository(ClothesContext context) : base(context)
 {
 }
Example #6
0
 public ClothingRepository(ClothesContext clothesContext)
 {
     ClothesContext = clothesContext;
 }
Example #7
0
 public UnitOfWork(ClothesContext context)
 {
     Context = context;
 }
Example #8
0
 public Repository(ClothesContext context)
 {
     Context = context;
 }
Example #9
0
 public AppUserRepository(ClothesContext context) : base(context)
 {
 }
Example #10
0
 public OwnerRepository(ClothesContext context) : base(context)
 {
 }
Example #11
0
 public HomeController(ClothesContext context)
 {
     db = context;
     Console.WriteLine(db);
 }