Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Protected Sub imgBtnDatechange_Click(sender As Object, e As ImageClickEventArgs) Handles imgBtn.Click
  2. Dim acc As New accounts(Membership.GetUser().ProviderUserKey)
  3. Dim adjustedDate as Date = "06/06/2015"
  4. acc.UpdateVipEndDate(acc.accountID, acc.adjustedDate)
  5. End Sub
  6.  
  7. Public Property adjustedDate As Date
  8.  
  9. Public Sub UpdateVipEndDate(ByVal accountID As Guid, ByVal adjustedDate As Date)
  10. Dim DBConnect As New DBConn
  11. Using db As DbConnection = DBConnect.Conn("DBConnectionString")
  12. Dim cmd As SqlCommand = DBConnect.Command(db, "UpdateVipEndDate")
  13. cmd.Parameters.Add(New SqlParameter("accountID", SqlDbType.UniqueIdentifier, ParameterDirection.Input)).Value = accountID
  14. cmd.Parameters.Add(New SqlParameter("newadjustedDate", SqlDbType.Date, ParameterDirection.Input)).Value = adjustedDate
  15. db.Open()
  16. cmd.ExecuteNonQuery()
  17. cmd.Dispose()
  18. cmd = Nothing
  19. db.Dispose()
  20. db.Close()
  21. End Using
  22.  
  23. CREATE PROCEDURE [UpdateVipEndDate]
  24. @accountID uniqueidentifier,
  25. @newadjustedDate date
  26. AS
  27. BEGIN
  28.  
  29. UPDATE tblAccounts SET [vipEndDate] = @newadjustedDate WHERE [accountID] = @accountID
  30.  
  31. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement