private void ManuallyAssessCheckBox_CheckChanged(object sender, EventArgs e) { if (((CheckBox)sender).Checked) { StatusText.Text = "Initialising assessments plugin"; if (AWBForm.TheSession.Editor.IsActive) { AWBForm.Stop(Constants.AWBPluginName); } if (_showManualAssessmentsInstructions) { AssessmentsInstructionsDialog dialog = new AssessmentsInstructionsDialog(); _showManualAssessmentsInstructions = dialog.ShowDialog() != DialogResult.Yes; } _assessmentsObject = new Assessments(_pluginSettings); DefaultStatusText(); } else { _assessmentsObject.Dispose(); _assessmentsObject = null; } }
async Task ExecuteLoadAssessmentsCommand() { if (IsBusy) { return; } IsBusy = true; try { Assessments.Clear(); var assessments = await App.AssesmentDB.GetItemsAsync(); foreach (var assessment in assessments) { Assessments.Add(assessment); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
private async Task OpenForEdit(string assessmentId) { var assessment = Assessments.First(u => u.Id == assessmentId); AssessmentItem = assessment; ModalForm.ShowModal(); }
public void BuildAssessmentListViewModel_GivenAssessments_ModelShouldBeMapped() { var assessmentsList = new List <Assessment> { new Assessment() { DateAssessmentStarted = new DateTime(2016, 1, 1), Stage1DecisionToBeMade = "decision1", AssessorName = "assessor1", DateAssessmentEnded = _dateTimeProvider.Now, Status = new Status() { Description = "complete" }, Patient = new Patient() { ClinicalSystemId = "1" }, RoleId = (int)RoleIdEnum.Assessor }, new Assessment() { DateAssessmentStarted = new DateTime(2017, 1, 1), Stage1DecisionToBeMade = "decision2", AssessorName = "assessor2", Status = new Status() { Description = "progress" }, Patient = new Patient() { ClinicalSystemId = "2" }, RoleId = (int)RoleIdEnum.DecisionMaker } }; var assessment = new Assessments() { Items = assessmentsList }; var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessment); result.Items.Should().HaveCount(2); result.Items.ElementAt(0).Patient.ClinicalSystemId.Should().Be("1"); result.Items.ElementAt(0).Stage1DecisionToBeMade.Should().Be("decision1"); result.Items.ElementAt(0).DateAssessmentStarted.ShouldBeEquivalentTo(new DateTime(2016, 1, 1)); result.Items.ElementAt(0).AssessorName.Should().Be("assessor1"); result.Items.ElementAt(0).Status.Description.Should().Be("complete"); result.Items.ElementAt(0).RoleId.Should().Be((int)RoleIdEnum.Assessor); result.Items.ElementAt(1).Patient.ClinicalSystemId.Should().Be("2"); result.Items.ElementAt(1).Stage1DecisionToBeMade.Should().Be("decision2"); result.Items.ElementAt(1).DateAssessmentStarted.ShouldBeEquivalentTo(new DateTime(2017, 1, 1)); result.Items.ElementAt(1).AssessorName.Should().Be("assessor2"); result.Items.ElementAt(1).Status.Description.Should().Be("progress"); result.Items.ElementAt(1).RoleId.Should().Be((int)RoleIdEnum.DecisionMaker); }
public ActionResult UpdateAssesmentName(Assessments Assessment) { if (ModelState.IsValid) { db.Entry(Assessment).State = EntityState.Modified; db.SaveChanges(); return(Json(Assessment, JsonRequestBehavior.AllowGet)); } return(Json(Assessment, JsonRequestBehavior.AllowGet)); }
public void BuildAssessmentListViewModel_GivenClinicalSystemIdDescription_ClinicalSystemIdDescriptionPropertyShouldBeSet() { var assessments = new Assessments() { Items = A.Fake <IEnumerable <Assessment> >() }; var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessments); result.ClinicalIdDescription.Should().Be(Description); }
public void IndexGET_GivenPatientId_AssessmentsBuilderShouldBeCalled() { var patientId = Guid.NewGuid(); var assessments = new Assessments(); A.CallTo(() => _assessmentHelper.GetAssessmentsByPatient(A <Guid> ._)).Returns(assessments); _assessmentController.Index(patientId); A.CallTo(() => _assessmentBuilder.BuildAssessmentListViewModel(patientId, assessments)).MustHaveHappened(Repeated.Exactly.Once); }
public ActionResult CreateAssesment(String AssementName) { Assessments Sect = new Assessments(); Sect.CompanyID = 5; Sect.UserID = "ae465423f2hgef2r3721r"; Sect.AssementName = AssementName; Sect.AssessmentID = 0; db.Assessments.Add(Sect); db.SaveChanges(); ViewBag.AssesmentID = Sect.AssessmentID; return(Json(Sect.AssessmentID.ToString(), JsonRequestBehavior.AllowGet)); }
public async Task <IActionResult> Create(Assessments assessment) { if (!User.Identity.IsAuthenticated) { return(Unauthorized()); } if (!ModelState.IsValid) { return(BadRequest()); } await _assessmentsService.CreateAsync(assessment); return(Ok(assessment)); }
public ActionResult Create(Assessments assessment) { if (ModelState.IsValid) { using (OurDBContext db = new OurDBContext()) { db.assessmentList.Add(assessment); db.SaveChanges(); } ModelState.Clear(); ViewBag.Message = assessment.Name + "Assessment creation is done"; } return(View()); }
private async Task DeleteItem(bool shouldDelete) { if (shouldDelete) { await _assessmentService.DeleteAssesment(DeleteAssessmentId); Assessments = Assessments.Where(u => u.Id != DeleteAssessmentId).ToList(); RefreshAssessments(SearchText); DeleteAssessmentId = string.Empty; toastService.ShowSuccess("Assessment deleted successfully"); } }
protected override async Task OnInitializedAsync() { var response = await _assessmentService.GetAssesments(); if (response.isSuccessful) { Assessments = response.data.OrderByDescending(u => u.CreatedOn).ToList(); ClientAssessments = Assessments.ToList(); } else { Console.Write(response.message); } }
private void RefreshAssessments(string searchText) { if (!string.IsNullOrEmpty(searchText)) { ClientAssessments = Assessments.Where(u => u.Name.Contains(searchText, StringComparison.OrdinalIgnoreCase)).ToList(); StateHasChanged(); } else { ClientAssessments = Assessments.ToList(); StateHasChanged(); } }
public void CalcAndSetFinalAssessment() { //alternativeId, points ProjectAssessment result = new ProjectAssessment() { Items = new List <ProjectAssessmentItem>() }; foreach (var alternative in Alternatives) { var alternativeAssessments = Assessments .SelectMany(x => x.Items).Where(item => item.AlternativeId == alternative.AlternativeId) .ToDictionary(x => new { x.ExpertId, x.FactorId }, x => x.Points.Value).OrderBy(x => x.Key.ExpertId).ThenBy(x => x.Key.FactorId); List <decimal> levels = GetLevels(); Dictionary <decimal, decimal[]> levelPoints = new Dictionary <decimal, decimal[]>(); for (int i = 0; i < levels.Count; i++) { var level = levels[i]; levelPoints.Add(level, new decimal[Factors.Count]); for (int j = 0; j < Factors.Count; j++) { var factor = Factors[j]; List <decimal> expertPointsForDecision = new List <decimal>(); foreach (var expert in Experts) { expertPointsForDecision.Add(alternativeAssessments.Single(x => x.Key.ExpertId == expert.UserId && x.Key.FactorId == factor.FactorId).Value); } var aggregatedDecisionForLevel = expertPointsForDecision.Where(x => x >= level).Count(); levelPoints[level][j] = aggregatedDecisionForLevel; } } for (int i = 0; i < Factors.Count; i++) { result.Items.Add(new ProjectAssessmentItem() { AlternativeId = alternative.AlternativeId, FactorId = Factors[i].FactorId, Points = levelPoints.Select(x => x.Value[i] / Experts.Count).Average() }); } } this.FinalAssessment = result; }
private async Task HandleSubmit(AssessmentItem model) { AssessmentResponseModel response; if (string.IsNullOrEmpty(model.Id)) { response = await _assessmentService.CreateAssessment(model); } else { response = await _assessmentService.UpdateAssessment(model.Id, model); } if (response.isSuccessful) { var assessmentItem = response.data; if (string.IsNullOrEmpty(model.Id)) { Assessments = Assessments.Prepend(assessmentItem).ToList(); toastService.ShowSuccess("Assessment added successfully"); } else { var item = Assessments.First(u => u.Id == model.Id); item.Duration = assessmentItem.Duration; item.Instructions = assessmentItem.Instructions; item.Name = assessmentItem.Name; toastService.ShowSuccess("Assessment updated successfully"); } RefreshAssessments(SearchText); ModalForm.HideModal(); StateHasChanged(); } else { Console.WriteLine(response.message); } }
public Assessments GetAssessmentDetails(RequestBase request, int assessmentId) { Assessments response = new Assessments(); try { SqlSvrDAL dal = new SqlSvrDAL(request.ClientInfo); response = dal.GetAssessmentDetails(assessmentId); } catch (Exception ex) { //LogHelper.AddLog("AssessmentController", ex.Message, ex.StackTrace, "HCL.Academy.Service", request.ClientInfo.emailId); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); } return(response); }
public void BuildAssessmentListViewModel_GivenAssessmentIsNotComplete_CanViewReviseBeFalse() { var assessments = new Assessments() { Items = new List <Assessment>() { new Assessment() { Stage1DecisionToBeMade = Stage1DecisionToBeMade, StatusId = (int)AssessmentStatusEnum.InProgress } } }; var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessments); result.Items.First().CanRevise.Should().BeFalse(); }
public AssessmentListViewModel BuildAssessmentListViewModel(Guid patientId, Assessments assessments) { if (assessments == null) { throw new ArgumentNullException("assessments"); } if (patientId == Guid.Empty) { throw new ArgumentException("patientId"); } var assessmentViewModels = new List <AssessmentViewModel>(); foreach (var assessment in assessments.Items) { var assessmentViewModel = Mapper.DynamicMap <Assessment, AssessmentViewModel>(assessment); var statusViewModel = Mapper.DynamicMap <Status, StatusViewModel>(assessment.Status); assessmentViewModel.Status = statusViewModel; assessmentViewModel.Stage1DecisionToBeMade = assessmentViewModel.Stage1DecisionToBeMade.Length > 50 ? assessmentViewModel.Stage1DecisionToBeMade.Substring(0, 50) : assessmentViewModel.Stage1DecisionToBeMade; SetCanViewPdfProperty(assessment, assessmentViewModel); SetCanRestartProperty(assessment, assessmentViewModel); SetCanReviseProperty(assessment, assessmentViewModel); assessmentViewModels.Add(assessmentViewModel); } var viewModel = new AssessmentListViewModel { Items = assessmentViewModels, PatientId = patientId, ClinicalIdDescription = _clinicalSystemIdDescriptionProvider.GetDescription() }; return(viewModel); }
public void BuildAssessmentListViewModel_GivenUserIsNotAssessor_CanRestartPropertyShouldBeFalse() { var assessments = new Assessments() { Items = new List <Assessment>() { new Assessment() { Stage1DecisionToBeMade = Stage1DecisionToBeMade, AssessorDomainName = AssessorDomainName } } }; A.CallTo(() => _userPrincipalProvider.CurrentUserName).Returns("name1"); var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessments); result.Items.First().CanRestart.Should().BeFalse(); }
public async Task <IActionResult> Update(string id, Assessments assessment) { if (!User.Identity.IsAuthenticated) { return(Unauthorized()); } if (!ModelState.IsValid) { return(BadRequest()); } var queriedAssessment = await _assessmentsService.GetByIdAsync(id); if (queriedAssessment == null) { return(NotFound()); } await _assessmentsService.UpdateAsync(id, assessment); return(NoContent()); }
public void BuildAssessmentListViewModel_GivenAssessmentIsComplete_CanRestartPropertyShouldBeFalse() { var assessments = new Assessments() { Items = new List <Assessment>() { new Assessment() { Stage1DecisionToBeMade = Stage1DecisionToBeMade, AssessorDomainName = AssessorDomainName, StatusId = (int)AssessmentStatusEnum.Complete } } }; A.CallTo(() => _userRoleProvider.CurrentUserInAdministratorRole()).Returns(true); A.CallTo(() => _userPrincipalProvider.CurrentUserName).Returns(AssessorDomainName); var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessments); result.Items.First().CanRestart.Should().BeFalse(); }
public void BuildAssessmentListViewModel_GivenAssessmentIsCompleteAndAssessorIsNotAssignedAssorButIsAdmin_CanViewPdfShouldBeTrue() { var assessments = new Assessments() { Items = new List <Assessment>() { new Assessment() { Stage1DecisionToBeMade = Stage1DecisionToBeMade, StatusId = (int)AssessmentStatusEnum.Complete, AssessorDomainName = AssessorDomainName } } }; A.CallTo(() => _userRoleProvider.CurrentUserInAdministratorRole()).Returns(true); A.CallTo(() => _userPrincipalProvider.CurrentUserName).Returns("name1"); var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessments); result.Items.First().CanViewPdf.Should().BeTrue(); }
private void AddNewClass() { var currentDate = DateTime.Now; var dialog = new DateTimeDialogVM("Пожалуйста, выберите дату", currentDate); bool?result = DialogService.I.ShowDialog(dialog); if (result.HasValue) { if (result.Value) { currentDate = dialog.PickedDate; var columnName = currentDate.ToString("dd MMM"); try { Table.Columns.Add(columnName, typeof(Journal)); } catch { MessageBox.Show("Данная дата уже есть в таблице.", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Warning); // TODO: нумерация одинаковых дат в таблице return; } foreach (DataRow row in Table.Rows) { var journal = new Journal() { Date = currentDate, Student = row[0] as Student, Assessment = Assessments.First(x => x.Title == ""), ID = 0 }; row[columnName] = journal; } HasChanges = true; Table = Table.Copy(); // чтобы обновить UI. Не самое эффективное решение, но зато VM по прежнему ничего не знает о V } } }
public void BuildAssessmentListViewModel_GivenAssessmentsWithDecisionOver50Chars_Only50CharsShouldBeDisplayed() { var assessmentsList = new List <Assessment> { new Assessment() { Stage1DecisionToBeMade = "12345678901234567890123456789012345678901234567890111" }, new Assessment() { Stage1DecisionToBeMade = "123" }, }; var assessment = new Assessments() { Items = assessmentsList }; var result = _builder.BuildAssessmentListViewModel(Guid.NewGuid(), assessment); result.Items.ElementAt(0).Stage1DecisionToBeMade.Should().Be("12345678901234567890123456789012345678901234567890"); result.Items.ElementAt(1).Stage1DecisionToBeMade.Should().Be("123"); }
void uscEventList_SelectEvent(object sender, Assessments.UserControls.SelectEventArgs args) { LoadAndShowQuestions(args.StaffUsername, args.EventDateId); }
public void SetAssessments(Assessments assessments) { Assessments = Assessments ?? assessments; }
private void AddAssessBth_Click(object sender, RoutedEventArgs e) { if (AssessID == 0 && AssessmentTitleTxt.Text.Trim() != "") { try { Assessments ass = new Assessments(); ass.AssessTitle = AssessmentTitleTxt.Text; ass.CourseID = this.course.CourseID; if (MaxScoreTxt.Text.Trim() != ""){ ass.AssessMaxScore = Int32.Parse(MaxScoreTxt.Text); } else { ass.AssessMaxScore = 100; } CourseData.db.Assessments.InsertOnSubmit(ass); CourseData.db.SubmitChanges(); Clear(); /* * Add Student To Assessment and will be insert to Score Table * */ var student = (from s in CourseData.db.Registers where s.Courses == this.course select s.Students); Assessments lass = (from a in CourseData.db.Assessments where a.AssessTitle == ass.AssessTitle select a).FirstOrDefault(); foreach (Students s in student) { Scores score = new Scores(); score.StudentID = s.StudentID; score.AssessID = lass.AssessID; score.Score = 0; CourseData.db.Scores.InsertOnSubmit(score); } CourseData.db.SubmitChanges(); LoadData(); GroupField.Visibility = Visibility.Hidden; MessageBox.Show("Added Group"); AssessList.IsEnabled = true; AddButtun.IsEnabled = true; DeleteButton.IsEnabled = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } else { MessageBox.Show("Assessment Title Can't Empty"); } }
public async Task UpdateAsync(string id, Assessments assessment) { await _assessments.ReplaceOneAsync(a => a.Id == id, assessment); }
public ActionResult LoginVenture(FormCollection frmCollection) { Debug.WriteLine("* * * AccountController.Venture LoginVenture * * *"); try { UAS.DataDTO.LoginInfo loginInfo = new UAS.DataDTO.LoginInfo(); loginInfo.RememberMe = false; CookieData cookieData = UAS.Business.HttpFunctions.GetUserCookie(); if (cookieData.LoginID != null) { loginInfo.LoginID = cookieData.LoginID; loginInfo.RememberMe = true; } // * * * Need to use Cookie data if available. loginInfo.LoginID = frmCollection["userName"]; loginInfo.Password = frmCollection["pwrd"]; LoginStatus loginStatus = null; loginStatus = LoginVentureLogic(loginInfo); Debug.WriteLine("* * * AccountController LoginVenture next * * *"); string userName = String.Empty; if (loginStatus != null) { Debug.WriteLine("LoginStatus ErrorMessage: " + loginStatus.ErrorMessage); Debug.WriteLine("LoginStatus Status: " + loginStatus.Status); userName = loginStatus.FirstName + " " + loginStatus.LastName; Debug.WriteLine("LoginStatus Name: " + userName); // Debug.WriteLine("LoginStatus Permissions: " + loginStatus.PermissionSet); } else { Debug.WriteLine("loginStatus is NULL !!!"); throw new Exception("Invalid username or password."); } loginInfo.SessionData = Session.SessionID; if ((loginStatus.Status == 'A') && (loginStatus.UserID > 0) && // !string.IsNullOrEmpty(loginStatus.PermissionSet) (loginStatus.appGroupPermissions.Count > 0) ) { loginInfo.IsLoggedIn = true; SessionHelper.IsUserLoggedIn = true; SessionHelper.LoginInfo = loginInfo; SessionHelper.LoginStatus = loginStatus; } if (loginInfo.IsLoggedIn) { SessionHelper.SessionTotalTimeoutMinutes = Business.Timeout.GetTotalTimeoutMinutes(SessionHelper.LoginStatus.EnterpriseID); // return RedirectToAction("Index", "Home"); SessionHelper.Write("justLoggedIn", true); Assessments assmnts = new Assessments(formsRepo); assmnts.DeleteOldUploadedAssessments(); if (SessionHelper.Read <bool>("NoServer") == true) { return(RedirectToAction("Index", "Search")); } return(RedirectToAction("Index", "DataSync")); } SessionHelper.IsUserLoggedIn = false; ViewBag.ErrorMessage = loginStatus.ErrorMessage; } catch (Exception xcptn) { Debug.WriteLine("LoginVenture exception: " + xcptn.Message); ViewBag.ErrorMessage = xcptn.Message; } return(View("loginVenture")); }
public JsonResult AssessmentQuestions() { Assessments assessments = (Assessments)Session["StartAssessment"]; return(Json(assessments, JsonRequestBehavior.AllowGet)); }
public async Task <Assessments> CreateAsync(Assessments assessment) { await _assessments.InsertOneAsync(assessment); return(assessment); }
public HttpResponseMessage createAssessmentProcrasinator(AssessmentProcrasinator model) { Assessments assessment = new Assessments(); assessment.AssessmentTypeID = 3; assessment.AssessmentTitle = model.assessmentTitle; assessment.AssessmentDescription = model.assessmentDescription; assessment.LastUpdate = DateTime.Now; db.Assessments1.Add(assessment); db.SaveChanges(); int fk_assessmentID = int.Parse(db.Assessments1 .OrderByDescending(x => x.AssessmentID) .Select(x => x.AssessmentID).First().ToString()); AssessmentProcrasinators assessmentProcrasinator = new AssessmentProcrasinators(); assessmentProcrasinator.AssessmentID = fk_assessmentID; db.AssessmentProcrasinators1.Add(assessmentProcrasinator); db.SaveChanges(); int fk_assessmentProcrasinatorID = int.Parse(db.AssessmentProcrasinators1 .OrderByDescending(x => x.AssessmentProcrasinatorID) .Select(x => x.AssessmentProcrasinatorID).First().ToString()); foreach (var value in model.agreements) { Agreements agreement = new Agreements(); agreement.Agreement = value.agreement; agreement.AssessmentProcrasinatorID = fk_assessmentProcrasinatorID; db.Agreements1.Add(agreement); db.SaveChanges(); } foreach (var value in model.statementProcrasinators) { StatementProcrasinators statementProcrasinator = new StatementProcrasinators(); statementProcrasinator.AssessmentProcrasinatorID = fk_assessmentProcrasinatorID; statementProcrasinator.StatementProcrasinator = value.statementProcrasinator; db.StatementProcrasinators1.Add(statementProcrasinator); db.SaveChanges(); } foreach (var value in model.scoreProcrasinators) { ScoreProcrasinators scoreProcrasinator = new ScoreProcrasinators(); scoreProcrasinator.AssessmentProcrasinatorID = fk_assessmentProcrasinatorID; scoreProcrasinator.ScoreWord = value.scoreWord; scoreProcrasinator.StartValue = value.startValue; scoreProcrasinator.EndValue = value.endValue; db.ScoreProcrasinators1.Add(scoreProcrasinator); db.SaveChanges(); } try { var result = new HttpResponseMessage(HttpStatusCode.Accepted); result.Content = new StringContent(JsonConvert.SerializeObject(model)); result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); return(result); } catch { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
public HttpResponseMessage createAssessmentSensory(AssessmentSensory model) { Assessments assessment = new Assessments(); assessment.AssessmentTypeID = 2; assessment.AssessmentTitle = model.assessmentTitle; assessment.AssessmentDescription = model.assessmentDescription; assessment.LastUpdate = DateTime.Now; db.Assessments1.Add(assessment); db.SaveChanges(); int fk_assessmentID = int.Parse(db.Assessments1 .OrderByDescending(x => x.AssessmentID) .Select(x => x.AssessmentID).First().ToString()); AssessmentSensories assessmentSensory = new AssessmentSensories(); assessmentSensory.AssessmentID = fk_assessmentID; db.AssessmentSensories1.Add(assessmentSensory); db.SaveChanges(); int fk_assessmentSensoryID = int.Parse(db.AssessmentSensories1 .OrderByDescending(x => x.AssessmentSensoryID) .Select(x => x.AssessmentSensoryID).First().ToString()); foreach (var value in model.scoreSensories) { ScoreSensories scoreSensory = new ScoreSensories(); scoreSensory.AssessmentSensoryID = fk_assessmentSensoryID; scoreSensory.ScoreValue = value.scoreValue; scoreSensory.ScoreWord = value.scoreWord; db.ScoreSensories1.Add(scoreSensory); db.SaveChanges(); } foreach (var value in model.statementSensories) { StatementSensories statementSensory = new StatementSensories(); statementSensory.AssessmentSensoryID = fk_assessmentSensoryID; statementSensory.StatementSensory = value.statementSensory; // statementSensory.Sensory = value.sensory; db.StatementSensories1.Add(statementSensory); db.SaveChanges(); } try { var result = new HttpResponseMessage(HttpStatusCode.Accepted); result.Content = new StringContent(JsonConvert.SerializeObject(model)); result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); return(result); } catch { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
void uscTabs_OnSubmitAnswers(object sender, Assessments.UserControls.QuestionGroupTabs.SaveAnswersEventArgs args) { string sScript0 = string.Empty; List<AnswerPTA> answers = Save(args.Answers); // TODO: send to SAP then update database to indicate that is has been submitted string trxId = Request.QueryString["ID"].ToString(); string errorMessage = ""; EventDate ed = EventDate.GetById(EventDateId); TrainingEvent ev = TrainingEvent.GetById(ed.EventId); string supervisorusername = User.Identity.Name; List<AnswerBase> baseAnswers = Utility.ConvertListToParent<AnswerBase, AnswerPTA>(answers); List<QuestionGroup> questionGroups = QuestionGroups; AttachAnswersToQuestions(questionGroups, baseAnswers); if (SAPHeitechREQ.SendTrainingSAP(SAPHeitechREQ.executeMode.PostTraining, supervisorusername, StaffUsername,ev, ed.StartDate, ed.EndDate, ed.Id, ed.Provider, questionGroups, trxId, ref errorMessage)) { AnswerPTA.RegisterSubmitted(StaffUsername, EventDateId); uscStaffList.ShowStaff(); uscEventList.ShowEvents(null); uscEventList.Visible = false; uscTabs.Visible = false; //succeed sScript0 = "window.alert('Post-Training Assessment has been Submitted. ');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "OnSubmit-SUCCESS", sScript0, true); return; } //FAIL sScript0 = "window.alert('" + errorMessage + "');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "btnApproved_Click-SUCCESS", sScript0, true); return; }
void uscTabs_OnSaveAnswers(object sender, Assessments.UserControls.QuestionGroupTabs.SaveAnswersEventArgs args) { Save(args.Answers); LoadAndShowQuestions(StaffUsername, EventDateId); }
void uscStaffList_SelectStaff(object sender, Assessments.UserControls.SelectStaffEventArgs args) { uscEventList.ShowEvents(args.StaffUsername); uscTabs.Visible = false; }