private void TestFinish(PIKCV.COM.EnumDB.TestTypeCode TestTypeCode, DataTable dtResults) { if (PIKCV.BUS.Test.SaveUserTestResults(this.smUserID, TestTypeCode, dtResults)) { Response.Write("<script>alert('Testi yaptýðýnýz için teþekkür ederiz, test sonuçlarýnýza test sonuçlarý ekranýndan ulaþabilirsiniz.'); window.close(); window.opener.location.href='Pikcv.aspx?Pik=Employee-Membership-TestResults';</script>"); } else { Response.Write("<script>alert('!! Bilgileriniz KAYDEDÝLMEDÝ.')</script>"); } }
//Kullanýcý için Test Oluþtur public static DataTable GetRandomTest(PIKCV.COM.EnumDB.TestTypeCode TestTypeCode) { try { PIKCV.DAL.TestQuestions obj = new PIKCV.DAL.TestQuestions(); return(obj.GetRandomTest((int)TestTypeCode)); } catch (Exception) { throw; } return(null); }
//Test skorunu getir public static DataTable GetTestScore(PIKCV.COM.EnumDB.TestTypeCode TestTypeCode, int UserID, PIKCV.COM.EnumDB.LanguageID LanguageID, PIKCV.COM.EnumDB.EmployeeTypes EmployeeTypeCode) { try { PIKCV.DAL.TestAnswers obj = new PIKCV.DAL.TestAnswers(); return(obj.GetTestScore((int)TestTypeCode, UserID, (int)LanguageID, (int)EmployeeTypeCode)); } catch (Exception) { throw; } return(null); }
public static bool SaveUserTestResults(int UserID, PIKCV.COM.EnumDB.TestTypeCode TestTypeCode, DataTable dtResults) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); PIKCV.DAL.UserTestResults obj = new PIKCV.DAL.UserTestResults(); obj.Where.UserID.Value = UserID; obj.Query.Load(); if (!obj.EOF) { return(false); } try { Tran.BeginTransaction(); obj = new PIKCV.DAL.UserTestResults(); PIKCV.DAL.UserCVs objUserCV = new PIKCV.DAL.UserCVs(); objUserCV.Where.UserID.Value = UserID; objUserCV.Query.Load(); objUserCV.TestMatDate = DateTime.Now; objUserCV.Save(); foreach (DataRow dr in dtResults.Rows) { obj.AddNew(); obj.TestTypeCode = (int)TestTypeCode; obj.UserID = UserID; obj.QuestionNo = Convert.ToInt32(dr["QuestionNo"]); obj.TestQuestionID = Convert.ToInt32(dr["TestQuestionID"]); obj.TestAnswerID = Convert.ToInt32(dr["TestAnswerID"]); obj.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
protected void Page_Load(object sender, EventArgs e) { if (Util.IsNumeric(Request.QueryString["TestType"])) { PIKCV.COM.EnumDB.TestTypeCode TestType = (PIKCV.COM.EnumDB.TestTypeCode) int.Parse(Request.QueryString["TestType"].ToString()); string TestControl = "Test"; if (TestType == PIKCV.COM.EnumDB.TestTypeCode.Perfection) { TestControl = "TestPerfection"; } string ControlPath = "~/UserControls/Employee/MemberShip/Test/u" + TestControl + ".ascx"; try { Control objControl = new Control(); objControl = LoadControl(ControlPath); PH1.Controls.Clear(); PH1.Controls.Add(objControl); } catch (Exception) { } } }