}     //end function

    public StudentDegree StudentDegreeSelectByID(int intDegreeID)
    {
        try
        {
            string sp_name = "StudentDegreeSelectByID";
            comStudentDegree.Parameters.AddWithValue("DegreeID", intDegreeID);
            ConnectAndExecute(sp_name); //no parameter will send to stored procedure
            if (dsStudentDegree.Tables[0].Rows.Count == 1)
            {
                DataRow       drStudentDegree  = dsStudentDegree.Tables[0].Rows[0];
                StudentDegree objStudentDegree = new StudentDegree();
                objStudentDegree.DegreeID        = Convert.ToInt64(drStudentDegree["DegreeID"]);
                objStudentDegree.DegreeName      = Convert.ToString(drStudentDegree["DegreeName"]);
                objStudentDegree.CreatedByID     = Convert.ToInt64(drStudentDegree["CreatedByID"]);
                objStudentDegree.CreatedDateTime = Convert.ToDateTime(drStudentDegree["CreatedDateTime"]);
                objStudentDegree.IsEnabled       = Convert.ToBoolean(drStudentDegree["IsEnabled"]);
                objStudentDegree.LastUpdateByID  = Convert.ToInt64(drStudentDegree["LastUpdateByID"]);
                objStudentDegree.LastUpdateTime  = Convert.ToDateTime(drStudentDegree["LastUpdateTime"]);
                objStudentDegree.Remarks         = Convert.ToString(drStudentDegree["Remarks"]);

                return(objStudentDegree);
            }
            return(null);
        }
        catch (Exception ex)
        {
            SetError(ex.Message);
            return(null);
        } //end try
    }     //end function
        private void btnSave_Click(object sender, EventArgs e)
        {
            StudentDegree degree = new StudentDegree();

            degree.DegreeID        = Convert.ToInt32(txtDegreeName.Tag);
            degree.DegreeName      = txtDegreeName.Text;
            degree.Remarks         = txtDegreeRemarks.Text;
            degree.CreatedByID     = Convert.ToInt32(this.Tag);
            degree.CreatedDateTime = System.DateTime.Now;
            degree.LastUpdateByID  = Convert.ToInt32(this.Tag);
            degree.LastUpdateTime  = System.DateTime.Now;
            degree.IsEnabled       = chkIsEnabled.Checked;
            long degree_id = degree.InsertUpdateStudentDegree();

            txtDegreeName.Tag = degree_id;
            if (degree_id > 0)
            {
                MessageBox.Show("Record Entered Successfully");
            }

            else
            {
                MessageBox.Show("Error: Degree Not Added");
            }
        }
    ///////////////////////////////////////////////////////////////////////////////////////////

    //Private Methods///////////////////////////////////////////////////////////////////////////

    //DB to Model//
    private void GenerateModelList()
    {
        StudentDegreeList.Clear();
        foreach (DataRow drStudentDegree in dsStudentDegree.Tables[0].Rows)
        {
            StudentDegree objStudentDegree = new StudentDegree();
            objStudentDegree.DegreeID        = Convert.ToInt64(drStudentDegree["DegreeID"]);
            objStudentDegree.DegreeName      = Convert.ToString(drStudentDegree["DegreeName"]);
            objStudentDegree.CreatedByID     = Convert.ToInt64(drStudentDegree["CreatedByID"]);
            objStudentDegree.CreatedDateTime = Convert.ToDateTime(drStudentDegree["CreatedDateTime"]);
            objStudentDegree.IsEnabled       = Convert.ToBoolean(drStudentDegree["IsEnabled"]);
            objStudentDegree.LastUpdateByID  = Convert.ToInt64(drStudentDegree["LastUpdateByID"]);
            objStudentDegree.LastUpdateTime  = Convert.ToDateTime(drStudentDegree["LastUpdateTime"]);
            objStudentDegree.Remarks         = Convert.ToString(drStudentDegree["Remarks"]);

            StudentDegreeList.Add(objStudentDegree);
        }
    }
Ejemplo n.º 4
0
    public static Int64 InsertUpdateStudentDegree(StudentDegree objIUStudentDegree)
    {
        Int64 new_id = objIUStudentDegree.InsertUpdateStudentDegree();

        return(new_id);
    }
Ejemplo n.º 5
0
        private void Daly_Tick(object sender, EventArgs e)
        {
            Daly.Stop();
            List <StudentDegree> studentDegrees = new List <StudentDegree>();

            studentDegrees      = StudentDegreeController.StudentDegreeSelectAll();
            lblTotalDegree.Text = studentDegrees.Count.ToString();
            StudentDegree studentDegree = new StudentDegree();

            studentDegrees = studentDegree.StudentDegreeSelectAll();
            List <StudentProgram> studentPrograms = new List <StudentProgram>();
            StudentProgram        studentProgram  = new StudentProgram();

            studentPrograms      = studentProgram.StudentProgramSelectAll();
            lblProgramTotal.Text = studentPrograms.Count.ToString();
            List <CollageAdmin> collageAdmins = CollageAdminController.CollageAdminSelectAll();

            lblTotalAdmin.Text = collageAdmins.Count.ToString();
            List <StudentPersonalInfo> studentPersonalInfos = StudentPersonalInfoController.StudentPersonalInfoSelectAll();

            lblTotalStudent.Text = studentPersonalInfos.Count.ToString();
            List <StudentSections> studentSections = StudentSectionsController.StudentSectionsSelectAll();

            lblTotalSection.Text = studentSections.Count.ToString();
            Bunifu.DataViz.Data      data      = new Bunifu.DataViz.Data();
            Bunifu.DataViz.DataPoint dataPoint = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuCharts._type.column);
            Random r = new Random();

            dataPoint.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());


            data.addData(dataPoint);
            CollumChart.Render(data);
            Bunifu.DataViz.Data      data1      = new Bunifu.DataViz.Data();
            Bunifu.DataViz.DataPoint dataPoint2 = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuCharts._type.pie);

            dataPoint2.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint2.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint2.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint2.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint2.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());


            data1.addData(dataPoint2);
            bunifuCharts1.Render(data1);
            Bunifu.DataViz.Data data2 = new Bunifu.DataViz.Data();

            Bunifu.DataViz.DataPoint dataPoint3 = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuCharts._type.spline);

            dataPoint3.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint3.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint3.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());

            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint3.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());


            data2.addData(dataPoint3);
            bunifuCharts2.Render(data2);

            Bunifu.DataViz.Data data3 = new Bunifu.DataViz.Data();

            Bunifu.DataViz.DataPoint dataPoint4 = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuCharts._type.area);

            dataPoint4.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint4.addLabely("Users", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint4.addLabely("Degrees", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentDegrees.Count.ToString())).ToString());
            dataPoint4.addLabely("Program", r.Next(0, Convert.ToInt32(studentPrograms.Count.ToString())).ToString());


            data3.addData(dataPoint4);
            bunifuCharts3.Render(data3);
        }