예제 #1
0
 public string AddLot(string Name, string About, int StartPrice, DateTime Start, DateTime Finish, byte[] Img = null)
 {
     if (person == null)
     {
         return("Authorization!!!");
     }
     if (StartPrice <= 0)
     {
         return("Start price must be up 0");
     }
     if (Finish < Start || Start < DateTime.Now)
     {
         return("Input true date and time");
     }
     if (Name.Length == 0 || About.Length == 0)
     {
         return("Input name and about");
     }
     if (LotsWork.AddLot(new Lot()
     {
         About = About, LotName = Name, StartPrice = StartPrice, TimeStart = Start, TimeFinish = Finish, Photo = Img
     }, person) == true)
     {
         return("Lot is add");
     }
     else
     {
         return("Something wrong");
     }
 }
예제 #2
0
 public string Bet(int lotId, int money)
 {
     if (person == null)
     {
         return("Authorization!!!");
     }
     return(LotsWork.Bet(person, lotId, money));
 }
예제 #3
0
        public Lot AboutLot(int LotId)
        {
            Lot l = LotsWork.AboutLot(LotId);

            return(new Lot()
            {
                LotName = l.LotName, StartPrice = l.StartPrice, About = l.About, Id = l.Id, Photo = l.Photo, TimeFinish = l.TimeFinish, TimeStart = l.TimeStart
            });
        }
예제 #4
0
 public List <LotHistory> GetLotHistory(int lot)
 {
     try
     {
         List <LotHistory> l = new List <LotHistory>();
         foreach (LotHistory elem in LotsWork.GetLotHistory(lot))
         {
             l.Add(new LotHistory()
             {
                 Id = elem.Id, Persson = new Person()
                 {
                     FirstName = elem.Persson.FirstName
                 }, Money = elem.Money
             });
         }
         return(l);
     }
     catch (Exception ex)
     {
         Log.Logger(ex.Message);
         return(null);
     }
 }
예제 #5
0
 public int LastBet(int LotId)
 {
     return(LotsWork.LastBet(LotId));
 }
예제 #6
0
 public string LotHistory(int LotId)
 {
     return(LotsWork.LotHistory(LotId));
 }