//Api cập nhật lại chỉ tiêu cho list user thuộc nhóm được phân bổ public ResponseForm <string> UpdateTableAgentTarget(UpdateAgentTargetDto input) { try { DynamicParameters param = new DynamicParameters(); string sql = "UPDATE AGENT_TARGET SET " + "TOTAL_NUM = @TOTAL_NUM, " + "AGREE_NUM = @AGREE_NUM, " + "REACTIVE_NUM = @REACTIVE_NUM, " + "CONNECTED_NUM = @CONNECTED_NUM " + "Where TEAM_TARGET_ID = @TEAM_TARGET_ID "; param.Add("@TOTAL_NUM", input.TOTAL_NUM); param.Add("@AGREE_NUM", input.AGREE_NUM); param.Add("@REACTIVE_NUM", input.REACTIVE_NUM); param.Add("@CONNECTED_NUM", input.CONNECTED_NUM); param.Add("@TEAM_TARGET_ID", input.TEAM_TARGET_ID); DapperORM.Execute(sql, param); return(new ResponseForm <string>(input.TEAM_TARGET_ID)); } catch (Exception ex) { return(new ResponseForm <string>(input.TEAM_TARGET_ID, ex.Message, 600)); } }
//API update RectiveNum public ResponseForm <string> UpdateReactiveNumAgentTarget(UpdateAgentTargetDto input) { try { DynamicParameters param = new DynamicParameters(); string sql = "UPDATE AGENT_TARGET SET " + "REACTIVE_NUM = @REACTIVE_NUM, " + "Where ID = @ID "; param.Add("@ID", input.ID); param.Add("@REACTIVE_NUM", input.REACTIVE_NUM); DapperORM.Execute(sql, param); return(new ResponseForm <string>(input.ID)); } catch (Exception ex) { return(new ResponseForm <string>(input.ID, ex.Message, 600)); } }
public IActionResult UpdateReactiveNumAgentTarget(UpdateAgentTargetDto input) { return(Ok(_teamTargetRepository.UpdateReactiveNumAgentTarget(input))); }