private SaleModel MapSaleToSaleModel(Sale vItem)
 {
     return new SaleModel()
     {
         Id = vItem.Id,
         Title = vItem.Title,
         Description = vItem.Description,
         Address = vItem.Address,
         LatLong = vItem.LatLong,
         SaleDate = vItem.SaleDate,
         LinkUrl = vItem.LinkUrl
     };
 }
Beispiel #2
0
        public bool SaveNewSale(Sale vSale)
        {
            bool returnStatus = true;
            try
            {
                NANEntities dbContext = new NANEntities();
                dbContext.Sales.Add(vSale);
                dbContext.SaveChanges();
                dbContext.Entry<Sale>(vSale).Reload();
            }
            catch (Exception ex)
            {
                mLastErrorMessage = "error occurred" + ex.Message;
                returnStatus = false;
            }

            return returnStatus;
        }
 private void MapSaleModelToSale(SaleModel vItem, Sale newSale, bool vIsNew)
 {
     if (!vIsNew)
     {
         newSale.Id = vItem.Id;
     }
     newSale.Title = vItem.Title;
     newSale.Description = vItem.Description;
     newSale.Address = vItem.Address;
     newSale.LatLong = "10000,20000";//			vItem.LatLong;
     newSale.SaleDate = vItem.SaleDate;
     newSale.LinkUrl = vItem.LinkUrl;
 }