public EL.Registrations.students Select(EL.Registrations.students studentEL)
        {
            var dt = Helper.executeQuery("select * from students_view where `ID` = '" + studentEL.Studentid + "'");

            if (dt.Rows.Count > 0)
            {
                studentEL.Studentid          = Convert.ToInt32(dt.Rows[0]["ID"].ToString());
                studentEL.Strandid           = Convert.ToInt32(dt.Rows[0]["STRAND ID"].ToString());
                studentEL.Lrn                = dt.Rows[0]["LRN"].ToString();
                studentEL.Lastname           = dt.Rows[0]["LAST NAME"].ToString();
                studentEL.Firstname          = dt.Rows[0]["FIRST NAME"].ToString();
                studentEL.Middleinitial      = dt.Rows[0]["MIDDLE INITIAL"].ToString();
                studentEL.Gender             = dt.Rows[0]["GENDER"].ToString();
                studentEL.Address            = dt.Rows[0]["ADDRESS"].ToString();
                studentEL.Parentsorguardian  = dt.Rows[0]["PARENTS OR GUARDIAN"].ToString();
                studentEL.Contactnumber      = dt.Rows[0]["CONTACT NUMBER"].ToString();
                studentEL.Lastschoolattended = dt.Rows[0]["LAST SCHOOL ATTENDED"].ToString();
                studentEL.Schoolyear         = dt.Rows[0]["SCHOOL YEAR"].ToString();
                studentEL.Yearlevel          = dt.Rows[0]["YEAR LEVEL"].ToString();
                return(studentEL);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private void LoadReport(EL.Registrations.students studentEL)
        {
            var crvStudents = new crvStudents();

            crvStudents.Database.Tables["students_view"].SetDataSource(studentBL.List(studentEL));


            crv.ReportSource = null;
            crv.ReportSource = crvStudents;
            crv.Refresh();
        }
        private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            studentEL.Studentid = Convert.ToInt32(dgv.SelectedRows[0].Cells["ID"].Value);

            if (e.ColumnIndex == 0)
            {
                lblTitle.Text = "EDIT STUDENT INFORMATION";
                s             = "EDIT";
                ShowForm(true);

                studentEL         = studentBL.Select(studentEL);
                strandEL.Strandid = studentEL.Strandid;
                strandEL          = strandBL.Select(strandEL);

                txtLRN.Text                     = studentEL.Lrn;
                txtLastName.Text                = studentEL.Lastname;
                txtFirstName.Text               = studentEL.Firstname;
                txtMiddleInitial.Text           = studentEL.Middleinitial;
                cbGender.SelectedIndex          = cbGender.FindString(studentEL.Gender);
                txtAddress.Text                 = studentEL.Address;
                txtParentsOrGuardian.Text       = studentEL.Parentsorguardian;
                txtContactNumber.Text           = studentEL.Contactnumber;
                txtLastSchoolAttended.Text      = studentEL.Lastschoolattended;
                txtSchoolYear.Text              = studentEL.Schoolyear;
                cbPreferredStrand.SelectedIndex = cbPreferredStrand.FindString(strandEL.Strand);
                cbYearLevel.SelectedIndex       = cbYearLevel.FindString(studentEL.Yearlevel);
            }

            if (e.ColumnIndex == 1)
            {
                switch (MessageBox.Show(this, "ARE YOU SURE TO DELETE THIS SELECTED ITEM?", "Deleting", MessageBoxButtons.YesNo))
                {
                case DialogResult.No:
                    break;

                default:
                    ShowResult(studentBL.Delete(studentEL));
                    break;
                }
            }
        }
 public bool Delete(EL.Registrations.students studentEL)
 {
     return(Helper.executeNonQueryBool("delete from students where studentid = '" + studentEL.Studentid + "'"));
 }
 public bool Update(EL.Registrations.students studentEL)
 {
     return(Helper.executeNonQueryBool("update students set strandid = '" + studentEL.Strandid + "', lastname = '" + studentEL.Lastname + "', firstname = '" + studentEL.Firstname + "', middleinitial = '" + studentEL.Middleinitial + "', gender = '" + studentEL.Gender + "',address = '" + studentEL.Address + "', parentsorguardian = '" + studentEL.Parentsorguardian + "', contactnumber = '" + studentEL.Contactnumber + "', lastschoolattended = '" + studentEL.Lastschoolattended + "', schoolyear = '" + studentEL.Schoolyear + "', yearlevel = '" + studentEL.Yearlevel + "' where studentid = '" + studentEL.Studentid + "'"));
 }
 public long Insert(EL.Registrations.students studentEL)
 {
     return(Helper.executeNonQueryLong("insert into students (strandid, lrn, lastname, firstname, middleinitial, gender, address, parentsorguardian, contactnumber, lastschoolattended, schoolyear, yearlevel, dateadded) values ('" + studentEL.Strandid + "', '" + studentEL.Lrn + "', '" + studentEL.Lastname + "', '" + studentEL.Firstname + "', '" + studentEL.Middleinitial + "', '" + studentEL.Gender + "','" + studentEL.Address + "', '" + studentEL.Parentsorguardian + "', '" + studentEL.Contactnumber + "', '" + studentEL.Lastschoolattended + "', '" + studentEL.Schoolyear + "', '" + studentEL.Yearlevel + "', '" + studentEL.Dateadded + "')"));
 }
 public DataTable List(EL.Registrations.students studentEL)
 {
     return(Helper.executeQuery("select `ID`, `LRN`, `FULL NAME`, `STRAND`, `YEAR LEVEL`,`DATE ADDED`, `C`  from students_view where `STRAND ID` = '" + studentEL.Strandid + "' and `YEAR LEVEL` = '" + studentEL.Yearlevel + "'"));
 }
 public bool Delete(EL.Registrations.students studentEL)
 {
     return(studentDL.Delete(studentEL));
 }
 public bool Update(EL.Registrations.students studentEL)
 {
     return(studentDL.Update(studentEL));
 }
Esempio n. 10
0
 public long Insert(EL.Registrations.students studentEL)
 {
     return(studentDL.Insert(studentEL));
 }
Esempio n. 11
0
 public EL.Registrations.students Select(EL.Registrations.students studentEL)
 {
     return(studentDL.Select(studentEL));
 }
Esempio n. 12
0
 public DataTable List(EL.Registrations.students studentEL)
 {
     return(studentDL.List(studentEL));
 }