protected void SubmitQuestions_Click(object sender, EventArgs e) { if (OptionA.Checked) { answercheck = "A"; } else if (OptionB.Checked) { answercheck = "B"; } else if (OptionC.Checked) { answercheck = "C"; } else if (OptionD.Checked) { answercheck = "D"; } else { answercheck = "N"; } UserBO ob = new UserBO(); ob.coursecode = Session["CourseSelected"].ToString(); clsBLL logicob = new clsBLL(); DataTable questiontable = logicob.QuestionTableCreatorBLL(ob); logicob.updateAnsweredBLL(rowno, answercheck, Session["CourseSelected"].ToString()); Session["questioncount"] = countofQuestions; Response.Redirect("UserPresentTestCalculus.aspx"); }
protected void Page_Load(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.coursecode = Session["AdminSelectedUserCourse"].ToString(); ob.userid = Session["AdminSelectedUser"].ToString(); clsBLL obj = new clsBLL(); List <string> mylist = obj.getScoreDetailsBLL(ob); DataTable questiontable = obj.QuestionTableCreatorBLL(ob); int countofQuestions = questiontable.Rows.Count; int a; try { a = Convert.ToInt32((Convert.ToDouble(mylist[3]) / countofQuestions) * 100); } catch { a = 0; } ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "draw(" + a + ")", true); userid.Text = mylist[0]; Coursecode.Text = mylist[1]; date.Text = mylist[2]; score.Text = "(" + mylist[3] + "/" + countofQuestions.ToString() + ")"; Percentage.Text = a.ToString(); status.Text = mylist[4]; }
protected void Page_Load(object sender, EventArgs e) { try { UserBO ob = new UserBO(); ob.coursecode = Session["selectedGrid"].ToString(); clsBLL obj = new clsBLL(); List <string> ListofDet = obj.CourseDetailsPageBLL(ob); Editor.Visible = false; Viewer.Visible = true; Deleted.Visible = false; CourseCodeDet.Text = ListofDet[0].ToString(); CourseDescriptionDet.Text = ListofDet[1].ToString(); descriptionmodified = CourseDescriptionDet.Text; SkillNameDet.Text = ListofDet[2].ToString(); skillmodified = SkillNameDet.Text; CourseDateDet.Text = ListofDet[3].ToString(); CourseTimeDet.Text = ListofDet[4].ToString(); CourseAddedByDet.Text = ListofDet[5].ToString(); OtherReferencesDet.Text = ListofDet[6].ToString(); } catch { Response.Redirect("LoginPage.aspx"); } }
protected void LoginButton_Click(object sender, EventArgs e) { UserBO ob1 = new UserBO(); ob1.userid = UserLogin.Text; ob1.password = PassLogin.Text; clsBLL ob2 = new clsBLL(); clsBLL ob3 = new clsBLL(); int result = ob2.VerifyLoginData(ob1); int typeuser = ob3.FindUserTypeBLL(ob1); if (result == 1) { StatusLogin.Text = "Login SuccessFul"; if (typeuser == 1) { Session["User"] = ob1.userid; Response.Redirect("AdminMainPage.aspx"); } else { Session["User"] = ob1.userid; Response.Redirect("UserMain.aspx"); } } else { StatusLogin.Text = "UnAuthorised Credentials"; } }
protected void AddSkill_Click(object sender, EventArgs e) { if (SkillBox.Text == "") { SkillBox.BackColor = Color.Red; } UserBO obj = new UserBO(); obj.skillName = SkillBox.Text; clsBLL obj1 = new clsBLL(); int result; int result1 = obj1.SkillVerifyBLL(obj); if (result1 == 0) { result = obj1.InsertSkillBLL(obj); if (result == 1) { StatusBar.Text = "Skill Added Successfully!!!"; Response.Write("<script>alert('Skill Added Successfully!!!');</script>"); Server.Transfer("AdminSkill.aspx"); } else { StatusBar.Text = "Skill not-Added!!!"; } } else { StatusBar.Text = "Skill You Entered Al-Ready Exists"; } }
protected void Add_Material_Click(object sender, EventArgs e) { UserBO ok = new UserBO(); ok.coursecode = coursecodemat.Text; clsBLL ok1 = new clsBLL(); int kira = ok1.verifycoursecodeBLL(ok); if (kira == 1) { if (uploadpdf() == true) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString2"].ConnectionString.ToString()); SqlCommand cmd = new SqlCommand("[Uploadpdf]", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@coursecode", coursecodemat.Text); cmd.Parameters.AddWithValue("@filename", Filenamenat.Text); cmd.Parameters.AddWithValue("@filelocation", FileLocation); con.Open(); cmd.ExecuteNonQuery(); coursecodemat.Text = ""; Filenamenat.Text = ""; Response.Redirect("AdminAddCourseMaterial.aspx"); } } else { Statusindicator.Text = "CourseCode does not exist"; } }
protected void UserSkillSearchResult_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = UserSkillSearchResult.Rows[rowIndex]; string skilluserselect = row.Cells[1].Text; UserBO ob = new UserBO(); ob.skillName = skilluserselect; clsBLL obj = new clsBLL(); if (obj.getCoursesofSkillBLL(ob).Rows.Count == 0) { StatusBar.Text = "no item found"; UserCourseDetailsView.DataSource = null; UserCourseDetailsView.DataBind(); } else { UserCourseDetailsView.DataSource = obj.getCoursesofSkillBLL(ob); UserCourseDetailsView.DataBind(); StatusBar.Text = ""; } } }
protected void SkillSearchButton_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.skillName = SkillSearch.Text; clsBLL ob1 = new clsBLL(); string skillList = ob1.SkillSearchBLL(ob); string[] sl; try { sl = skillList.Split(' '); } catch { sl = null; } if (sl.Length == 1 && sl[0] != "") { skillCard1.Text = sl[0]; skillCard2.Text = "none-Found"; skillCard3.Text = "none-Found"; } else { skillCard1.Text = "none-Found"; skillCard2.Text = "none-Found"; skillCard3.Text = "none-Found"; } }
protected void UserSkillSearchButton_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.skillName = UserSkillSearch.Text; clsBLL ob1 = new clsBLL(); UserSkillSearchResult.DataSource = ob1.SkillSearchTableBLL(ob); UserSkillSearchResult.DataBind(); }
protected void skillCardButton3_Click(object sender, EventArgs e) { UserBO obj = new UserBO(); obj.skillName = skillCard3.Text.Trim(); clsBLL dt = new clsBLL(); DataTable dataTable = dt.CourseContentBLL(obj); CoursesGrid.DataSource = dataTable; CoursesGrid.DataBind(); }
protected void SubmitQuestion_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); clsBLL obj = new clsBLL(); if (QuestionBox.Text == null || QuestionBox.Text == "" || Option1Box.Text == "" || Option1Box.Text == null || Option2Box.Text == "" || Option2Box.Text == null || Option3Box.Text == "" || Option3Box.Text == null || Option4Box.Text == "" || Option4Box.Text == null) { Response.Write("<script>alert('Some values aren missing in the required field');</script>"); Server.Transfer("AdminAddCourseQuestions.aspx"); } ob.coursecode = CourseCodeDropList.Text; ob.qno = obj.QuestionnumberfinderBLL(ob.coursecode) + 1; ob.question = QuestionBox.Text; ob.option1 = Option1Box.Text; ob.option2 = Option2Box.Text; ob.option3 = Option3Box.Text; ob.option4 = Option4Box.Text; ob.questAns = CorrectOptionDropList.Text; int m = obj.InsertQuestionBLL(ob); if (m == 1) { statuslabel.Text = "inserted"; QuestionBox.Text = ""; Option1Box.Text = ""; Option2Box.Text = ""; Option3Box.Text = ""; Option4Box.Text = ""; } else { statuslabel.Text = "can't insert"; } using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString())) { SqlCommand cmd = new SqlCommand("select * from QuestionBank where (CourseID ='" + CourseCodeDropList.Text + "')", con); con.Open(); QuestionsData.DataSource = cmd.ExecuteReader(); QuestionsData.DataBind(); } }
protected void UserIDSearcherButton_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.userid = UserIDSearcher.Text; clsBLL ob1 = new clsBLL(); DataTable information = ob1.UserIDSearcherBLL(ob); Adminshowstat.Visible = false; Adminsearchshowstat.Visible = true; Adminsearchshowstat.DataSource = information; Adminsearchshowstat.DataBind(); }
protected void DeleteLinkButton_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.coursecode = Session["selectedGrid"].ToString(); clsBLL obj = new clsBLL(); obj.DeleteCourseBLL(ob); Editor.Visible = false; Viewer.Visible = false; Deleted.Visible = true; }
protected void Delete_Material_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.coursematerial = Filenamenat.Text; clsBLL ok1 = new clsBLL(); int kira = ok1.updatetheQuestionBLL(ob); if (kira == 1) { Statusindicator.Text = "deleted"; Response.Redirect("AdminAddCourseMaterial.aspx"); } else { Statusindicator.Text = "not deleted"; } }
protected void UpdateCourse_Click(object sender, EventArgs e) { UserBO ob4 = new UserBO(); ob4.userid = Session["User"].ToString(); ob4.coursecodetobechanged = CourseCodeDet.Text; if (CourseInsert.Text.Trim() == null || CourseInsert.Text.Trim() == "") { Response.Write("<script>alert('There is Something Wrong!!!');</script>"); Server.Transfer("AdminCourseDetails.aspx"); } if (CourseDescriptionInsert.Text.Trim() == null || CourseDescriptionInsert.Text.Trim() == "") { CourseDescriptionInsert.Text = descriptionmodified; } ob4.coursecode = CourseInsert.Text; ob4.coursedescription = CourseDescriptionInsert.Text; ob4.skillName = skillmodified; ob4.coursedate = DateTime.Today.ToString("dd-MM-yyyy"); ob4.coursetime = DateTime.Now.ToString("HH:mm:ss"); ob4.otherreference = OtherReferenceInsert.Text; clsBLL ob5 = new clsBLL(); ob4.courseaddedby = ob5.firstnamerBLL(ob4.userid); int response = ob5.CourseUpdateBLL(ob4); if (response == 1) { Response.Write("<script>alert('Done Man!!!');</script>"); Server.Transfer("AdminMainPage.aspx"); } else { Response.Write("<script>alert('Oops Man!!!');</script>"); } }
protected void PriorityChanger_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.userid = PriorityRequestedID.Text; clsBLL ob1 = new clsBLL(); int modified = ob1.AdminBuilderBLL(ob); if (modified == 1) { StatusBar.Text = "Priority Created"; } else { StatusBar.Text = "Priority Not-Created"; } }
protected void Page_Load(object sender, EventArgs e) { try { AdminID.Text = Session["User"].ToString(); } catch { Response.Redirect("LoginPage.aspx"); } string str = Session["User"].ToString(); UserBO ob4 = new UserBO(); ob4.userid = Session["User"].ToString(); clsBLL ob5 = new clsBLL(); int admin1 = ob5.FindUserTypeBLL(ob4); if (admin1 != 1) { Session["User"] = null; Response.Redirect("LoginPage.aspx"); } string name = ob5.firstnamerBLL(str); AdminName.Text = name; if (!IsPostBack) { clsBLL ob1 = new clsBLL(); List <string> skillList = ob1.FirstBLL(); List <string> skillList2 = ob1.First2BLL(); List <string> skillList3 = ob1.First3BLL(); try { skillCard1.Text = skillList[0]; skillCard2.Text = skillList2[0]; skillCard3.Text = skillList3[0]; } catch { skillCard1.Text = "none"; skillCard2.Text = "none"; skillCard3.Text = "none"; } Adminsearchshowstat.Visible = false; } }
protected void DeleteSkill_Click(object sender, EventArgs e) { UserBO ob = new UserBO(); ob.skillName = SkillBox.Text; clsBLL obj = new clsBLL(); int rew = obj.DeleteSkillBLL(ob); if (rew == 1) { StatusBar.Text = "Done"; Response.Redirect("AdminSkill.aspx"); } else { StatusBar.Text = "Not Deleted"; } }
protected void Page_Load(object sender, EventArgs e) { clsBLL obj = new clsBLL(); if (obj.AdminCounterBLL() >= 1) { usertyper = 2; } if (usertyper == 2) { UserTypeDropRegister.Visible = false; UserTypeDropRegister1.Visible = true; } else { UserTypeDropRegister1.Visible = false; UserTypeDropRegister.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UserBO ob = new UserBO(); try { ob.userid = Session["User"].ToString(); ob.coursecode = Session["CourseSelected"].ToString(); } catch { Response.Redirect("UserMain.aspx"); } clsBLL logicob = new clsBLL(); if (logicob.iscourseopenedBLL(ob) == "Y") { DataTable questiontable = logicob.QuestionTableCreatorBLL(ob); countofQuestions = questiontable.Rows.Count; if (countofQuestions > 0) { startingQuestion = 1; rowno = startingQuestion - 1; displayQuestion(questiontable); } else { QuestionText.Text = "Sorry There are no questions for this course"; } test.DataSource = questiontable; test.DataBind(); SubmitQuestions.Visible = false; } else { Response.Redirect("UserMain.aspx"); } } }
protected void CourseDataMaterial_RowCommand(object sender, GridViewCommandEventArgs e) { myframe.Visible = true; if (e.CommandName == "Select") { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = CourseDataMaterial.Rows[rowIndex]; string country = row.Cells[2].Text; TakeAssessment.Visible = true; UserBO ob = new UserBO(); ob.userid = Session["User"].ToString(); ob.coursecode = Session["CourseSelected"].ToString(); clsBLL obj = new clsBLL(); obj.onupdateQuantifierBLL(ob); myframe.Attributes.Add("src", country); } }
protected void QuestionsData_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = QuestionsData.Rows[rowIndex]; int qnodel = Convert.ToInt32(row.Cells[1].Text); string coursedel = row.Cells[2].Text; UserBO ob = new UserBO(); ob.qno = qnodel; ob.coursecode = coursedel; clsBLL obj = new clsBLL(); if (obj.deletetheQuestionBLL(ob) == 1) { if (obj.updatetheQuestionBLL(ob) >= 0) { Response.Write("<script>alert('Deleted QuestionSuccessfully');</script>"); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString())) { SqlCommand cmd = new SqlCommand("select * from QuestionBank where (CourseID ='" + CourseCodeDropList.Text + "')", con); con.Open(); QuestionsData.DataSource = cmd.ExecuteReader(); QuestionsData.DataBind(); } } } else { Response.Write("<script>alert('Question can't be deleted');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { try { UserID.Text = Session["User"].ToString(); } catch { Response.Redirect("LoginPage.aspx"); } string str = Session["User"].ToString(); UserBO ob4 = new UserBO(); ob4.userid = Session["User"].ToString(); clsBLL ob5 = new clsBLL(); int user1 = ob5.FindUserTypeBLL(ob4); if (user1 == 1) { Session["User"] = null; Response.Redirect("LoginPage.aspx"); } string name = ob5.firstnamerBLL(str); UserName.Text = name; using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString())) { SqlCommand cmd = new SqlCommand("select CourseCode,Status,Score from Scores where (UserID ='" + Session["User"].ToString() + "')", con); con.Open(); CoursesAccepted.DataSource = cmd.ExecuteReader(); CoursesAccepted.DataBind(); } using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString())) { SqlCommand cmd = new SqlCommand("select SkillName from SkillSet", con); con.Open(); UserSkillSearchResult.DataSource = cmd.ExecuteReader(); UserSkillSearchResult.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { UserBO ob = new UserBO(); clsBLL obj = new clsBLL(); ob.userid = Session["User"].ToString(); ob.coursecode = Session["CourseSelected"].ToString(); ob.maxquestioncount = Session["questioncount"].ToString(); int score_achieved = Convert.ToInt32(obj.scorecardBLL(ob)); ob.score = score_achieved.ToString(); StatusBar.Text = score_achieved.ToString() + " / " + ob.maxquestioncount.ToString(); DataTable questiontable = obj.QuestionTableCreatorBLL(ob); afterAnswered.DataSource = questiontable; afterAnswered.DataBind(); int myavg = (score_achieved / Convert.ToInt32(Session["questioncount"])) * 100; if (myavg > passgrade) { ob.status = "passed"; } else { ob.status = "Progress"; } ob.completiondate = DateTime.Today.ToString("dd-MM-yyyy"); obj.updateStatusBLL(ob); }
protected void leftindicpicbutton_Click(object sender, EventArgs e) { rowno = startingQuestion - 2; startingQuestion--; if (startingQuestion < 1) { Response.Write("<script>alert('You cannot go back');</script>"); } else { UserBO ob = new UserBO(); ob.coursecode = Session["CourseSelected"].ToString(); clsBLL logicob = new clsBLL(); DataTable questiontable = logicob.QuestionTableCreatorBLL(ob); displayQuestion(questiontable); if (OptionA.Checked) { OptionA.Checked = false; } else if (OptionB.Checked) { OptionB.Checked = false; } else if (OptionC.Checked) { OptionC.Checked = false; } else if (OptionD.Checked) { OptionD.Checked = false; } } }
protected void UserCourseDetailsView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = UserCourseDetailsView.Rows[rowIndex]; UserBO ob = new UserBO(); ob.userid = Session["User"].ToString(); ob.coursecode = row.Cells[1].Text; ob.registered = "Y"; ob.courseopened = "N"; clsBLL obj = new clsBLL(); if (obj.isregisteredBLL(ob) == 0) { obj.onregistrationcourseBLL(ob); obj.activateStatusBLL(ob); } Session["CourseSelected"] = row.Cells[1].Text; Response.Redirect("UserSelectedCoursePage.aspx"); } }
protected void rightindicpicbutton_Click(object sender, EventArgs e) { rowno = startingQuestion - 1; startingQuestion++; if (startingQuestion > countofQuestions) { Response.Write("<script>alert('You are completed with your Questions click on submit');</script>"); SubmitQuestions.Visible = true; } else { if (OptionA.Checked) { answercheck = "A"; } else if (OptionB.Checked) { answercheck = "B"; } else if (OptionC.Checked) { answercheck = "C"; } else if (OptionD.Checked) { answercheck = "D"; } else { answercheck = "N"; } UserBO ob = new UserBO(); ob.coursecode = Session["CourseSelected"].ToString(); clsBLL logicob = new clsBLL(); DataTable questiontable = logicob.QuestionTableCreatorBLL(ob); StatusBar.Text = questiontable.Rows[rowno][7].ToString(); logicob.updateAnsweredBLL(rowno, answercheck, Session["CourseSelected"].ToString()); displayQuestion(questiontable); if (OptionA.Checked) { OptionA.Checked = false; } else if (OptionB.Checked) { OptionB.Checked = false; } else if (OptionC.Checked) { OptionC.Checked = false; } else if (OptionD.Checked) { OptionD.Checked = false; } } }
protected void RegisterButton_Click1(object sender, EventArgs e) { if (FNameRegister.Text == "" || FNameRegister.Text.Any(char.IsDigit)) { FNameRegister.BackColor = Color.Red; } else { FNameRegister.BackColor = Color.White; } if (LNameRegister.Text == "" || LNameRegister.Text.Any(char.IsDigit)) { LNameRegister.BackColor = Color.Red; } else { LNameRegister.BackColor = Color.White; } if (AgeRegister.Text == "") { AgeRegister.BackColor = Color.Red; } else { AgeRegister.BackColor = Color.White; } if (GenderDropRegister.Text == "") { GenderDropRegister.BackColor = Color.Red; } else { GenderDropRegister.BackColor = Color.White; } if (ContactTelRegister.Text == "") { ContactTelRegister.BackColor = Color.Red; } else { ContactTelRegister.BackColor = Color.White; } if (UserIDRegister.Text == "") { UserIDRegister.BackColor = Color.Red; } else { UserIDRegister.BackColor = Color.White; } if (PasswordRegister.Text == "") { PasswordRegister.BackColor = Color.Red; } else { PasswordRegister.BackColor = Color.White; } if (MailIDRegister.Text == "" || MailIDRegister.Text.Length <= 10) { MailIDRegister.BackColor = Color.Red; } else { MailIDRegister.BackColor = Color.White; } if (UserTypeDropRegister.Text == "" || UserTypeDropRegister.Text.Any(char.IsDigit)) { UserTypeDropRegister.BackColor = Color.Red; } else { UserTypeDropRegister.BackColor = Color.White; } UserBO ob1 = new UserBO(); ob1.fname = FNameRegister.Text.Trim(); ob1.lname = LNameRegister.Text.Trim(); try { ob1.age = Convert.ToInt32(AgeRegister.Text); } catch { ob1.age = 0; } if (ob1.age == 0) { Response.Write("<script>alert('age must be an Integer')</script>"); } ob1.gender = GenderDropRegister.Text; ob1.contactno = ContactTelRegister.Text.Trim(); ob1.userid = UserIDRegister.Text.Trim(); ob1.password = PasswordRegister.Text.Trim(); ob1.mailID = MailIDRegister.Text.Trim(); if (usertyper == 2) { ob1.userType = UserTypeDropRegister1.Text; } else { ob1.userType = UserTypeDropRegister.Text; } clsBLL ob2 = new clsBLL(); clsBLL ob3 = new clsBLL(); int verifyUser = ob2.VerifyUserIDBLL(ob1); int result = ob3.InsertRegisterData(ob1); if (FNameRegister.Text.Any(char.IsDigit) || ob1.lname == "" || ob1.contactno == "" || MailIDRegister.Text.Length <= 10 || ob1.userid == "" || ob1.password == "" || ob1.mailID == "" || FNameRegister.Text.Contains(" ") || LNameRegister.Text.Contains(" ") || LNameRegister.Text.Any(char.IsDigit) || UserTypeDropRegister.Text.Any(char.IsDigit)) { Response.Write("<script>alert('Looks like there is some error check the deatails u have entered');</script>"); Response.Write("<script> return DivChange();</script>"); } if (verifyUser == 1) { Response.Write("<script>alert('Sir There is already a UserId that You have entered')</script>"); } else if (verifyUser == 0) { if (UserIDRegister.Text == "" || FNameRegister.Text == "" || LNameRegister.Text == "" || AgeRegister.Text == "" || GenderDropRegister.Text == "" || ContactTelRegister.Text == "" || PasswordRegister.Text == "" || MailIDRegister.Text == "" || UserTypeDropRegister.Text == "") { Response.Write("<script>alert('Sir some values are missing check the boxes that are in red')</script>"); } else if (result == 1) { StatusRegistration.Text = "Registration SuccessFul"; Response.Write("<script>alert('Registration SuccessFul')</script>"); Server.Transfer("LoginPage.aspx"); } else if (result == 0) { StatusRegistration.Text = "Registration Un-SuccessFul"; Response.Write("<script>return DivChange();</script>"); } } }