public ActionResult DeleteProduct(int id)
{
bool success = false;
string msg = string.Empty;
if (Product.Exists(new Product.ExistCriteria(id)))
{
try
{
Product.DeleteProduct(id);
}
catch (Exception e)
{
success = false;
msg = e.Message;
}
success = !Product.Exists(new Product.ExistCriteria(id));
}
return this.Direct(new { success = success, responseText = msg });
}