示例#1
0
 public static void SaveLot(LotModel lot)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) // connection to SQlite
     {
         cnn.Execute("insert into Lots (Title,Description,Min_Price,To_Date) values (@Title,@Description,@Min_Price,@To_Date)", lot);
     }
 }
示例#2
0
 private void LotsDataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (LotsDataGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
         {
             currLot = (LotModel)LotsDataGrid.CurrentRow.DataBoundItem; //Отрмую нажату книгу
             lotSelectedLabel.Text = "Вибраний лот: " + currLot;
         }
     }
 }
示例#3
0
        public List <OfferModel> GetOffersOutOfDate(List <OfferModel> offerModels, List <LotModel> lotModels)
        {
            List <OfferModel> tempListOffers = new List <OfferModel>();

            foreach (OfferModel offer in offerModels)
            {
                LotModel temoLot = lotModels.Find(item => item.Lot_Id == offer.Lot_Id);

                DateTime lotDate = DateTime.Parse(temoLot.To_Date);
                DateTime dateNow = DateTime.Now;

                if (lotDate <= dateNow)
                {
                    tempListOffers.Add(offer);
                }
            }
            return(tempListOffers);
        }