public HttpResponseMessage UpdateShiftMapping(ShiftMappingUpdateDTO shiftmapping) { HttpResponseMessage message; try { // ShiftMappingDataAccessLayer dal = new ShiftMappingDataAccessLayer(); var dynObj = new { result = _Shift.UpdateShiftMapping(shiftmapping) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Somthing wrong,try Again!" }); ErrorLog.CreateErrorMessage(ex, "ShiftMapping", "UpdateShiftMapping"); } return(message); }
public bool UpdateShiftMapping(ShiftMappingUpdateDTO shiftmapping) { bool res = false; SqlCommand SqlCmd = new SqlCommand("spUpdateShiftMapping"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@MappingId", shiftmapping.MappingId); SqlCmd.Parameters.AddWithValue("@ContractId", shiftmapping.ContractId); SqlCmd.Parameters.AddWithValue("@ShiftId", shiftmapping.ShiftId); SqlCmd.Parameters.AddWithValue("@StartTime", shiftmapping.StartTime); SqlCmd.Parameters.AddWithValue("@EndTime", shiftmapping.EndTime); SqlCmd.Parameters.AddWithValue("@ModifiedBy", shiftmapping.ModifiedBy); SqlCmd.Parameters.AddWithValue("@Active", shiftmapping.Active); int result = new DbLayer().ExecuteNonQuery(SqlCmd); if (result != Int32.MaxValue) { res = true; } return(res); }