private void ValidateBeforeSubmit() { DTO.ResponseService <DTO.SummaryReceiveApplicant> res = new DTO.ResponseService <DTO.SummaryReceiveApplicant>(); res.DataResponse = (DTO.SummaryReceiveApplicant)Session["SummaryReceiveApplicant"]; List <DTO.ApplicantTemp> lst = new List <ApplicantTemp>(); res.DataResponse.ReceiveApplicantDetails.ToList().ForEach(x => { DTO.ApplicantTemp app = new ApplicantTemp(); app.APPLICANT_CODE = x.APPLICANT_CODE; app.TESTING_NO = x.TESTING_NO; app.TESTING_DATE = x.TESTING_DATE; app.EXAM_PLACE_CODE = x.EXAM_PLACE_CODE; app.APPLY_DATE = DateTime.Today; app.INSUR_COMP_CODE = x.INSUR_COMP_CODE; app.USER_ID = base.UserId; app.ID_CARD_NO = base.IdCard; app.APPLY_DATE = x.APPLY_DATE; //app.RUN_NO = Convert.ToString(x + 1); lst.Add(app); }); ApplicantBiz biz = new ApplicantBiz(); var checkBeforeSubmit = biz.ValidateApplicantSingleBeforeSubmit(lst); if (checkBeforeSubmit.ResultMessage == true) { ModalPopupExtenderListExam.Show(); } else { ImportInsertMode(); } }
private void ImportInsertMode() { BLL.ApplicantBiz biz = new BLL.ApplicantBiz(); ApplicantTemp app = new ApplicantTemp(); var result = biz.ApplicantGroupUploadToSubmit(hdfGroupID.Value, base.UserProfile); if (result.ErrorMsg == null) { string strResult = result.DataResponse; this.MasterSite.ModelSuccess.ShowMessageSuccess = Resources.infoGroupApplicantDetail_001; this.MasterSite.ModelSuccess.ShowModalSuccess(); pnlImportFile.Visible = false; CleanData(); ClearControlSingle(); } else { var errorMsg = result.ErrorMsg; this.MasterSite.ModelError.Visible = true; ReBindDatainGrid(hdfGroupID.Value); this.MasterSite.ModelError.ShowMessageError = result.ErrorMsg; this.MasterSite.ModelError.ShowModalError(); } }
public void InsertSingleApplicantTest() { ApplicantService target = new ApplicantService(); // TODO: Initialize to an appropriate value List <ApplicantTemp> app = new List <ApplicantTemp>(); // TODO: Initialize to an appropriate value //List<string> testNo = new List<string>(); // TODO: Initialize to an appropriate value string[] testNo = new string[] { "570247", "570246", "570245", "570244" }; DateTime[] Edate = new DateTime[] { Convert.ToDateTime("16/06/2557"), Convert.ToDateTime("26/06/2557"), Convert.ToDateTime("25/06/2557"), Convert.ToDateTime("14/06/2557") }; string[] examP = new string[] { "10111", "10224", "10224", "10224" }; int xx = 4; for (int i = 0; i < xx; i++) { ApplicantTemp ent = new ApplicantTemp(); //DTO.ApplicantTemp ent = new ApplicantTemp(); ent.TESTING_NO = testNo[i]; ent.TESTING_DATE = Edate[i]; ent.EXAM_PLACE_CODE = examP[i]; ent.APPLY_DATE = DateTime.Today; ent.INSUR_COMP_CODE = "1006"; ent.USER_ID = "131101133556905"; ent.ID_CARD_NO = "7303043711071"; ent.RUN_NO = Convert.ToString(i + 1); app.Add(ent); } string userId = "131101133556905"; // TODO: Initialize to an appropriate value ResponseService <string> expected = new ResponseService <string>(); // TODO: Initialize to an appropriate value ResponseService <string> actual; actual = target.InsertSingleApplicant(app, userId); Assert.AreEqual("999999570500000865", actual.DataResponse); Assert.Inconclusive("Verify the correctness of this test method."); }
public void UpdateApplicantGroupUploadTest() { IApplicantService target = CreateIApplicantService(); // TODO: Initialize to an appropriate value ApplicantTemp exam = null; // TODO: Initialize to an appropriate value ResponseMessage <bool> expected = null; // TODO: Initialize to an appropriate value ResponseMessage <bool> actual; actual = target.UpdateApplicantGroupUpload(exam); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
private void SaveListExam() { string group = string.Empty; ApplicantBiz biz = new ApplicantBiz(); string strAmount = biz.GetQuantityBillPerPageByConfig(); if (ListApplicant.Count != 0 && ListApplicant.Count <= Convert.ToInt32(strAmount)) { List <DTO.ApplicantTemp> lst = new List <ApplicantTemp>(); for (int i = 0; i < ListApplicant.Count; i++) { DTO.ApplicantTemp app = new ApplicantTemp(); app.TESTING_NO = ListApplicant[i].ExamNumber; app.TESTING_DATE = ListApplicant[i].ExamDate; app.EXAM_PLACE_CODE = ListApplicant[i].ExamPlaceCode; app.APPLY_DATE = DateTime.Today; app.INSUR_COMP_CODE = ListApplicant[i].InSurCompCode; app.USER_ID = UserProfile.Id; // base.UserId; 140324110012352 app.ID_CARD_NO = UserProfile.IdCard; // base.IdCard; 4199682095940 app.APPLY_DATE = ListApplicant[i].ApplyDate; app.TEST_TIME_CODE = ListApplicant[i].TestTimeCode; app.RUN_NO = Convert.ToString(i + 1); lst.Add(app); } string passGroup = string.Empty; //Check // var checkBeforeSubmit = biz.GeneralValidateApplicantSingleBeforeSubmit(lst); //if (checkBeforeSubmit.ResultMessage == true) //{ // UCModalError1.ShowMessageError = "รอบสอบที่คุณเลือกในรายการมีรายการที่คุณได้สมัครสอบแล้ว"; // UCModalError1.ShowModalError(); //} // //else //{ var res = biz.InsertSingleApplicant(lst, base.UserId); if (res.IsError) { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } else { ListApplicant = new List <AddApplicant>(); this.ModalListExam.Hide(); Session["lstApplicant"] = null; UCModalSuccess1.ShowMessageSuccess = SysMessage.SuccessInsertApplicant; UCModalSuccess1.ShowModalSuccess(); group = res.DataResponse; passGroup = group + " " + base.UserId; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopupSingle('" + passGroup + "')", true); } //} } else { UCModalError1.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการที่สอบ"; UCModalError1.ShowModalError(); ModalListExam.Show(); } }