public bool removeSite(removeSiteDTO objSite) { bool res = false; SqlCommand SqlCmd = new SqlCommand("spDeleteSiteMaster"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@Id", objSite.Id); SqlCmd.Parameters.AddWithValue("@ActionBy", objSite.ActionBy); int result = _unitOfWork.DbLayer.ExecuteNonQuery(SqlCmd); if (result != Int32.MaxValue) { res = true; } return(res); }
public HttpResponseMessage removeSite(removeSiteDTO site) { HttpResponseMessage message; try { // CustomerSiteMappingDataAccessLayer dal = new CustomerSiteMappingDataAccessLayer(); var dynObj = new { result = _Customermapping.removeSite(site) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" }); ErrorLog.CreateErrorMessage(ex, "CustomerSiteMapping", "removeSite"); } return(message); }