コード例 #1
0
 /// <summary>
 /// delete product details
 /// </summary>
 public ActionResult Delete(int id)
 {
     try
     {
         string successMsg = TblProduct.Delete(id);
         if (successMsg == "")
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(Json(new object[] { false, successMsg }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         return(Json(new object[] { false, e.Message }));
     }
 }
コード例 #2
0
        public void Delete(int id)
        {
            string successMsg = TblProduct.Delete(id);

            Assert.AreEqual(successMsg, "");
        }