public bool Insert(AssetPropertyDetail objUI) { bool isSuccess=true; try { dbContext.AssetPropertyDetails.InsertOnSubmit(objUI); dbContext.SubmitChanges(); } catch (Exception) { isSuccess = false; } return isSuccess; }
public bool Update(AssetPropertyDetail objUI) { bool isSuccess = true; try { AssetPropertyDetail objDb = GetById(objUI.ID.ToString()); if (objDb != null) { Update(objUI, objDb); } else { isSuccess = false; } } catch (Exception) { isSuccess = false; } return isSuccess; }
private void Update(AssetPropertyDetail objUI, AssetPropertyDetail objDb) { objDb.AssetId = objUI.AssetId; objDb.PropertyId = objUI.PropertyId; objDb.Value = objUI.Value; dbContext.SubmitChanges(); }
private void Delete(AssetPropertyDetail objUI) { if (objUI != null) { AssetPropertyDetail objDb = GetById(objUI.ID.ToString()); if (objDb != null) { dbContext.AssetPropertyDetails.DeleteOnSubmit(objDb); } } }