예제 #1
0
파일: QueryDAL.cs 프로젝트: MungerLi/Charge
        public IList <Entity.Student> SelectUser(Entity.Student student)
        {
            SqlParameter[]         sqlParams = { new SqlParameter("@StudentNo", student.StudentNo) };
            string                 sql       = "select * from Student_info where StudentNo =@StudentNo";
            DataTable              table     = DAL.sqlhelper.GetDatable(sql, CommandType.Text, sqlParams);
            IList <Entity.Student> Student   = DAL.CovertHelper <Entity.Student> .ConvertToModel(table);

            return(Student);
        }
예제 #2
0
파일: addDAL.cs 프로젝트: MungerLi/Charge
        public bool  IaddStudent(Entity.Student student)
        {
            //throw new NotImplementedException();
            SqlParameter[] para = { new SqlParameter("@StudentID",   student.StudentNo),
                                    new SqlParameter("@studentname", student.Name),
                                    new SqlParameter("@grade",       student.Grade),
                                    new SqlParameter("@sex",         student.Sex),
                                    new SqlParameter("@class",       student.Class),
                                    new SqlParameter("@department",  student.Department),
                                    new SqlParameter("@notes",       student.Notes) };
            string         sql = "insert into student_info values(@StudentID,@studentname,@sex,@department,@grade,@class,@notes)";

            return(sqlhelper.ExecuteNonquery(sql, CommandType.Text, para));
        }
예제 #3
0
        public void modify(Entity.Student student)
        {
            //throw new NotImplementedException();
            SqlParameter[] sqlparams = { new SqlParameter("@StudentName", student.Name),
                                         new SqlParameter("@sex",         student.Sex),
                                         new SqlParameter("@Department",  student.Department),
                                         new SqlParameter("@grade",       student.Grade),
                                         new SqlParameter("@class",       student.Class),
                                         new SqlParameter("@notes",       student.Notes),
                                         new SqlParameter("@studentno",   student.StudentNo) };
            string         sql = "ModifyStudentinfo";

            DAL.sqlhelper.ExecuteNonquery(sql, CommandType.StoredProcedure, sqlparams);
        }