tags:

views:

25

answers:

1

I dont know if it is a SqlException or not but I will show you the source code:

//the update method 

public int Update(T item) { int result = 0; var query = BuildUpdateQuery(item); if (query != null) result = query.Execute(); return result; }  

/////////////////////////////////////////////////////////////
public ActionResult Edit(Employee item) { if(ModelState.IsValid) { string resultMessage = ""; 
try 
{ _repository.Update(item); resultMessage = item.DescriptorValue() + " updated!"; } 

catch(Exception x) 
{ //edit this to return a message resultMessage = "ERROR: "+ item.DescriptorValue() + " failed: "+x.Message; }
 //if this is an Ajax request - just send back a message if (Request.IsAjaxRequest()) 
{ return Content(resultMessage); } 
else { return RedirectToAction("Index"); } } 
else { return View(); } }  
/////////////////////////////////////////////////////////////////
A: 
  1. What do you want to know?

  2. You have commented out the if clause asking if this is an Ajax Request. You probably want that on the next row...

Tomas Lycken