public bool Update(GoldWorldPriceVM entity) { GoldWorldPrice ig = new GoldWorldPrice { ID = entity.ID, ARName = entity.ARName, Code = entity.Code, LatName = entity.LatName, PriceDate = entity.PriceDate, GoldPrice = entity.GoldPrice, Notes = entity.Notes, KiloPrice = entity.KiloPrice, OuncePrice = entity.OuncePrice }; try { goldWorldPriceRepo.Update(ig, ig.ID); } catch (Exception ex) { } return(true); }
public Task <int> InsertAsync(GoldWorldPriceVM entity) { return(Task.Run <int>(async() => { GoldWorldPrice ig = new GoldWorldPrice { ID = entity.ID, ARName = entity.ARName, Code = entity.Code, LatName = entity.LatName, PriceDate = entity.PriceDate, GoldPrice = entity.GoldPrice, Notes = entity.Notes, KiloPrice = entity.KiloPrice, OuncePrice = entity.OuncePrice }; try { goldWorldPriceRepo.Add(ig); await UpdateItemPrices(ig); } catch (Exception ex) { } return ig.ID; } )); }
public async Task <IHttpActionResult> delete([FromBody] GoldWorldPriceVM entity) { var result = await goldWorldPriceService.DeleteAsync(entity); await LogData(entity.Code, entity.ID.ToString()); return(Ok(result)); }
public async Task <IHttpActionResult> add([FromBody] GoldWorldPriceVM entity) { var result = await goldWorldPriceService.InsertAsync(entity); await LogData(entity.Code, result.ToString()); if (result != 0) { return(Ok(true)); } return(Ok(false)); }
public bool Insert(GoldWorldPriceVM entity) { GoldWorldPrice ig = new GoldWorldPrice { ID = entity.ID, ARName = entity.ARName, Code = entity.Code, LatName = entity.LatName, PriceDate = entity.PriceDate, GoldPrice = entity.GoldPrice, Notes = entity.Notes, KiloPrice = entity.KiloPrice, OuncePrice = entity.OuncePrice }; goldWorldPriceRepo.Add(ig); return(true); }
public Task <bool> DeleteAsync(GoldWorldPriceVM entity) { return(Task.Run <bool>(() => { GoldWorldPrice ig = new GoldWorldPrice { ID = entity.ID, ARName = entity.ARName, Code = entity.Code, LatName = entity.LatName, PriceDate = entity.PriceDate, GoldPrice = entity.GoldPrice, Notes = entity.Notes, KiloPrice = entity.KiloPrice, OuncePrice = entity.OuncePrice }; goldWorldPriceRepo.Delete(ig, entity.ID); return true; })); }