Пример #1
0
    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = MyDAL.PopulateStudent();

        RadGrid1.DataSource = ResultTable;
    }
Пример #2
0
    protected void RBSubmit_Click(object sender, EventArgs e)
    {
        int       count              = 0;
        int       countStopper       = 0;
        string    StudentID          = "";
        string    SubjectID          = "";
        string    SubjectName        = "";
        AbcDAL    MyDAL              = new AbcDAL("");
        DataTable ResultTable        = MyDAL.PopulateClass();
        DataTable ResultTableSubject = MyDAL.SelectSubjectMasterByID(RCBSubject.SelectedValue.ToString().Trim());

        foreach (DataRow row in ResultTable.Rows)
        {
            SubjectName = ResultTableSubject.Rows[0]["SubjectName"].ToString().Trim();
            SubjectID   = ResultTable.Rows[count]["SubjectID"].ToString().Trim();
            StudentID   = ResultTable.Rows[count]["StudentID"].ToString().Trim();
            if (StudentID == RCBStudent.SelectedValue.ToString().Trim() && SubjectID == RCBSubject.SelectedValue.ToString().Trim())
            {
                countStopper++;
            }
            count++;
        }
        if (countStopper >= 1)
        {
            Response.Redirect("EnrollSubject.aspx?MsgPos=5&MsgType=warning&MsgContent=Student already exists in " + SubjectName.Trim());
        }
        else
        {
            MyDAL.AddClassMaster("Classs A", RCBSubject.SelectedValue, RCBStudent.SelectedValue);
            Response.Redirect("EnrollSubject.aspx?MsgPos=5&MsgType=warning&MsgContent=Success in Enrollment");
        }
    }
Пример #3
0
    public void PopulateSubjectGrid()
    {
        AbcDAL MyDAL = new AbcDAL("");

        RGSubjectGrid.DataSource = MyDAL.PopulateSubject();
        RGSubjectGrid.DataBind();
    }
Пример #4
0
    protected void RBEnrollStudent_Click(object sender, EventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.AddStudentMaster(RTBStudentName.Text, RTBPhoneNo.Text, RTBAddress.Text, RDPDob.SelectedDate.Value, "Tommy");

        Response.Redirect("saDefault.aspx");
    }
Пример #5
0
    protected void RBUpdate_Click(object sender, EventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.UpdateSubjectMaster(RCBSubjectName.SelectedValue, RTBUpdateName.Text);
        MyDAL.BindSubjectComboBox(RCBSubjectName);
        PopulateSubjectGrid();
    }
Пример #6
0
    public void StudentSearchBox()
    {
        AbcDAL MyDAL = new AbcDAL("");

        DataTable ResultTable = MyDAL.PopulateStudent();

        MyDAL.BindStudentCombobox(RCBStudentName);
    }
Пример #7
0
    public void DisplayData()
    {
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = MyDAL.PopulateStudent();

        RadGrid1.DataSource = ResultTable;
        RadGrid1.DataBind();
    }
Пример #8
0
    protected void RBCreateSubject_Click(object sender, EventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.AddSubjectMaster(RTBSubjectName.Text.Trim());
        PopulateSubjectGrid();
        MyDAL.BindSubjectComboBox(RCBSubjectName);
    }
Пример #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //PopulateStudentName();
     if (!IsPostBack)
     {
         AbcDAL MyDAL = new AbcDAL("");
         MyDAL.BindSubjectComboBox(RCBSubject);
     }
 }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        if (!IsPostBack)
        {
            PopulateStudentName();
        }
    }
Пример #11
0
    public void Piechart()
    {
        int    A     = 0;
        int    B     = 0;
        int    C     = 0;
        int    D     = 0;
        int    E     = 0;
        int    count = 0;
        AbcDAL MyDAL = new AbcDAL("");

        DataTable ResultTable      = MyDAL.SelectStudentByAuthID(1);
        string    StudentID        = ResultTable.Rows[0]["StudentID"].ToString().Trim();
        DataTable ResultTableClass = MyDAL.PopulateClassByStudentID(StudentID);

        RadChart radChart = new RadChart();

        radChart.ChartTitle.TextBlock.Text = "My RadChart";
        ChartSeries chartSeries = new ChartSeries();

        chartSeries.Name = "Overall Grade";
        chartSeries.Type = ChartSeriesType.Bar;
        // add new items to the series,
        // passing a value and a label string

        foreach (DataRow row in ResultTableClass.Rows)
        {
            if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "A")
            {
                A++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "B")
            {
                B++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "C")
            {
                C++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "D")
            {
                D++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "E")
            {
                E++;
            }
            count++;
        }
        chartSeries.AddItem(A, "A");
        chartSeries.AddItem(B, "B");
        chartSeries.AddItem(C, "C");
        chartSeries.AddItem(D, "D");
        chartSeries.AddItem(E, "E");

        RCStudent.AddChartSeries(chartSeries);
    }
Пример #12
0
    public void PopulateStudentName()
    {
        int    Present = 0;
        int    Absent  = 0;
        int    count   = 0;
        AbcDAL MyDAL   = new AbcDAL("");

        DataTable ResultTable = MyDAL.SelectStudentByAuthID(1);

        if (ResultTable.Rows.Count != 0)
        {
            Piechart();
            string StudentID = ResultTable.Rows[0]["StudentID"].ToString().Trim();

            RLName.Text    = ResultTable.Rows[0]["StudentName"].ToString();
            RLPhoneNo.Text = ResultTable.Rows[0]["PhoneNo"].ToString();
            RLAddress.Text = ResultTable.Rows[0]["Address"].ToString();

            DataTable ResultTableClass = MyDAL.PopulateClassByStudentID(StudentID);

            //string Attendance = ResultTableClass.Rows[0]["Attendance"].ToString().Trim();
            foreach (DataRow row in ResultTableClass.Rows)
            {
                if (ResultTableClass.Rows[count]["Attendance"].ToString().Trim() == "Present")
                {
                    Present++;
                }
                else
                {
                    Absent++;
                }
                count++;
            }
            if (Present == Absent)
            {
                RLAttendance.Text = "Fair";
            }

            else if (Present > Absent)
            {
                RLAttendance.Text = "Good";
            }
            else
            {
                RLAttendance.Text = "Poor";
            }
        }
        else
        {
            RLName.Text       = "Super Admin";
            RLAttendance.Text = "Super Admin has Logged in";
        }
    }
Пример #13
0
    protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        string           StudentID  = editedItem.GetDataKeyValue("StudentID").ToString().Trim(); // Works if you set the DataKeyValue as CustomerID

        string name    = (editedItem["StudentName"].Controls[0] as TextBox).Text;
        string address = (editedItem["Address"].Controls[0] as TextBox).Text;
        string DOB     = (editedItem["DOB"].Controls[0] as TextBox).Text;
        string phoneNo = (editedItem["PhoneNo"].Controls[0] as TextBox).Text;

        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.UpdStudentMaster(StudentID, name, phoneNo, address, Convert.ToDateTime(DOB));
    }
Пример #14
0
    protected void RBModify_Click(object sender, EventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        if (ClassID != null)
        {
            MyDAL.UpdateClassGradeByStudentID(RCBStudentName.SelectedValue.ToString().Trim(), RDDLAttendance.SelectedText, RDDLGrade.SelectedText, ClassID);
            Response.Redirect("Progress.aspx?MsgPos=5&MsgType=warning&MsgContent=Data successfully modified");
        }
        else
        {
            Response.Redirect("Progress.aspx?MsgPos=5&MsgType=warning&MsgContent=ERROR LAH WALAO");
        }
    }
Пример #15
0
    protected void RGSubjectGrid_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        Telerik.Web.UI.GridDataItem MyGridDataItem = e.Item as Telerik.Web.UI.GridDataItem;
        if (MyGridDataItem != null)
        {
            string SubjectID = (string)((GridDataItem)e.Item).GetDataKeyValue("SubjectID");


            MyDAL.DeleteSubjectMaster(SubjectID);
        }
        MyDAL.BindSubjectComboBox(RCBSubjectName);
    }
Пример #16
0
    public void DropdownlistGrade()
    {
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = new DataTable();

        ResultTable = MyDAL.PopulateClassByStudentID(RCBStudentName.SelectedValue.ToString().Trim());
        string grade;

        int count = 0;

        foreach (DataRow row in ResultTable.Rows)
        {
            grade = ResultTable.Rows[count]["Grade"].ToString().Trim();
            if (RCBSubject.SelectedValue.ToString().Trim() == ResultTable.Rows[count]["SubjectID"].ToString().Trim())
            {
                if (grade == "A")
                {
                    RDDLGrade.SelectedIndex = 1;
                    break;
                }
                else if (grade == "B")
                {
                    RDDLGrade.SelectedIndex = 2;
                    break;
                }
                else if (grade == "C")
                {
                    RDDLGrade.SelectedIndex = 3;
                    break;
                }
                else if (grade == "D")
                {
                    RDDLGrade.SelectedIndex = 4;
                    break;
                }
                else if (grade == "E")
                {
                    RDDLGrade.SelectedIndex = 5;
                    break;
                }
                else if (grade == "F")
                {
                    RDDLGrade.SelectedIndex = 6;
                    break;
                }
            }
            count++;
        }
    }
Пример #17
0
    protected void RCBStudentName_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        string Attendance = "";

        RLStudentName.Text = RCBStudentName.Text;
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = new DataTable();

        ResultTable = MyDAL.PopulateClassByStudentID(RCBStudentName.SelectedValue.ToString().Trim());
        int count     = 0;
        int countStop = 0;

        foreach (DataRow row in ResultTable.Rows)
        {
            Attendance = ResultTable.Rows[count]["Attendance"].ToString().Trim();
            if (RCBSubject.SelectedValue.ToString().Trim() == ResultTable.Rows[count]["SubjectID"].ToString().Trim())
            {
                DropdownlistGrade();
                ClassID = ResultTable.Rows[count]["ClassID"].ToString();
                if (Attendance == "Present")
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 0;
                    break;
                }
                else if (Attendance == "Absent")
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 1;
                    break;
                }
                else
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 2;
                    break;
                }
            }

            count++;
        }

        if (countStop == 0)
        {
            RDDLAttendance.SelectedIndex = 2;
        }
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int AuthorityID = 0;

        if (!IsPostBack)
        {
            AbcDAL    MyDAL       = new AbcDAL("");
            DataTable ResultTable = MyDAL.PopulateStudent();


            AuthorityID = Convert.ToInt32(ResultTable.Rows[0]["AuthorityID"]);     //Getting my field value
            if (AuthorityID != 1002)
            {
                Response.Redirect("~/default.aspx?MsgPos=5&MsgType=warning&MsgContent=You are not authorised to this function, No students allowed !!!!");
            }
        }
    }
Пример #19
0
    public void PopulateStudentName()
    {
        AbcDAL MyDAL = new AbcDAL("");

        DataTable ResultTable = MyDAL.SelectStudentByAuthID(1);
        string    StudentID   = ResultTable.Rows[0]["StudentID"].ToString().Trim();

        RLStudentName.Text = ResultTable.Rows[0]["StudentName"].ToString();
        DataTable ResultTableClass = MyDAL.PopulateClassByStudentIDSubjectID(StudentID, RCBSubject.SelectedValue.ToString().Trim());

        if (ResultTableClass.Rows.Count != 0)
        {
            RLGrade.Text      = ResultTableClass.Rows[0]["Grade"].ToString();
            RLAttendance.Text = ResultTableClass.Rows[0]["Attendance"].ToString().Trim();
        }
        else
        {
            RLGrade.Text      = "No record yet";
            RLAttendance.Text = "No record yet";
        }
    }
Пример #20
0
    protected void RBLogin_Click(object sender, EventArgs e)
    {
        string Login = "******";

        AbcDAL MyDal    = new AbcDAL("");
        string Username = "";



        if (RTBUsername.Text == "user" && RTBPassword.Text == "123")
        {
            MyDal.UpdateStudentAuth("STU1000001", 1002);
            Response.Redirect("~/default.aspx");
        }

        else
        {
            DataTable ResultTable = MyDal.SelectStudentByUserPass(RTBUsername.Text, RTBPassword.Text);
            for (int i = 0; i < ResultTable.Rows.Count; i++)                  //Looping through rows
            {
                Username = ResultTable.Rows[i]["Username"].ToString().Trim(); //Getting my field value
                var Password = ResultTable.Rows[i]["Password"];               //Getting my field value

                Login = "******";
            }
            if (Login == "123")
            {
                MyDal.UpdateStudentAuth(Username, 1);
                Response.Redirect("~/default.aspx");
            }
            else
            {
                Response.Redirect("login.aspx?MsgPos=5&MsgType=warning&MsgContent=You are not authorised to this function, User Wrong Login !!!!");
            }
        }
    }
Пример #21
0
    public void SubjectCombobox()
    {
        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.BindSubjectComboBox(RCBSubject);
    }
Пример #22
0
 protected void RCBSubject_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
 {
     //after selection student combobox will populate student that havent registered in this subject
     AbcDAL MyDAL = new AbcDAL("");
     //MyDAL.BindSubjectComboBox(RCBStudent);
 }
Пример #23
0
    protected void RGClassMaster_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        RGClassMaster.DataSource = MyDAL.PopulateClass();
    }
Пример #24
0
    protected void RGSubjectGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        AbcDAL MyDAL = new AbcDAL("");

        RGSubjectGrid.DataSource = MyDAL.PopulateSubject();
    }