Esempio n. 1
0
        public static int Insert(CourseGrade s)
        {
            string statement = $"insert into course_grade columns(Grade_English,Grade_Arabic,OrderCode,Points,Percentage,semesterID,Notes) values('{s.Grade_English}','{s.Grade_Arabic}',{s.OrderCode},'{s.Points}',{s.Percentage},{s.semesterID},'{s.Notes}')";
            var    affected  = DBManager.ExecuteNonQuery(statement);

            return(affected);
        }
Esempio n. 2
0
        public static int Update(CourseGrade s)
        {
            string stataement = $"update course_grade set Grade_English='{s.Grade_English}',Grade_Arabic='{s.Grade_Arabic}',OrderCode={s.OrderCode},Points='{s.Points}',Percentage='{s.Percentage}',semesterID={s.semesterID},Notes='{s.Notes}' where ID={s.ID}";
            int    affected   = DBManager.ExecuteNonQuery(stataement);

            return(affected);
        }
Esempio n. 3
0
        public static CourseGrade GetById(int id)
        {
            string statement = $"select * from course_grade where ID={id}";
            var    ds        = DBManager.ExecuteQuery(statement);
            var    item      = ds.Tables[0].Rows[0];
            var    gp        = new CourseGrade
            {
                ID            = int.Parse(item["ID"].ToString()),
                Grade_English = item["Grade_English"].ToString(),
                Grade_Arabic  = item["Grade_Arabic"].ToString(),
                OrderCode     = int.Parse(item["OrderCode"].ToString()),
                Points        = (item["Points"].ToString()),
                Percentage    = (item["Percentage"].ToString()),
                semesterID    = int.Parse(item["semesterID"].ToString()),
                Notes         = item["Notes"].ToString()
            };

            return(gp);
        }