Esempio n. 1
0
        public void Update(StudentNote sn)
        {
            CommonFunctions.UpdateApostrophe(sn);
            StringBuilder sb = new StringBuilder();

            sb.Append("UPDATE StudentNote SET ");
            sb.Append("StudentNote='" + sn.StudentNoteName + "'");
            sb.Append(",NoteDate='" + sn.NoteDate.ToString("dd/MM/yyyy") + "' ");
            sb.Append("WHERE StudentNoteId =" + sn.StudentNoteId);
            string sql = sb.ToString();

            dbc.ExecuteCommand(sql);
        }
Esempio n. 2
0
        public void Add(StudentNote sn, int StudentId)
        {
            CommonFunctions.UpdateApostrophe(sn);
            StringBuilder sb = new StringBuilder();

            sb.Append("INSERT INTO StudentNote (StudentNote,StudentId,NoteDate) VALUES (");
            sb.Append("'" + sn.StudentNoteName + "'");
            sb.Append("," + StudentId + "");
            sb.Append(",'" + sn.NoteDate.ToString("dd/MM/yyyy") + "'");
            sb.Append(")");
            string sql = sb.ToString();

            dbc.ExecuteCommand(sql);
        }
Esempio n. 3
0
        public List <StudentNote> GetList(int PersonId)
        {
            List <StudentNote> studentNotes = new List <StudentNote>();
            DataTable          dt           = dbc.GetDataTable("SELECT * FROM vw_StudentNotes WHERE StudentId=" + PersonId);

            dbc.CloseConnection();

            foreach (DataRow dr in dt.Rows)
            {
                StudentNote sn = new StudentNote();
                sn.StudentNoteId   = (int)dr["StudentNoteId"];
                sn.StudentId       = (int)dr["StudentId"];
                sn.StudentNoteName = dr["StudentNote"].ToString();
                sn.NoteDate        = (DateTime)dr["NoteDate"];
                studentNotes.Add(sn);
            }
            return(studentNotes);
        }