public string PostAddAttendence(Attendence attendence)
        {
            int           student_id  = 0;
            string        ck          = null;
            SystemContext context     = HttpContext.RequestServices.GetService(typeof(Exam_Management_System.Models.SystemContext)) as SystemContext;
            int           academic_id = context.GetAcademic().Id;

            using (MySqlConnection conn1 = context.GetConnection())
            {
                conn1.Open();
                MySqlCommand cmd1 = new MySqlCommand("SELECT * FROM studentrollno where rollno='" + attendence.Rollno + "' and academic_id=" + academic_id, conn1);

                using (var reader = cmd1.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        student_id = Convert.ToInt32(reader["id"]);
                    }
                }
                conn1.Close();
            }
            if (context.CheckAttendence(student_id, attendence.Month, academic_id) == 0)
            {
                using (MySqlConnection conn = context.GetConnection())
                {
                    conn.Open();
                    string sql = $"Insert Into attendance (studentrollno_id,month,total,current,academic_id) Values ('{student_id}','{attendence.Month}','{attendence.Total}','{attendence.Current}','{academic_id}')";
                    using (MySqlCommand command = new MySqlCommand(sql, conn))
                    {
                        command.ExecuteNonQuery();
                        conn.Close();
                    }
                }
                ck = "OK";
            }
            else
            {
                ck = "NO";
            }
            return(ck);
            //return Redirect("/attendence/addAttendence");
        }