/// <summary>
 /// This function used to insert the Attendence Record in ClassAttendance List
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void AttendenceRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.CA1.Clear();
             while (reader.Read())
             {
                 ClassAttendence Ca = new ClassAttendence();
                 Ca.Id1             = Convert.ToInt32(reader[0]);
                 Ca.AttendenceDate1 = Convert.ToDateTime(reader[1]);
                 Lt1.addIntoAttendence(Ca);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
 /// <summary>
 /// This function used to insert the AssessmentComponent Record in AssessmentComList
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void AssCRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.RemoveFromASSCom();
             while (reader.Read())
             {
                 AssessmentComClass ASS = new AssessmentComClass();
                 ASS.Id1           = Convert.ToInt32(reader[0]);
                 ASS.Name1         = reader[1].ToString();
                 ASS.RubricId1     = Convert.ToInt32(reader[2]);
                 ASS.TotalMarks1   = Convert.ToInt32(reader[3]);
                 ASS.DateCreated1  = Convert.ToDateTime(reader[4]);
                 ASS.DateUpdated1  = Convert.ToDateTime(reader[5]);
                 ASS.AssessmentId1 = Convert.ToInt32(reader[6]);
                 Lt1.AddASSComList(ASS);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
 /// <summary>
 /// This function used to insert the StudentResult record in StudentResult List
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void StudentResultRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.RemoveFromSTR();
             while (reader.Read())
             {
                 StudentResultClass SRC = new StudentResultClass();
                 SRC.StudentId1         = Convert.ToInt32(reader[0]);
                 SRC.AssessmentComId1   = Convert.ToInt32(reader[1]);
                 SRC.RubricMeasurement1 = Convert.ToInt32(reader[2]);
                 SRC.EvaluationDate1    = Convert.ToDateTime(reader[3]);
                 Lt1.AddSTRList(SRC);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
        /// <summary>
        /// This Function is used to get the Name of the assessmentComponentList
        /// </summary>
        /// <param name="query">Indicate the Query</param>
        public void NameForAssementComList(string query)
        {
            try
            {
                ListofClasses l = new ListofClasses();

                SqlCommand command = new SqlCommand(query, conn);
                if (conn.State != System.Data.ConnectionState.Open)
                {
                    conn.Open();
                }
                SqlDataReader reader;
                reader = command.ExecuteReader();
                l.ASSname1.Clear();
                while (reader.Read())
                {
                    l.AddIntoAssnameList(reader[0].ToString());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
        }
 /// <summary>
 /// This function used to insert the RubricLevel record in RubricLevel List
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void ShowRubricLevelRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.RemoveFromRubricLevel();
             while (reader.Read())
             {
                 RubricLevelClass RL = new RubricLevelClass();
                 RL.Id = Convert.ToInt32(reader[0]);
                 int rubricid = Convert.ToInt32(reader[1]);
                 RL.Details1     = reader[2].ToString();
                 RL.Measurement1 = Convert.ToInt32(reader[3]);
                 string myquery = "select Details FROM Rubric where Id = '" + rubricid + "'";
                 RL.RubricName1 = Cloname(myquery);
                 Lt1.AddRubricLevelList(RL);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
 /// <summary>
 /// This function insert the CLO record in the CLORecordList
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void Show_CLoRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.CLOList.Clear();
             while (reader.Read())
             {
                 CLOClass Clo = new CLOClass();
                 Clo.Id1         = Convert.ToInt32(reader[0]);
                 Clo.Name        = reader[1].ToString();
                 Clo.DateCreated = Convert.ToDateTime(reader[2]);
                 Clo.DateUpdated = Convert.ToDateTime(reader[3]);
                 Lt1.AddIntoCLoList(Clo);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
 /// <summary>
 /// This function used to insert the StudentAttendance record in studentAttendance List
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void StudentAttendenceRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.SAC1.Clear();
             while (reader.Read())
             {
                 StudentAttendenceClass SRC = new StudentAttendenceClass();
                 SRC.StudentId1        = Convert.ToInt32(reader[1]);
                 SRC.AttendanceId1     = Convert.ToInt32(reader[0]);
                 SRC.AttendanceStatus1 = Convert.ToInt32(reader[2]);
                 Lt1.addIntoStudentAttendence(SRC);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
 /// <summary>
 /// This function used to insert the CloWiseResult record in ClowiseResult List
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void ClowiseResultRecord(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.CloReport1.Clear();
             while (reader.Read())
             {
                 GenerateReport st1 = new GenerateReport();
                 st1.RegistrationNumber1 = reader[0].ToString();
                 st1.CloName1            = reader[1].ToString();
                 st1.TotalMarks1         = Convert.ToInt32(reader[2]);
                 st1.ObtainMarks1        = Convert.ToInt32(reader[3]);
                 Lt1.addIntoCloReport(st1);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
示例#9
0
        private void ClodataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            CLOClass        sc    = new CLOClass();
            ListofClasses   lt    = new ListofClasses();
            int             index = ClodataGridView.CurrentCell.RowIndex;
            DataGridViewRow r     = ClodataGridView.Rows[index];
            int             id    = Convert.ToInt32(r.Cells[0].Value);

            if (ClodataGridView.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete?" + id, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    sc.Delete(id);
                    MessageBox.Show("Data hes been deleted successfully");
                    Clo_Management_Load_1(sender, e);
                }
                else
                {
                    return;
                }
            }
            if (ClodataGridView.Columns[e.ColumnIndex].Name == "Edit")
            {
                CloName.Text      = r.Cells[1].Value.ToString().Trim();
                DateCreated.Value = Convert.ToDateTime(r.Cells[2].Value);
                DateUpdated.Value = Convert.ToDateTime(r.Cells[3].Value);
                globalindex2      = id;
                if (Add.Visible)
                {
                    Add.Visible = false;
                }
            }
        }
        public void comoboxvalues()
        {
            StudentResultClass SR  = new StudentResultClass();
            ListofClasses      lt1 = new ListofClasses();

            SR.addRubricname();
            int length = lt1.Cloname.Count();

            RubricLSelection.Items.Clear();

            for (int i = 0; i < length; i++)
            {
                RubricLSelection.Items.Add(lt1.Cloname.ElementAt(i));
            }
            SR.addStudentname();
            int length1 = lt1.Studentname.Count();

            StudentName1.Items.Clear();

            for (int i = 0; i < length1; i++)
            {
                StudentName1.Items.Add(lt1.Studentname.ElementAt(i));
            }
            SR.AddASSname();
            int length3 = lt1.Assessment1.Count();

            AssessmentSel.Items.Clear();

            for (int i = 0; i < length3; i++)
            {
                AssessmentSel.Items.Add(lt1.Assessment1.ElementAt(i));
            }
        }
 /// <summary>
 /// This function insert the student record in the StudentRecordList
 /// </summary>
 /// <param name="query">Query to retrieve the data from database</param>
 public void Show_Record(string query)
 {
     try
     {
         SqlCommand command = new SqlCommand(query, conn);
         conn.Open();
         SqlDataReader reader;
         reader = command.ExecuteReader();
         if (reader.HasRows)
         {
             ListofClasses Lt1 = new ListofClasses();
             Lt1.StudentList.Clear();
             while (reader.Read())
             {
                 StudentClass st1 = new StudentClass();
                 st1.Id1                = Convert.ToInt32(reader[0]);
                 st1.FirstName          = reader[1].ToString();
                 st1.LastName           = reader[2].ToString();
                 st1.Contact            = reader[3].ToString();
                 st1.Email              = reader[4].ToString();
                 st1.RegistrationNumber = reader[5].ToString();
                 st1.Status             = Convert.ToInt32(reader[6]);
                 Lt1.addIntolist(st1);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         conn.Close();
     }
 }
        private void RubLevelRecord_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            RubricLevelClass Rub  = new RubricLevelClass();
            ListofClasses    lt   = new ListofClasses();
            int             index = RubLevelRecord.CurrentCell.RowIndex;
            DataGridViewRow r     = RubLevelRecord.Rows[index];
            int             id    = Convert.ToInt32(r.Cells[0].Value);

            if (RubLevelRecord.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete data against the id ?" + id, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    Rub.Delete(id);
                    MessageBox.Show("Data has been Deleted successfully");
                    RubLevelRecord.DataSource = null;
                    RubricLevelindex_Load(sender, e);
                }
                else
                {
                    return;
                }
            }
            if (RubLevelRecord.Columns[e.ColumnIndex].Name == "Edit")
            {
                Details.Text = r.Cells[1].Value.ToString();
                MeasurementcomboBox1.Text = r.Cells[2].Value.ToString();
                globalindex = id;
            }
        }
        private void RubricLevelindex_Load(object sender, EventArgs e)
        {
            ListofClasses    lt  = new ListofClasses();
            RubricLevelClass Rlb = new RubricLevelClass();

            Rlb.RubricLRecord();
            RubLevelRecord.DataSource = lt.RLC;
        }
        private void Assessment_Load(object sender, EventArgs e)
        {
            AssessmentClass ASS = new AssessmentClass();
            ListofClasses   lt1 = new ListofClasses();

            ASS.ASSRecord();
            AssessmentRecord.DataSource = lt1.ASSC1;
        }
示例#15
0
        private void StudentForm_Load(object sender, EventArgs e)
        {
            StudentClass  st1 = new StudentClass();
            ListofClasses lt1 = new ListofClasses();

            st1.StudentRecord();
            StudentRecord.DataSource = null;
            StudentRecord.DataSource = lt1.StudentList;
        }
示例#16
0
        private void My_Own_Load()
        {
            RubricsClass  Rub = new RubricsClass();
            ListofClasses lt1 = new ListofClasses();

            Rub.RubricRecord();
            RubricsDetail.DataSource = lt1.RubList;
            comoboxvalues();
        }
示例#17
0
        private void Clo_Management_Load_1(object sender, EventArgs e)
        {
            CLOClass      clo = new CLOClass();
            ListofClasses lt1 = new ListofClasses();

            clo.CloRecord();
            ClodataGridView.DataSource = null;
            ClodataGridView.DataSource = lt1.CLOList;
        }
        private void AssessmentWiseReport_Load(object sender, EventArgs e)
        {
            ListofClasses lt = new ListofClasses();

            GenerateReport Gr = new GenerateReport();

            Gr.AssessmentWiseReport();
            ASSWiseReport.DataSource = null;
            ASSWiseReport.DataSource = lt.CloReport1;
        }
        private void CloReport_Load(object sender, EventArgs e)
        {
            ListofClasses lt = new ListofClasses();

            GenerateReport Gr = new GenerateReport();

            Gr.CLOwiseReport();
            CloWiseReport.DataSource = null;
            CloWiseReport.DataSource = lt.CloReport1;
        }
        private void My_Own_Load()
        {
            AssessmentComClass Acc = new AssessmentComClass();
            ListofClasses      lt1 = new ListofClasses();

            Acc.AssComRecord();
            AssessmentRecord.DataSource = null;
            AssessmentSelection.Text    = "";
            AssessmentRecord.DataSource = lt1.ASSCom1;
            comoboxvalues();
        }
        private void My_Own_Load()
        {
            StudentResultClass Acc = new StudentResultClass();
            ListofClasses      lt1 = new ListofClasses();

            Acc.Record();
            StudentResultRecord.DataSource = null;
            AssessmentSelection.Text       = "";
            AssessmentSel.Text             = "";
            StudentResultRecord.DataSource = lt1.STR1;
            comoboxvalues();
        }
        private void Attendence_Load(object sender, EventArgs e)
        {
            if (Save.Visible)
            {
                Save.Visible = false;
            }
            ClassAttendence CA  = new ClassAttendence();
            ListofClasses   lt1 = new ListofClasses();

            CA.ATTendenceRecord();
            ClassAttendenceRecord.DataSource = null;
            ClassAttendenceRecord.DataSource = lt1.CA1;
        }
        private void StudentAttendence_Load(object sender, EventArgs e)
        {
            StudentAttendenceClass Acc = new StudentAttendenceClass();
            ListofClasses          lt1 = new ListofClasses();

            StudentAttendenceRecord.DataSource = null;
            Acc.Record();
            StudentName1.Text                  = "";
            AttendenceAtatus.Text              = "";
            AttendencedateComobox.Text         = "";
            StudentAttendenceRecord.DataSource = lt1.SAC1;
            comoboxvalues();
        }
        private void AssessmentRecord_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            AssessmentComClass ACC = new AssessmentComClass();
            ListofClasses      lt  = new ListofClasses();
            int index = AssessmentRecord.CurrentCell.RowIndex;

            DataGridViewRow r  = AssessmentRecord.Rows[index];
            int             id = Convert.ToInt32(r.Cells[0].Value);

            if (AssessmentRecord.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete data against the id ?" + id, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    ACC.Delete(id);
                    MessageBox.Show("Data Has been deleted successfully");
                    AssessmentRecord.DataSource = null;
                    My_Own_Load();
                    if (ADD.Visible == false)
                    {
                        ADD.Visible = true;
                    }
                }
                else
                {
                    return;
                }
            }
            if (AssessmentRecord.Columns[e.ColumnIndex].Name == "Edit")
            {
                AssessmentComClass acc = new AssessmentComClass();
                comoboxvalues();
                ASSName.Text = r.Cells[1].Value.ToString();

                int rubricid = Convert.ToInt32(r.Cells[2].Value);
                RubricSelection.SelectedText = acc.NameofRubricId(rubricid);
                int ASSid = Convert.ToInt32(r.Cells[6].Value);
                AssessmentSelection.SelectedText = acc.NameofASSId(ASSid);
                TotalMarks.Text   = r.Cells[3].Value.ToString();
                DateCreated.Value = Convert.ToDateTime(r.Cells[4].Value);
                DateUpdated.Value = Convert.ToDateTime(r.Cells[5].Value);

                globalindex = id;
                if (ADD.Visible)
                {
                    ADD.Visible = false;
                }
            }
        }
        public void AssessmentComponent(string ASSValue)
        {
            StudentResultClass SR  = new StudentResultClass();
            ListofClasses      lt1 = new ListofClasses();

            SR.addAssessmentname(ASSValue);
            int length2 = lt1.ASSname1.Count();

            AssessmentSelection.Items.Clear();

            for (int i = 0; i < length2; i++)
            {
                AssessmentSelection.Items.Add(lt1.ASSname1.ElementAt(i));
            }
        }
        public void comoboxvalues()
        {
            AssessmentComClass Rub = new AssessmentComClass();
            ListofClasses      lt1 = new ListofClasses();

            Rub.addRubricname();
            int length = lt1.Cloname.Count();

            RubricSelection.Items.Clear();

            for (int i = 0; i < length; i++)
            {
                RubricSelection.Items.Add(lt1.Cloname.ElementAt(i));
            }
        }
        private void StudentResultRecord_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            StudentResultClass STR = new StudentResultClass();
            ListofClasses      lt  = new ListofClasses();
            int index = StudentResultRecord.CurrentCell.RowIndex;

            DataGridViewRow r     = StudentResultRecord.Rows[index];
            int             STUid = Convert.ToInt32(r.Cells[0].Value);
            int             ASSid = Convert.ToInt32(r.Cells[1].Value);

            if (StudentResultRecord.Columns[e.ColumnIndex].Name == "DeleteSr")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete data against the id ?" + STUid, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    STR.Delete(STUid, ASSid);
                    StudentResultRecord.DataSource = null;
                    My_Own_Load();
                    if (ADD.Visible == false)
                    {
                        ADD.Visible = true;
                    }
                }
                else
                {
                    return;
                }
            }
            if (StudentResultRecord.Columns[e.ColumnIndex].Name == "EditSR")
            {
                StudentResultClass SC = new StudentResultClass();
                comoboxvalues();
                StudentName1.Text = SC.RegistrationNoStudent(Convert.ToInt32(r.Cells[0].Value));
                int rubricid = Convert.ToInt32(r.Cells[2].Value);
                RubricLSelection.SelectedText = SC.NameofRubricId(rubricid);
                int ASS = Convert.ToInt32(r.Cells[1].Value);
                AssessmentSelection.SelectedText = SC.NameofASSComId(ASS);
                AssessmentSel.SelectedText       = SC.NameofASSId(ASS);
                EvaluateDate.Value = Convert.ToDateTime(r.Cells[3].Value);
                globalindex        = Convert.ToInt32(r.Cells[0].Value);
                globalindex2       = Convert.ToInt32(r.Cells[1].Value);
                if (ADD.Visible)
                {
                    ADD.Visible = false;
                }
            }
        }
        private void StudentAttendenceRecord_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            StudentAttendenceClass STR = new StudentAttendenceClass();
            ListofClasses          lt  = new ListofClasses();
            int index = StudentAttendenceRecord.CurrentCell.RowIndex;

            DataGridViewRow r     = StudentAttendenceRecord.Rows[index];
            int             STUid = Convert.ToInt32(r.Cells[0].Value);
            int             ASSid = Convert.ToInt32(r.Cells[1].Value);

            if (StudentAttendenceRecord.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete data against the id ?" + STUid, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    STR.Delete(ASSid, STUid);
                    MessageBox.Show("Data has been deleted successfully");
                    StudentAttendenceRecord.DataSource = null;
                    StudentAttendence_Load(sender, e);
                    if (ADD.Visible == false)
                    {
                        ADD.Visible = true;
                    }
                }
                else
                {
                    return;
                }
            }
            if (StudentAttendenceRecord.Columns[e.ColumnIndex].Name == "Edit")
            {
                StudentAttendenceClass SC = new StudentAttendenceClass();
                comoboxvalues();
                StudentName1.Text = SC.RegistrationNoStudent(Convert.ToInt32(r.Cells[1].Value));
                int ATTId = Convert.ToInt32(r.Cells[0].Value);
                AttendencedateComobox.SelectedText = SC.AttendenceDate(ATTId);
                int ASS = Convert.ToInt32(r.Cells[2].Value);
                AttendenceAtatus.SelectedText = SC.Staus(ASS);
                globalindex  = Convert.ToInt32(r.Cells[1].Value);
                globalindex2 = Convert.ToInt32(r.Cells[0].Value);
                if (ADD.Visible)
                {
                    ADD.Visible = false;
                }
            }
        }
示例#29
0
        private void RubricsDetail_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            RubricsClass  Rub   = new RubricsClass();
            ListofClasses lt    = new ListofClasses();
            int           index = RubricsDetail.CurrentCell.RowIndex;

            datagridviewindex = index;
            DataGridViewRow r  = RubricsDetail.Rows[index];
            int             id = Convert.ToInt32(r.Cells[0].Value);

            if (RubricsDetail.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete data against the id ?" + id, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    Rub.Delete(id);
                    MessageBox.Show("Data has been deleted successfylly");
                    RubricsDetail.DataSource  = null;
                    Details.Text              = " ";
                    Closelection.SelectedText = " ";
                    My_Own_Load();
                    if (Add.Visible == false)
                    {
                        Add.Visible = true;
                    }
                }
                else
                {
                    return;
                }
            }
            if (RubricsDetail.Columns[e.ColumnIndex].Name == "Edit")
            {
                comoboxvalues();
                Details.Text = r.Cells[2].Value.ToString();
                CLO          = r.Cells[1].Value.ToString();
                Closelection.SelectedText = CLO;
                globalindex = id;
                if (Add.Visible)
                {
                    Add.Visible = false;
                }
            }
        }
        private void ClassAttendenceRecord_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            ClassAttendence CA    = new ClassAttendence();
            ListofClasses   lt    = new ListofClasses();
            int             index = ClassAttendenceRecord.CurrentCell.RowIndex;
            DataGridViewRow r     = ClassAttendenceRecord.Rows[index];
            int             id    = Convert.ToInt32(r.Cells[0].Value);

            if (ClassAttendenceRecord.Columns[e.ColumnIndex].Name == "Delete")
            {
                DialogResult result = MessageBox.Show("Do You Want to delete?" + id, "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result.Equals(DialogResult.OK))
                {
                    CA.Delete(id);
                    MessageBox.Show("Data has been deleted successfully");
                    Attendence_Load(sender, e);
                    MessageBox.Show("id of the selested row is" + id);
                }
                else
                {
                    return;
                }
            }
            if (ClassAttendenceRecord.Columns[e.ColumnIndex].Name == "Edit")
            {
                AttendenceDatepicker.Value = Convert.ToDateTime(r.Cells[1].Value);
                globalindex = id;
                if (ADD.Visible)
                {
                    ADD.Visible = false;
                }
                if (Save.Visible == false)
                {
                    Save.Visible = true;
                }
            }
            if (ClassAttendenceRecord.Columns[e.ColumnIndex].Name == "StudentAttendence")
            {
                globalindex = id;
            }
        }