Beispiel #1
0
        /// <summary>
        /// check login for a user/password, single result is authenticated
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns>
        /// sets user's picture to specified image in the database
        /// </returns>
        public void SaveImage(Int32 userId, byte[] image)
        {
            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.Parameters.Add(new SqlParameter("@userId", userId));
            sqlCommand.Parameters.Add(new SqlParameter("@image", image));

            string sqlText = @"UPDATE [sukotto1_skypath2008].[dbo].[Teacher]
                               SET [picture] = @image
                               where [sukotto1_skypath2008].[dbo].[Teacher].id_User = @userId
                            ";

            sqlCommand.CommandText = sqlText;

            SQLHelper sqlHelper = new SQLHelper();

            sqlHelper.SQL_Insert(sqlCommand);
        }
Beispiel #2
0
        public DataTable InsertNewAppointment(DateTime newAppointmentStart, DateTime newAppointmentEnd, int idTeacher)
        {
            DataTable dtResults = new DataTable();

            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.Parameters.Add(new SqlParameter("@appointmentStart", newAppointmentStart));
            sqlCommand.Parameters.Add(new SqlParameter("@appointmentEnd", newAppointmentEnd));
            sqlCommand.Parameters.Add(new SqlParameter("@idTeacher", idTeacher));

            string sqlText = @"Insert into [sukotto1_skypath2008].[dbo].[Appointment]
                                (appointmentStart, appointmentEnd, id_Teacher)
                                values(@appointmentStart, @appointmentEnd, @idTeacher)
                                ";

            sqlCommand.CommandText = sqlText;

            SQLHelper sqlHelper = new SQLHelper();

            sqlHelper.SQL_Insert(sqlCommand);

            return dtResults;
        }