public string UpdateInterviewMark(string infomation) { // Logs var log = new TmpLogServiceInfo { Time = DateTime.Now, Description = infomation, CallType = (int)CallType.UpdateInterviewMark, }; var input = JsonConvert.DeserializeObject <UpdateInterviewMark>(infomation); var result = CheckInputUpdateInterviewMark(input); if (result.Code == 0) { var info = TestResultRepository.TestHasMark(input.contactId); if (info.ContactId == 0) { TestResultRepository.InsertInterviewMark(input.contactId, input.smooth, input.vocabulary, input.grammar, input.rythm, input.speaking, info.LevelSpeakingId); } else { TestResultRepository.UpdateInterviewMark(input.contactId, input.smooth, input.vocabulary, input.grammar, input.rythm, input.speaking, info.LevelSpeakingId); } result.Code = 0; } var output = JsonConvert.SerializeObject(result); return(output); }
public string UpdateInterviewMark(string infomation) { // Logs var log = new TmpLogServiceInfo { Time = DateTime.Now, Description = infomation, CallType = (int)CallType.UpdateInterviewMark, }; try { var input = JsonConvert.DeserializeObject <UpdateInterviewMark>(infomation); var result = CheckInputUpdateInterviewMark(input); if (result.Code == 0) { TestResultRepository.InsertInterviewMark(input.contactId, input.smooth, input.vocabulary, input.grammar, input.rythm, input.speaking, input.levelSpeaking, input.Notes, input.agent_user); result.Code = 0; } var output = JsonConvert.SerializeObject(result); log.Description = result.Description + "_" + infomation; log.Status = result.Code; TmpLogServiceRepository.Create(log); return(output); } catch (Exception ex) { var result = new Result(); result.Code = 1; result.Description = "Hệ thống hiện tại bị lỗi, cập nhật điểm không thành công" + infomation; var output = JsonConvert.SerializeObject(result); log.Description = result.Description + "_" + infomation; log.Status = result.Code; TmpLogServiceRepository.Create(log); return(output); } }