public void DeleteTest()
        {
            SupplierDAL dal = new SupplierDAL();
            Supplier    s   = new Supplier();

            s.SupplierID = "2";
            Assert.IsTrue(dal.Delete(s));
            Assert.IsNull(dal.FindByID("2"));

            s.SupplierID = "6";
            Assert.IsFalse(dal.Delete(s));
        }
Exemple #2
0
        //deleta os dados de um dado fornecedor na tabela
        public Response Delete(Supplier supplier)
        {
            Response resultDelete = _supplierDAL.Delete(supplier);

            if (!resultDelete.Success)
            {
                return(resultDelete);
            }

            return(Response.CreateSuccess("Fornecedor removido com sucesso!"));
        }
Exemple #3
0
        public void DeleteTest()
        {
            Supplier s = new Supplier();

            s.SupplierID = "123";
            SupplierDAL target = new SupplierDAL();

            bool atual    = target.Delete(s);        //实际的结果
            bool expected = true;                    //预期的结果

            Assert.AreEqual(expected, atual);        //断言判等


            //测试无效的
            s.SupplierID = "123";

            atual    = target.Delete(s);          //实际的结果
            expected = false;                     //预期的结果

            Assert.AreEqual(expected, atual);     //断言判等
        }
 static public bool Destory(List <int> list, out string msg)
 {
     if (list == null || list.Count == 0)
     {
         msg = "没有记录需要销毁";
         return(false);
     }
     for (int i = 0; i < list.Count; i++)
     {
         if (!SupplierDAL.Delete(list[i], out msg))
         {
             return(false);
         }
     }
     msg = "";
     return(true);
 }
Exemple #5
0
 public Supplier Delete(long id)
 {
     return(supplierDAL.Delete(id));
 }
Exemple #6
0
 public Supplier Delete(long id)
 {
     return(dal.Delete(id));
 }
Exemple #7
0
 public bool Delete(Supplier o)
 {
     return(sDAL.Delete(o));
 }
 public int Delete(Supplier supplier)
 {
     return(supplierDAL.Delete(supplier.ID));
 }