public DataTable ReadStudents()
        {
            DAL.CONNECTION obj = new DAL.CONNECTION();
            obj.Open_Connection();
            DataTable MyQuery = obj.Query_Procedure("read_sp_students", new object[] { });

            obj.Close_Connection();
            return(MyQuery);
        }
        public DataTable ReadNotes()
        {
            DAL.CONNECTION obj = new DAL.CONNECTION();
            obj.Open_Connection();
            DataTable MyQuery = obj.simple_query("select name,course, note from information");

            obj.Close_Connection();
            return(MyQuery);
        }
Exemple #3
0
        public string DeleteStudents(int id)
        {
            DAL.CONNECTION obj = new DAL.CONNECTION();
            obj.Open_Connection();
            string message = "";
            var    result  = new SqlParameter("results", message)
            {
                SqlDbType = SqlDbType.VarChar,
                Size      = 70,
                Direction = ParameterDirection.InputOutput
            };

            obj.Execute_Procedure("Delete_Students", new object[]
            {
                new SqlParameter("id", id), result
            });
            obj.Close_Connection();
            message = result.Value.ToString();
            return(message);
        }
        public string InsertStudents(string name, string last, string section, string course, int note, string state)
        {
            DAL.CONNECTION obj = new DAL.CONNECTION();
            obj.Open_Connection();
            string message = "";
            var    result  = new SqlParameter("results", message)
            {
                SqlDbType = SqlDbType.VarChar,
                Size      = 70,
                Direction = ParameterDirection.InputOutput
            };

            obj.Execute_Procedure("Insert_Students", new object[]
            {
                new SqlParameter("name", name), new SqlParameter("lastname", last), new SqlParameter("section", section),
                new SqlParameter("course", course), new SqlParameter("note", note), new SqlParameter("state", state), result
            });
            obj.Close_Connection();
            message = result.Value.ToString();
            return(message);
        }