public void Delete_ValidSupplier_ShouldRemoveSupplierViaContext() { supplierDal.Delete(supplierId); suppliers.Verify(s => s.Remove(It.IsAny <SqlSupplier>()), Times.Once); context.Verify(c => c.SaveChanges(), Times.Once); }
public IResult Delete(Supplier supplier) { var result = _supplierDal.Get(s => s.Id == supplier.Id); _supplierDal.Delete(result); return(new SuccessResult(Messages.Suppliers.Delete(supplier.CompanyName))); }
public void Delete(int id) { Supplier model = GetById(id); if (model != null) { _supplierDal.Delete(model); } }
public void DeleteTest() { using (var trans = TransHelper.NewScope()) { // arrange // act _supplierDal.Delete("A1"); } }
public string Delete(int id) { Supplier deleteSupplier = supplierDal.Get(p => p.Id == id); supplierDal.Delete(deleteSupplier); JObject jsonObject = new JObject(); jsonObject.Add("Status", "success"); jsonObject.Add("ErrorMessage", "Kayıt başarıyla silindi."); JArray array = new JArray(); array.Add(jsonObject); return(JsonConvert.SerializeObject(array)); }
public bool Delete(int id) { var deleteObject = _supplierDal.GetOne(x => x.SupplierID == id); if (deleteObject != null) { bool result = _supplierDal.Delete(deleteObject); if (result) { return(true); } return(false); } return(false); }
public SupplierModel Save(SupplierModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } // validasi nama if (model.SupplierName.Trim() == "") { throw new ArgumentException("SupplierName kosong"); } // simpan using (var trans = TransHelper.NewScope()) { if (model.SupplierID.Trim() == "") { model.SupplierID = GenNewID(); } _supplierDal.Delete(model.SupplierID); _supplierDal.Insert(model); // update pihak kedua _pihakKeduaDal.Delete(model.SupplierID); var pihakKedua = new PihakKeduaModel { PihakKeduaID = model.SupplierID, PihakKeduaName = model.SupplierName }; _pihakKeduaDal.Insert(pihakKedua); trans.Complete(); } return(model); }
public void Delete(Supplier entity, bool realDelete = true) { _supplierDal.Delete(entity, realDelete); }
public IResult Delete(Supplier supplier) { _supplierDal.Delete(supplier); return(new SuccessResult(Messages.SupplierDeleted)); }
public void DeleteSupplier(int id) { supplierDal.Delete(id); }
public void Delete(int supplierId) { _supplierDal.Delete(_supplierDal.Get(x => x.SupplierID == supplierId)); }
public void Delete(Supplier supplier) { _supplierDal.Delete(supplier); }