コード例 #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);
        }