private void DefaultParametrs(LotEF lot = null, bool refresh = false) { if (!refresh) { UnitList = DataBaseClient.ReadUnits(); } if (lot == null) { Lot = new LotEF(); Lot.auctionid = _auctionId; Lot.number = DataBaseClient.ReadAuction(_auctionId).siteid == 4 ? "0G" : ""; Lot.deliveryplace = "Согласно договору"; Lot.deliverytime = "Согласно договору"; Lot.paymentterm = "Согласно договору"; Lot.step = 1; Lot.warranty = 0.1; SelectedUnit = UnitList[0]; } else { try { SelectedUnit = UnitList.FirstOrDefault(x => x.id == lot.unitid); } catch (Exception) { SelectedUnit = UnitList[0]; } Quantity = Lot.amount; Price = Lot.price; Sum = Lot.sum; Lot = Lot; } }
public static void CreateOrder(Order order, int auctionId, int traderId) { orderInfo = order; orderFileName = ArchiveTransport.PutUTBOrder(order); lotInfo = DataBaseClient.UpdateUTBNewOrder(order, auctionId, traderId); FillTemplateFile(); Process.Start("explorer", @"\\192.168.11.5\Archive\Auctions\UTB\" + order.Auction.Date.ToShortDateString() + "\\" + order.Title.Replace("/", "_")); }
public LotViewModel(int auctionId, AuctionViewModel auctionViewModel, LotEF lotInfo = null) { this.auctionViewModel = auctionViewModel; _auctionId = auctionId; if (lotInfo != null) { FormTitle = "Просмотр/редактирование лота"; Lot = lotInfo; } else { FormTitle = "Создание лота"; } DefaultParametrs(Lot); }