public void Delete(AddHalqa entity) { tbl_AddHalqa AddHalqaData = new tbl_AddHalqa(entity); using (System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope()) { if (entity.Id != null && entity.Id != 0) { _tbl_AddHalqa.Delete(AddHalqaData.Id); } scope.Complete(); } }
public int SaveHalqa(AddHalqa model) { tbl_AddHalqa _tbl_addHalqa = new tbl_AddHalqa(model); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' if (model.Id != null && model.Id != 0) #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' { _tbl_addHalqa.Status = true; _tbl_AddHalqa.Update(_tbl_addHalqa); } else { _tbl_addHalqa.CreatedBy = 1; _tbl_addHalqa.CreatedDate = System.DateTime.Now; _tbl_addHalqa.Status = true; _tbl_addHalqa = _tbl_AddHalqa.Insert(_tbl_addHalqa); } return(_tbl_addHalqa.Id); }