private void LoadGrid2() { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object Empinfo2.DataSource = objBL.GetEmployee_University(Session["New"].ToString()); //setting data source for the gridview Empinfo2.DataBind(); //bind the data source to the gridview Empinfo2.HeaderRow.Visible = false; Empinfo2.BorderStyle = BorderStyle.None; Empinfo2.Rows[0].Visible = false; for (int i = 0; i < Empinfo2.Rows.Count; i++) { Empinfo2.Rows[i].Cells[1].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[1].ForeColor = Color.White; Empinfo2.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < Empinfo2.Rows.Count; i++) { Empinfo2.Rows[i].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[0].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[0].ForeColor = Color.Khaki; Empinfo2.Rows[i].Cells[0].Font.Bold = true; } } catch (SqlException) { throw; } }
private void LoadGrid3() { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object Studentinfo3.DataSource = objBL.GetStudent_Contact(Session["New"].ToString()); //setting data source for the gridview Studentinfo3.DataBind(); //bind the data source to the gridview Studentinfo3.HeaderRow.Visible = false; Studentinfo3.BorderStyle = BorderStyle.None; Studentinfo3.Rows[0].Visible = false; for (int i = 0; i < Studentinfo3.Rows.Count; i++) { Studentinfo3.Rows[i].Cells[1].BorderStyle = BorderStyle.None; Studentinfo3.Rows[i].Cells[1].ForeColor = Color.White; Studentinfo3.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < Studentinfo3.Rows.Count; i++) { Studentinfo3.Rows[i].BorderStyle = BorderStyle.None; Studentinfo3.Rows[i].Cells[0].BorderStyle = BorderStyle.None; Studentinfo3.Rows[i].Cells[0].ForeColor = Color.Khaki; Studentinfo3.Rows[i].Cells[0].Font.Bold = true; } } catch (SqlException) { throw; } }
protected void Page_Load(object sender, EventArgs e) { BLItem objBL = new BLItem(); if (!Page.IsPostBack) { if (Session["New"] != null) { Label_welcome.Text += Session["New"].ToString(); string image = objBL.get_image_from_emp(Session["New"].ToString()); if (image.Length <= 0) { image = "uploadedimages/default.png"; } Image1.ImageUrl = image; } else { Response.Redirect("Login.aspx"); } } else { if (Session["New"] == null) { Response.Redirect("Login.aspx"); } } }
protected void insert_courses(object sender, EventArgs e) { BLItem objBL = new BLItem(); string courseID = dd.SelectedValue; string teacherID = empID.Text; int temp = objBL.check_Emp_username(teacherID); if (temp == 1) { submit.Visible = false; Button1.Visible = true; DataTable dt = objBL.get_available_sections(courseID); dd1.Visible = true; dd1.DataSource = dt; dd1.DataTextField = "SectionID"; dd1.DataValueField = "SectionID"; dd1.DataBind(); dd1.Items.Insert(0, new ListItem("Select SectionID", "-1")); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Employee Does Not Exist.')", true); } }
private void LoadGrid() { string userid = Request.QueryString["val1"]; BLItem objBL = new BLItem(); // declare and initialize BLItem object int temp = objBL.check_student_username(userid); if (temp == 1) { string image = objBL.get_image(userid); if (image.Length <= 0) { image = "uploadedimages/default.png"; } // Image1.ImageUrl = image; DataTable dt = objBL.GetStudent(userid, 1); grdContact.DataSource = dt; grdContact.DataBind(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Student Does Not Exist.')", true); //Response.Redirect("View_Student.aspx"); } }
protected void insert_courses1(object sender, EventArgs e) { BLItem objBL = new BLItem(); string sectionID = dd1.SelectedItem.Text; string courseID = dd.SelectedValue; string teacherID = empID.Text; objBL.enter_teacher_courses(teacherID, courseID, sectionID); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Registration Is Successfull.')", true); }
protected void FillDeptDropdownList() { BLItem objBL = new BLItem(); DataTable dt = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 3); dd.DataSource = dt; dd.DataTextField = "courseName"; dd.DataValueField = "courseID"; dd.DataBind(); dd.Items.Insert(0, new ListItem("Select Course", "-1")); }
private void LoadGrid() { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object teacher_course_info.DataSource = objBL.Get_Employee_Current_Courses(Session["New"].ToString()); //setting data source for the gridview teacher_course_info.DataBind(); //bind the data source to the gridview } catch (SqlException) { throw; } }
protected void Button1_Click(object sender, EventArgs e) { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object int temp = objBL.check_student_username(TextBox1.Text); if (temp == 1) { string image = objBL.get_image(TextBox1.Text); if (image.Length <= 0) { image = "uploadedimages/default.png"; } Image1.ImageUrl = image; student.DataSource = objBL.GetStudent_Personal(TextBox1.Text); student.DataBind(); student.HeaderRow.Visible = false; student.BorderStyle = BorderStyle.None; update.Visible = true; for (int i = 0; i < student.Rows.Count; i++) { student.Rows[i].Cells[1].BorderStyle = BorderStyle.None; student.Rows[i].Cells[1].ForeColor = Color.White; student.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < student.Rows.Count; i++) { student.Rows[i].BorderStyle = BorderStyle.None; student.Rows[i].Cells[0].BorderStyle = BorderStyle.None; student.Rows[i].Cells[0].ForeColor = Color.Khaki; student.Rows[i].Cells[0].Font.Bold = true; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Student Does Not Exist.')", true); //Response.Redirect("View_Student.aspx"); } } catch (SqlException) { throw; } }
private void InvoiceAddItemForm_Load(object sender, EventArgs e) { BLItem bl = new BLItem(); list = bl.BLGetItem(); foreach (ItemModel item in list) { comboBoxItem.Items.Add(item.itemName.ToString()); } if (invoiceDetailId == 0) { btnSave.Text = "Salveaza"; } else { btnSave.Text = "Modifica"; } }
protected void submit_Click(object sender, EventArgs e) { BLItem objBL = new BLItem(); string roll_no = Session["roll_no"].ToString(); string section_id = Session["section_id"].ToString(); string q1 = quiz1.ToString(); string q2 = quiz2.ToString(); string q3 = quiz3.ToString(); string a1 = ass1.ToString(); string a2 = ass2.ToString(); string a3 = ass3.ToString(); string m1 = mid1.ToString(); string m2 = mid2.ToString(); string fnl = final.ToString(); objBL.enter_Marks(roll_no, section_id, q1, q2, q3, a1, a2, a3, m1, m2, fnl); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Marks Entered.')", true); resetFields(); }
private void LoadGrid() { try { string course_id = Request.QueryString["val1"]; string sectionid = Request.QueryString["val2"]; string teacherID = Request.QueryString["val3"]; BLItem objBL = new BLItem(); // declare and initialize BLItem object Students.DataSource = objBL.getEnrolledStudents(course_id, sectionid, teacherID); //setting data source for the gridview Students.DataBind(); //bind the data source to the gridview if (Students.Rows.Count > 0) { Students.BorderStyle = BorderStyle.None; Students.HeaderRow.ForeColor = Color.Khaki; Students.HeaderRow.BorderStyle = BorderStyle.None; Students.GridLines = GridLines.None; for (int i = 0; i < Students.Rows.Count; i++) { Students.Rows[i].BorderStyle = BorderStyle.None; for (int j = 0; j < Students.Columns.Count; j++) { Students.Rows[i].Cells[j].BorderStyle = BorderStyle.None; } Students.Rows[i].ForeColor = Color.White; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('No Students in this class')", true); } } catch (SqlException) { throw; } }
public List <KeyValuePair <Guid, List <CommonItem> > > GetAllItemsMapped() { return(BLItem.GetAllItemsMapped()); }
protected void Button1_Click(object sender, EventArgs e) { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object string username = User_ID.Text; string fname = Fname.Text; string lname = Lname.Text; string password = Passwd.Text; int campus = Campus.SelectedIndex + 1; string _Mname = Mname.Text; string _gid = gid.Text; string _gender = gender.SelectedItem.Text; string _dob = dob.Text; string _temp_addr = temp_addr.Text; string _p_addr = pr_addr.Text; string _c_no = c_no.Text; string _cnic = cnic.Text; string _p_em = p_em.Text; string _o_em = o_em.Text; int _deptid = deptid.SelectedIndex + 1; string _d_jn = d_en.Text; string _bg = bg.SelectedItem.Text; string _status = status1.Text; string type = Type.SelectedValue; //uplodaing image bool image_loaded = true; string pathName = null; if (imgupload.HasFile) { string extension = System.IO.Path.GetExtension(imgupload.FileName); if (extension.ToLower() != ".gif" && extension.ToLower() != ".png" && extension.ToLower() != ".jpg" && extension.ToLower() != ".jpeg") { ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('invalid image format');", true); } else { int file_size = imgupload.PostedFile.ContentLength; if (file_size > 1048576) { ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('max file size is 1 mb');", true); image_loaded = false; } else { pathName = "uploadedimages/" + Path.GetFileName(imgupload.PostedFile.FileName); } } } int temp2 = objBL.check_Emp_username(username); if (temp2 == 0) { int temp = objBL.insertIntoEmployee(username, fname, lname, password, campus, _Mname, _gid, _gender, _dob, _temp_addr, _p_addr, _p_em, _o_em, _c_no, _cnic, _deptid, _bg, _d_jn, _status, type, pathName); imgupload.SaveAs(Server.MapPath("~/uploadedimages/" + imgupload.FileName)); if (temp >= 0 && image_loaded) { status.Visible = true; status.Text = "Registration is successful"; //Response.Redirect("Admin_Student_Registeration.aspx"); } else { status.Visible = true; status.Text = "Unable to register"; } } else if (temp2 != 0) { status.Visible = true; status.Text = "username already exists"; //Response.Redirect("Admin_Student_Registeration.aspx"); } } catch (SqlException) { throw; } }
protected void Button1_Click(object sender, EventArgs e) { BLItem objBL = new BLItem(); int temp = objBL.check_Emp_username(TextBox1.Text); if (temp == 1) { try { string userID = TextBox1.Text; string image = objBL.get_image_from_emp(TextBox1.Text); if (image.Length <= 0) { image = "uploadedimages/default.png"; } Image1.ImageUrl = image; update.Visible = true; Empinfo.DataSource = objBL.GetEmployee_Personal(userID); //setting data source for the gridview Empinfo.DataBind(); //bind the data source to the gridview Empinfo.HeaderRow.Visible = false; Empinfo.BorderStyle = BorderStyle.None; for (int i = 0; i < Empinfo.Rows.Count; i++) { Empinfo.Rows[i].Cells[1].BorderStyle = BorderStyle.None; Empinfo.Rows[i].Cells[1].ForeColor = Color.White; Empinfo.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < Empinfo.Rows.Count; i++) { Empinfo.Rows[i].BorderStyle = BorderStyle.None; Empinfo.Rows[i].Cells[0].BorderStyle = BorderStyle.None; Empinfo.Rows[i].Cells[0].ForeColor = Color.Khaki; Empinfo.Rows[i].Cells[0].Font.Bold = true; } } catch (SqlException) { throw; } try { string userID = TextBox1.Text; Empinfo2.DataSource = objBL.GetEmployee_University(userID); //setting data source for the gridview Empinfo2.DataBind(); //bind the data source to the gridview Empinfo2.HeaderRow.Visible = false; Empinfo2.BorderStyle = BorderStyle.None; Empinfo2.Rows[0].Visible = false; for (int i = 0; i < Empinfo2.Rows.Count; i++) { Empinfo2.Rows[i].Cells[1].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[1].ForeColor = Color.White; Empinfo2.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < Empinfo2.Rows.Count; i++) { Empinfo2.Rows[i].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[0].BorderStyle = BorderStyle.None; Empinfo2.Rows[i].Cells[0].ForeColor = Color.Khaki; Empinfo2.Rows[i].Cells[0].Font.Bold = true; } } catch (SqlException) { throw; } try { string userID = TextBox1.Text; Empinfo3.DataSource = objBL.GetEmployee_Contact(userID); //setting data source for the gridview Empinfo3.DataBind(); //bind the data source to the gridview Empinfo3.HeaderRow.Visible = false; Empinfo3.Rows[0].Visible = false; Empinfo3.BorderStyle = BorderStyle.None; for (int i = 0; i < Empinfo3.Rows.Count; i++) { Empinfo3.Rows[i].Cells[1].BorderStyle = BorderStyle.None; Empinfo3.Rows[i].Cells[1].ForeColor = Color.White; Empinfo3.Rows[i].Cells[1].Font.Bold = false; } for (int i = 0; i < Empinfo3.Rows.Count; i++) { Empinfo3.Rows[i].BorderStyle = BorderStyle.None; Empinfo3.Rows[i].Cells[0].BorderStyle = BorderStyle.None; Empinfo3.Rows[i].Cells[0].ForeColor = Color.Khaki; Empinfo3.Rows[i].Cells[0].Font.Bold = true; } } catch (SqlException) { throw; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Employee DoesNot Exist.')", true); } }
protected void submit_Click(object sender, EventArgs e) { BLItem objBL = new BLItem(); int crdHrs = objBL.get_credit_hours(int.Parse(Session["New"].ToString()), 1); int curr_sems_no = objBL.get_current_semester_no(int.Parse(Session["New"].ToString()), 0); int curr_sems_id = objBL.get_current_semester_no(int.Parse(Session["New"].ToString()), 1); bool flag1 = false, flag2 = false, flag3 = false, flag4 = false, flag5 = false, flag6 = false, flag7 = false, flag8 = false, flag9 = false, flag10 = false; string course1 = DropDownList0.SelectedItem.Value; if (course1 != "-1" && add31.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course1), curr_sems_id) == 1) { Label1.Visible = true; Label1.Text = "You have already added this course."; flag1 = true; } else { crdHrs += 3; } } else if (course1 != "-1" && drop31.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course1), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course1)); crdHrs -= 3; Label1.Visible = true; Label1.Text = "Course dropped successfully."; } else { Label1.Visible = true; Label1.Text = "You can not drop Course which you are not studying."; } } string course2 = DropDownList1.SelectedValue.ToString(); if (course2 != "-1" && add32.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course2), curr_sems_id) == 1) { Label3.Visible = true; Label3.Text = "You have already added this course."; flag2 = true; } else { crdHrs += 3; } } else if (course2 != "-1" && drop32.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course2), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course2)); crdHrs -= 3; Label3.Visible = true; Label3.Text = "Course dropped successfully."; } else { Label3.Visible = true; Label3.Text = "You can not drop Course which you are not studying."; } } string course3 = DropDownList2.SelectedValue.ToString(); if (course3 != "-1" && add33.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course3), curr_sems_id) == 1) { Label5.Visible = true; Label5.Text = "You have already added this course."; flag3 = true; } else { crdHrs += 3; } } else if (course3 != "-1" && drop33.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course3), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course3)); crdHrs -= 3; Label5.Visible = true; Label5.Text = "Course dropped successfully."; } else { Label5.Visible = true; Label5.Text = "You can not drop Course which you are not studying."; } } string course4 = DropDownList3.SelectedValue.ToString(); if (course4 != "-1" && add34.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course4), curr_sems_id) == 1) { Label7.Visible = true; Label7.Text = "You have already added this course."; flag4 = true; } else { crdHrs += 3; } } else if (course4 != "-1" && drop34.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course4), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course4)); crdHrs -= 3; Label7.Visible = true; Label7.Text = "Course dropped successfully."; } else { Label7.Visible = true; Label7.Text = "You can not drop Course which you are not studying."; } } string course5 = DropDownList4.SelectedValue.ToString(); if (course5 != "-1" && add35.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course5), curr_sems_id) == 1) { Label9.Visible = true; Label9.Text = "You have already added this course."; flag5 = true; } else { crdHrs += 3; } } else if (course5 != "-1" && drop35.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course5), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course5)); crdHrs -= 3; Label9.Visible = true; Label9.Text = "Course dropped successfully."; } else { Label9.Visible = true; Label9.Text = "You can not drop Course which you are not studying."; } } string course6 = DropDownList5.SelectedValue.ToString(); if (course6 != "-1" && add11.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course6), curr_sems_id) == 1) { Label2.Visible = true; Label2.Text = "You have already added this course."; flag6 = true; } else { crdHrs += 1; } } else if (course6 != "-1" && drop11.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course6), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course6)); crdHrs -= 1; Label2.Visible = true; Label2.Text = "Course dropped successfully."; } else { Label2.Visible = true; Label2.Text = "You can not drop Course which you are not studying."; } } string course7 = DropDownList6.SelectedValue.ToString(); if (course7 != "-1" && add12.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course7), curr_sems_id) == 1) { Label4.Visible = true; Label4.Text = "You have already added this course."; flag7 = true; } else { crdHrs += 1; } } else if (course7 != "-1" && drop12.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course7), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course7)); crdHrs -= 1; Label4.Visible = true; Label4.Text = "Course dropped successfully."; } else { Label4.Visible = true; Label4.Text = "You can not drop Course which you are not studying."; } } string course8 = DropDownList7.SelectedValue.ToString(); if (course8 != "-1" && add13.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course8), curr_sems_id) == 1) { Label6.Visible = true; Label6.Text = "You have already added this course."; flag8 = true; } else { crdHrs += 1; } } else if (course8 != "-1" && drop13.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course8), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course8)); crdHrs -= 1; Label6.Visible = true; Label6.Text = "Course dropped successfully."; } else { Label6.Visible = true; Label6.Text = "You can not drop Course which you are not studying."; } } string course9 = DropDownList8.SelectedValue.ToString(); if (course9 != "-1" && add14.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course9), curr_sems_id) == 1) { Label8.Visible = true; Label8.Text = "You have already added this course."; flag9 = true; } else { crdHrs += 1; } } else if (course9 != "-1" && drop14.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course9), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course9)); crdHrs -= 1; Label8.Visible = true; Label8.Text = "Course dropped successfully."; } else { Label8.Visible = true; Label8.Text = "You can not drop Course which you are not studying."; } } string course10 = DropDownList9.SelectedValue.ToString(); if (course10 != "-1" && add15.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course10), curr_sems_id) == 1) { Label10.Visible = true; Label10.Text = "You have already added this course."; flag10 = true; } else { crdHrs += 1; } } else if (course10 != "-1" && drop15.Checked) { if (objBL.Course_Studies(int.Parse(Session["New"].ToString()), int.Parse(course10), curr_sems_id) == 1) { objBL.drop_Courses(int.Parse(Session["New"].ToString()), int.Parse(course10)); crdHrs -= 1; Label10.Visible = true; Label10.Text = "Course dropped successfully."; } else { Label10.Visible = true; Label10.Text = "You can not drop Course which you are not studying."; } } if ((!add11.Checked && !drop11.Checked) && (!add12.Checked && !drop12.Checked) && (!add13.Checked && !drop13.Checked) && (!add14.Checked && !drop14.Checked) && (!add15.Checked && !drop15.Checked) && (!add31.Checked && !drop31.Checked) && (!add32.Checked && !drop32.Checked) && (!add33.Checked && !drop33.Checked) && (!add34.Checked && !drop34.Checked) && (!add35.Checked && !drop35.Checked)) { status.Visible = true; status.Text = "You didnt add/drop any courses."; } else if (crdHrs > 17) { status.Visible = true; status.Text = "Maximum 17 credit hours is allowed to add courses."; } else if (crdHrs > 0 && crdHrs <= 17) { if (course1 != "-1" && add31.Checked) { if (!flag1) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course1, curr_sems_id, curr_sems_no); Label1.Visible = true; Label1.Text = "Course registered successfully"; } } if (course2 != "-1" && add32.Checked) { if (!flag2) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course2, curr_sems_id, curr_sems_no); Label3.Visible = true; Label3.Text = "Course registered successfully"; } } if (course3 != "-1" && add33.Checked) { if (!flag3) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course3, curr_sems_id, curr_sems_no); Label5.Visible = true; Label5.Text = "Course registered successfully"; } } if (course4 != "-1" && add34.Checked) { if (!flag4) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course4, curr_sems_id, curr_sems_no); Label7.Visible = true; Label7.Text = "Course registered successfully"; } } if (course5 != "-1" && add35.Checked) { if (!flag5) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course5, curr_sems_id, curr_sems_no); Label9.Visible = true; Label9.Text = "Course registered successfully"; } } if (course6 != "-1" && add11.Checked) { if (!flag6) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course6, curr_sems_id, curr_sems_no); Label2.Visible = true; Label2.Text = "Course registered successfully"; } } if (course7 != "-1" && add12.Checked) { if (!flag7) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course7, curr_sems_id, curr_sems_no); Label4.Visible = true; Label4.Text = "Course registered successfully"; } } if (course8 != "-1" && add13.Checked) { if (!flag8) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course8, curr_sems_id, curr_sems_no); Label6.Visible = true; Label6.Text = "Course registered successfully"; } } if (course9 != "-1" && add14.Checked) { if (!flag9) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course9, curr_sems_id, curr_sems_no); Label8.Visible = true; Label8.Text = "Course registered successfully"; } } if (course10 != "-1" && add15.Checked) { if (!flag10) { objBL.add_Courses(int.Parse(Session["New"].ToString()), course10, curr_sems_id, curr_sems_no); Label10.Visible = true; Label10.Text = "Course registered successfully"; } } } }
public List <CommonItem> GetAllItems(String search = "") { return(BLItem.GetAllItems(search)); }
public CommonItem GetItemsById(String search) { return(BLItem.GetItemsById(search)); }
protected void b1_Click(object sender, EventArgs e) { try { BLItem objBL = new BLItem(); // declare and initialize BLItem object string username = user_id.Text; string campus = logincampus.SelectedItem.ToString(); int LoginAs = Login_As.SelectedIndex; int temp = 0, temp2 = 1; if (LoginAs == 0) { temp = objBL.check_student_username(username); if (temp == 1) { temp2 = objBL.check_student_campus(username, campus); if (temp2 == 0) { string password = user_pass.Text; int temp1 = objBL.check_student_password(username, password); if (temp1 == 0) { Session["New"] = user_id.Text; Response.Write("Password is correct"); Response.Redirect("StudentProfile.aspx"); } else { Response.Write("Incorrect Password"); } } else { Response.Write("incorrect username"); } } else { Response.Write("incorrect username"); } } else if (LoginAs == 2) { temp = objBL.check_admin_username(username); if (temp == 1) { temp2 = objBL.check_admin_campus(username, campus); if (temp2 == 0) { string password = user_pass.Text; int temp1 = objBL.check_admin_password(username, password); if (temp1 == 0) { Session["New"] = user_id.Text; Response.Write("Password is correct"); Response.Redirect("Admin_Profile.aspx"); } else { Response.Write("Incorrect Password"); } } else { Response.Write("incorrect username"); } } else { Response.Write("incorrect username"); } } else if (LoginAs == 1) { temp = objBL.check_Emp_username(username); if (temp == 1) { temp2 = objBL.check_Emp_campus(username, campus); if (temp2 == 0) { string password = user_pass.Text; int temp1 = objBL.check_Emp_password(username, password); if (temp1 == 0) { Session["New"] = user_id.Text; Response.Write("Password is correct"); Response.Redirect("EmployeeProfile.aspx"); } else { Response.Write("Incorrect Password"); } } else { Response.Write("incorrect username"); } } else { Response.Write("incorrect username"); } } } catch (SqlException) { throw; } }
protected void grdContact_RowUpdating(object sender, GridViewUpdateEventArgs e) { BLItem objBL = new BLItem(); TextBox guardianid = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t2"); TextBox fname = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t3"); TextBox mname = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t4"); TextBox lname = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t5"); DropDownList gender = (DropDownList)grdContact.Rows[e.RowIndex].FindControl("gen"); TextBox dob = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t7"); TextBox temp_addr = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t8"); TextBox p_addr = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t9"); TextBox c_no = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t10"); TextBox cnic = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t11"); TextBox p_em = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t12"); TextBox o_em = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t13"); TextBox d_en = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t14"); DropDownList bg = (DropDownList)grdContact.Rows[e.RowIndex].FindControl("t15"); DropDownList c_id = (DropDownList)grdContact.Rows[e.RowIndex].FindControl("cmp"); TextBox cgpa = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t17"); TextBox wc = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t18"); TextBox password = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t19"); FileUpload photo = (FileUpload)grdContact.Rows[e.RowIndex].FindControl("t20"); TextBox status = (TextBox)grdContact.Rows[e.RowIndex].FindControl("t21"); string userid = Request.QueryString["val1"]; bool image_loaded = true; string pathName = null; if (photo.HasFile) { string extension = System.IO.Path.GetExtension(photo.FileName); if (extension.ToLower() != ".gif" && extension.ToLower() != ".png" && extension.ToLower() != ".jpg" && extension.ToLower() != ".jpeg") { ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('invalid image format');", true); } else { int file_size = photo.PostedFile.ContentLength; if (file_size > 1048576) { ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('max file size is 1 mb');", true); image_loaded = false; } else { pathName = "uploadedimages/" + Path.GetFileName(photo.PostedFile.FileName); } } } float cgpa1 = float.Parse(cgpa.Text); int temp = objBL.updateStudent(userid, fname.Text, lname.Text, password.Text, c_id.SelectedIndex + 1, mname.Text, guardianid.Text, gender.SelectedItem.Text, dob.Text, temp_addr.Text, p_addr.Text, p_em.Text, o_em.Text, cgpa1, c_no.Text, cnic.Text, bg.SelectedItem.Value, d_en.Text, int.Parse(wc.Text), status.Text, pathName); photo.SaveAs(Server.MapPath("~/uploadedimages/" + photo.FileName)); if (temp >= 0 && image_loaded) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Update is Successfull')", true); //Response.Redirect("Admin_Student_Registeration.aspx"); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Unable To Update')", true); } }
public static DataSet fillMessages(BLItem item, int orgID, int buyerID, string forumMessage, string messageType , string messageSeneder) { DataSet ds = new DataSet(); String parm ="S"; String commandtext="get_Forum"; // ds = messages.orgs_.Orgitems.Item.UpdateMessages(parm, commandtext, orgID, //buyerID, forumMessage, messageType, messageSeneder); ds = item.UpdateMessages( parm, commandtext, orgID, item.auctionID, buyerID, forumMessage, messageType, messageSeneder); return ds; }
private void LoadGrid() { BLItem objBL = new BLItem(); DataTable temp = new DataTable(); DataTable original = objBL.Get_Marks_Of_Student(Session["New"].ToString()); List <DataTable> tables = new List <DataTable>(); int i = 0; int j = 1; DataTable newDt = original.Clone(); newDt.TableName = "Table_" + j; newDt.Clear(); foreach (DataRow row in original.Rows) { DataRow newRow = newDt.NewRow(); newRow.ItemArray = row.ItemArray; newDt.Rows.Add(newRow); i++; if (i == 1) { Head1.Visible = true; Head1.Text = newDt.Rows[0][2].ToString(); Course1.DataSource = newDt; Course1.DataBind(); newDt = original.Clone(); newDt.Clear(); } if (i == 2) { Head2.Visible = true; Head2.Text = newDt.Rows[0][2].ToString(); Course2.DataSource = newDt; Course2.DataBind(); newDt = original.Clone(); newDt.Clear(); } if (i == 3) { Head3.Visible = true; Head3.Text = newDt.Rows[0][2].ToString(); Course3.DataSource = newDt; Course3.DataBind(); newDt = original.Clone(); newDt.Clear(); } if (i == 4) { Head4.Visible = true; Head4.Text = newDt.Rows[0][2].ToString(); Course4.DataSource = newDt; Course4.DataBind(); newDt = original.Clone(); newDt.Clear(); } if (i == 5) { Head5.Visible = true; Head5.Text = newDt.Rows[0][2].ToString(); Course5.DataSource = newDt; Course5.DataBind(); newDt = original.Clone(); newDt.Clear(); } } }
public static void setMessages(BLItem item, int orgID, int buyerID, string forumMessage, string messageType , string messageSeneder) { DataSet ds = new DataSet(); String parm = "I"; String commandtext = "get_Forum"; item.UpdateMessages( parm, commandtext, item.auctionID, orgID , buyerID, forumMessage, messageType , messageSeneder ); }
private void loadgrid() { DataTable dt = new DataTable(); DataTable _dt1 = new DataTable(); DataTable _dt2 = new DataTable(); DataTable _dt3 = new DataTable(); DataTable _dt4 = new DataTable(); //Create an ID column for adding to the Datatable DataColumn dcol = new DataColumn("Lecture#", typeof(System.String)); DataColumn dcol1 = new DataColumn("Lecture#", typeof(System.String)); DataColumn dcol2 = new DataColumn("Lecture#", typeof(System.String)); DataColumn dcol3 = new DataColumn("Lecture#", typeof(System.String)); DataColumn dcol4 = new DataColumn("Lecture#", typeof(System.String)); dt.Columns.Add(dcol); _dt1.Columns.Add(dcol1); _dt2.Columns.Add(dcol2); _dt3.Columns.Add(dcol3); _dt4.Columns.Add(dcol4); //Create an ID column for adding to the Datatable for (int i = 1; i <= 28; i++) { dcol = new DataColumn(i.ToString(), typeof(System.String)); dcol1 = new DataColumn(i.ToString(), typeof(System.String)); dcol2 = new DataColumn(i.ToString(), typeof(System.String)); dcol3 = new DataColumn(i.ToString(), typeof(System.String)); dcol4 = new DataColumn(i.ToString(), typeof(System.String)); dt.Columns.Add(dcol); _dt1.Columns.Add(dcol1); _dt2.Columns.Add(dcol2); _dt3.Columns.Add(dcol3); _dt4.Columns.Add(dcol4); } //Now add data for dynamic columns //As the first column is auto-increment, we do not have to add any thing. //Let's add some data to the second column. //Create a new row DataRow drow = dt.NewRow(); DataRow _drow1 = _dt1.NewRow(); DataRow _drow2 = _dt2.NewRow(); DataRow _drow3 = _dt3.NewRow(); DataRow _drow4 = _dt4.NewRow(); //Initialize the row data. //Add the row to the datatable. BLItem objBL = new BLItem(); DataTable dt1 = objBL.get_courses_from_attendance(Session["New"].ToString()); int count = 0; foreach (DataRow row in dt1.Rows) // parse each row of datatable { if (!row["courseName"].ToString().Equals(DBNull.Value)) // check if ItemNo is not null { if (count == 0) { Head1.Visible = true; Head1.Text = row["courseName"].ToString(); DataTable dt2 = objBL.get_lectures_from_Attendance(Session["New"].ToString(), row["courseID"].ToString(), row["sectionID"].ToString()); foreach (DataRow row2 in dt2.Rows) { for (int i = 1; i <= 28; i++) { if (i.ToString() == row2["lectureNo"].ToString()) { drow[i.ToString()] = "A"; } else { if (drow[i.ToString()].ToString() != "A") { drow[i.ToString()] = "-"; } } } } dt.Rows.Add(drow); grd.DataSource = dt; grd.DataBind(); } if (count == 1) { Head2.Visible = true; Head2.Text = row["courseName"].ToString(); DataTable dt2 = objBL.get_lectures_from_Attendance(Session["New"].ToString(), row["courseID"].ToString(), row["sectionID"].ToString()); foreach (DataRow row2 in dt2.Rows) { for (int i = 1; i <= 28; i++) { if (i.ToString() == row2["lectureNo"].ToString()) { _drow1[i.ToString()] = "A"; } else { if (_drow1[i.ToString()].ToString() != "A") { _drow1[i.ToString()] = "-"; } } } } _dt1.Rows.Add(_drow1); grd1.DataSource = _dt1; grd1.DataBind(); } if (count == 2) { Head3.Visible = true; Head3.Text = row["courseName"].ToString(); DataTable dt2 = objBL.get_lectures_from_Attendance(Session["New"].ToString(), row["courseID"].ToString(), row["sectionID"].ToString()); foreach (DataRow row2 in dt2.Rows) { for (int i = 1; i <= 28; i++) { if (i.ToString() == row2["lectureNo"].ToString()) { _drow2[i.ToString()] = "A"; } else { if (_drow2[i.ToString()].ToString() != "A") { _drow2[i.ToString()] = "-"; } } } _dt2.Rows.Add(_drow2); } _dt2.Rows.Add(_drow2); grd2.DataSource = _dt2; grd2.DataBind(); } if (count == 3) { Head4.Visible = true; Head4.Text = row["courseName"].ToString(); DataTable dt2 = objBL.get_lectures_from_Attendance(Session["New"].ToString(), row["courseID"].ToString(), row["sectionID"].ToString()); foreach (DataRow row2 in dt2.Rows) { for (int i = 1; i <= 28; i++) { if (i.ToString() == row2["lectureNo"].ToString()) { _drow3[i.ToString()] = "A"; } else { if (_drow3[i.ToString()].ToString() != "A") { _drow3[i.ToString()] = "-"; } } } _dt3.Rows.Add(_drow3); } _dt3.Rows.Add(_drow3); grd3.DataSource = _dt3; grd3.DataBind(); } if (count == 4) { Head5.Visible = true; Head5.Text = row["courseName"].ToString(); DataTable dt2 = objBL.get_lectures_from_Attendance(Session["New"].ToString(), row["courseID"].ToString(), row["sectionID"].ToString()); foreach (DataRow row2 in dt2.Rows) { for (int i = 1; i <= 28; i++) { if (i.ToString() == row2["lectureNo"].ToString()) { _drow4[i.ToString()] = "A"; } else { if (_drow4[i.ToString()].ToString() != "A") { _drow4[i.ToString()] = "-"; } } } } _dt4.Rows.Add(_drow4); grd4.DataSource = _dt4; grd4.DataBind(); } count++; } } }
public DataSet GetAuctionItemt( BLItem item, String parm, string commandtext, int buyerid, int orgid, int catid, int itemid, string status, String auctiontype, int auctionid) { DataSet ds = new DataSet(); ds = item.UpdateDonate(parm, commandtext, buyerid, orgid, catid, itemid, status, auctiontype, auctionid); // ds= messages.orgs_.Orgitems.Item.UpdateDonate( parm, commandtext, id, orgid, catid, itemid, status, auctiontype, auctionid); return ds; }
private void ClearFields() { this.created = DateTime.MinValue; this.uid = string.Empty; this.saveInfo = false; this.creditCard = null; this.billingAddress = null; this.shippingAddress = null; this.shoppingCart = null; this.category = null; this.billingAddress = new BLAddress(); this.shippingAddress = new BLAddress(); this.shoppingCart = new BLShoppingCart(); this.creditCard = new BLCreditCard(); this.items = new BLItems(); this.orders = new BLOrders(); this.category = new BLCategory(); this.item = new BLItem(); }
protected void FillDeptDropdownList() { BLItem objBL = new BLItem(); DataTable dt = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 3); DataTable dt1 = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 1); DropDownList0.DataSource = dt; DropDownList0.DataTextField = "courseName"; DropDownList0.DataValueField = "courseID"; DropDownList0.DataBind(); //DropDownList0.Items.Insert(0, "Select Course"); DropDownList0.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList1.DataSource = dt; DropDownList1.DataTextField = "courseName"; DropDownList1.DataValueField = "courseID"; DropDownList1.DataBind(); //DropDownList1.Items.Insert(0, "Select Course"); DropDownList1.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList2.DataSource = dt; DropDownList2.DataTextField = "courseName"; DropDownList2.DataValueField = "courseID"; DropDownList2.DataBind(); //DropDownList2.Items.Insert(0, "Select Course"); DropDownList2.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList3.DataSource = dt; DropDownList3.DataTextField = "courseName"; DropDownList3.DataValueField = "courseID"; DropDownList3.DataBind(); //DropDownList3.Items.Insert(0, "Select Course"); DropDownList3.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList4.DataSource = dt; DropDownList4.DataTextField = "courseName"; DropDownList4.DataValueField = "courseID"; DropDownList4.DataBind(); //DropDownList4.Items.Insert(0, "Select Course"); DropDownList4.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList5.DataSource = dt1; DropDownList5.DataTextField = "courseName"; DropDownList5.DataValueField = "courseID"; DropDownList5.DataBind(); //DropDownList5.Items.Insert(0, "Select Course"); DropDownList5.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList6.DataSource = dt1; DropDownList6.DataTextField = "courseName"; DropDownList6.DataValueField = "courseID"; DropDownList6.DataBind(); //DropDownList6.Items.Insert(0, "Select Course"); DropDownList6.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList7.DataSource = dt1; DropDownList7.DataTextField = "courseName"; DropDownList7.DataValueField = "courseID"; DropDownList7.DataBind(); //DropDownList7.Items.Insert(0, "Select Course"); DropDownList7.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList8.DataSource = dt1; DropDownList8.DataTextField = "courseName"; DropDownList8.DataValueField = "courseID"; DropDownList8.DataBind(); //DropDownList8.Items.Insert(0, "Select Course"); DropDownList8.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList9.DataSource = dt1; DropDownList9.DataTextField = "courseName"; DropDownList9.DataValueField = "courseID"; DropDownList9.DataBind(); //DropDownList9.Items.Insert(0, "Select Course"); DropDownList9.Items.Insert(0, new ListItem("Select Course", "-1")); }