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"); } }
public string Bet(int lotId, int money) { if (person == null) { return("Authorization!!!"); } return(LotsWork.Bet(person, lotId, money)); }
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 }); }
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); } }
public int LastBet(int LotId) { return(LotsWork.LastBet(LotId)); }
public string LotHistory(int LotId) { return(LotsWork.LotHistory(LotId)); }