Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 3
0
        public void Delete(int id)
        {
            Supplier model = GetById(id);

            if (model != null)
            {
                _supplierDal.Delete(model);
            }
        }
Ejemplo n.º 4
0
        public void DeleteTest()
        {
            using (var trans = TransHelper.NewScope())
            {
                //  arrange

                //  act
                _supplierDal.Delete("A1");
            }
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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));
 }
Ejemplo n.º 10
0
 public void DeleteSupplier(int id)
 {
     supplierDal.Delete(id);
 }
Ejemplo n.º 11
0
 public void Delete(int supplierId)
 {
     _supplierDal.Delete(_supplierDal.Get(x => x.SupplierID == supplierId));
 }
Ejemplo n.º 12
0
 public void Delete(Supplier supplier)
 {
     _supplierDal.Delete(supplier);
 }