public HttpResponseMessage UpdateRequirementDetails(RequirementDetailsUpdateDTO objRequirement) { HttpResponseMessage message; try { // RequirementDetailsDataAccessLayer dal = new RequirementDetailsDataAccessLayer(); var dynObj = new { result = _requirment.UpdateRequirementDetails(objRequirement) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Somthing wrong,try Again!" }); ErrorLog.CreateErrorMessage(ex, "RequirementDetails", "UpdateRequirementDetails"); } return(message); }
//---Update Data-- public bool UpdateRequirementDetails(RequirementDetailsUpdateDTO objRquirement) { bool res = false; SqlCommand SqlCmd = new SqlCommand("spUpdateRequirementDetails"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@@ClientId", objRquirement.ClientId); SqlCmd.Parameters.AddWithValue("@Designation", objRquirement.Designation); SqlCmd.Parameters.AddWithValue("@RatePerEmployee", objRquirement.RatePerEmployee); SqlCmd.Parameters.AddWithValue("@EmployeeCount", objRquirement.EmployeeCount); SqlCmd.Parameters.AddWithValue("@ModifiedBy", objRquirement.ModifiedBy); SqlCmd.Parameters.AddWithValue("@Service", objRquirement.Service); int result = new DbLayer().ExecuteNonQuery(SqlCmd); if (result != Int32.MaxValue) { res = true; } return(res); }