Example #1
0
 private Boolean Delete(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblStudentEmailDelete";
         base.Initialize(db.Command, base.Id);
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex) { throw; }
 }
Example #2
0
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.Parameters.Clear();
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblBookUPDATE";
         base.Initialize(db.Command, base.ID);
         db.Command.Parameters.Add("@BookTypeID", SqlDbType.UniqueIdentifier).Value = _BookTypeID;
         db.Command.Parameters.Add("@Title", SqlDbType.VarChar).Value = _Title;
         db.Command.Parameters.Add("@Price", SqlDbType.VarChar).Value = _Price;
         db.Command.Parameters.Add("@BookCover", SqlDbType.Image).Value = PhotoHelper.Photo.FileToByteArray(_PhotoName);
         db.Command.Parameters.Add("@MimeType", SqlDbType.VarChar).Value = Path.GetExtension(_PhotoName);
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #3
0
 private Boolean Delete(Database db)
 {
     try
     {
         db.Command.Parameters.Clear();
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblBookDELETE";
         base.Initialize(db.Command, base.ID);
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #4
0
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblStudentUpdate";
         base.Initialize(db.Command, base.Id);
         db.Command.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = _FirstName;
         db.Command.Parameters.Add("@LastName", SqlDbType.VarChar).Value = _LastName;
         db.Command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = _UserName;
         db.Command.Parameters.Add("@Password", SqlDbType.VarChar).Value = _Password;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblStudentCommentUpdate";
         base.Initialize(db.Command, Guid.Empty);
         db.Command.Parameters.Add("@studentid", SqlDbType.UniqueIdentifier).Value = _studentId;
         db.Command.Parameters.Add("@parentid", SqlDbType.UniqueIdentifier).Value = _parentId;
         db.Command.Parameters.Add("@parentid", SqlDbType.UniqueIdentifier).Value = _parentId;
         db.Command.Parameters.Add("@subject", SqlDbType.VarChar).Value = _subject;
         db.Command.Parameters.Add("@commentData", SqlDbType.VarChar).Value = _comment;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch { throw; }
 }
Example #6
0
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblUserUPDATE";
         base.Initialize(db.Command, base.ID);
         db.Command.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = _FirstName;
         db.Command.Parameters.Add("@LastName", SqlDbType.VarChar).Value = _LastName;
         db.Command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = _Username;
         db.Command.Parameters.Add("@Password", SqlDbType.VarChar).Value = _Password;
         db.Command.Parameters.Add("@Email", SqlDbType.VarChar).Value = _Email;
         db.Command.Parameters.Add("@Question1", SqlDbType.VarChar).Value = _Question1;
         db.Command.Parameters.Add("@Answer1", SqlDbType.VarChar).Value = _Answer1;
         db.Command.Parameters.Add("@Question2", SqlDbType.VarChar).Value = _Question2;
         db.Command.Parameters.Add("@Answer2", SqlDbType.VarChar).Value = _Answer2;
         db.Command.Parameters.Add("@Question3", SqlDbType.VarChar).Value = _Question3;
         db.Command.Parameters.Add("@Answer3", SqlDbType.VarChar).Value = _Answer3;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #7
0
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblBookTypeUPDATE";
         base.Initialize(db.Command, base.ID);
         db.Command.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = _ID;
         db.Command.Parameters.Add("@Type", SqlDbType.VarChar).Value = _Type;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #8
0
        private Boolean Insert(Database db)
        {
            BookType booktype = new BookType();

            try
            {
                db.Command.CommandType = CommandType.StoredProcedure;
                db.Command.CommandText = "tblBookTypeINSERT";
                base.Initialize(db.Command, Guid.Empty);
                db.Command.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = _ID;
                db.Command.Parameters.Add("@Type", SqlDbType.VarChar).Value = _Type;
                db.ExecuteNonQueryWithTransaction();
                base.Initialize(db.Command);
                return true;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
 private Boolean Update(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblStudentAddressUpdate";
         base.Initialize(db.Command, base.Id);
         db.Command.Parameters.Add("@studentid", SqlDbType.UniqueIdentifier).Value = _studentId;
         db.Command.Parameters.Add("@street", SqlDbType.VarChar).Value = _street;
         db.Command.Parameters.Add("@addresstypeid", SqlDbType.UniqueIdentifier).Value = _addressTypeId;
         db.Command.Parameters.Add("@zipcodeid", SqlDbType.UniqueIdentifier).Value = _zipcodeId;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex) { throw; }
 }
Example #10
0
        private Boolean Insert(Database db)
        {
            Review review = new Review();

            try
            {
                db.Command.Parameters.Clear();
                db.Command.CommandType = CommandType.StoredProcedure;
                db.Command.CommandText = "tblReviewINSERT";
                base.Initialize(db.Command, Guid.Empty);
                db.Command.Parameters.Add("@BookID", SqlDbType.UniqueIdentifier).Value = _BookID;
                db.Command.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = _UserID;
                db.Command.Parameters.Add("@Title", SqlDbType.VarChar).Value = Title;
                db.Command.Parameters.Add("@BookReview", SqlDbType.VarChar).Value = _Review;
                db.ExecuteNonQueryWithTransaction();
                base.Initialize(db.Command);
                return true;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #11
0
 private Boolean Insert(Database db)
 {
     try
     {
         db.Command.CommandType = CommandType.StoredProcedure;
         db.Command.CommandText = "tblStudentClassInsert";
         db.Command.Parameters.Clear();
         base.Initialize(db.Command, Guid.Empty);
         db.Command.Parameters.Add("@studentid", SqlDbType.UniqueIdentifier).Value = _studentId;
         db.Command.Parameters.Add("@classid", SqlDbType.UniqueIdentifier).Value = _classId;
         db.ExecuteNonQueryWithTransaction();
         base.Initialize(db.Command);
         return true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }