ericstenson 5 Posting Whiz in Training Team Colleague

Itext (itextsharp) is free.

ericstenson 5 Posting Whiz in Training Team Colleague

Using your example above, the following reservation has been made:

A: 4/17/2009
D: 4/25/2009.

Now, a customer calls and says I want to book 04/16/09 to 04/27/09.

Let's go through my steps.

1. Do any arrivals fall within the date range?
Arrival of 4/17/2009 falls between 4/16 and 4/27 -- record is returned

2. If there is a record returned, you cannot book.
We cannot book this the 2nd reservation.

****

Let's modify the example, and say your 2nd resevation was 4/18/09 to 4/27/09.

1. Do any arrivals fall within the range?
Previous booking has arrival of 4/17, so NO.

2. If so, you cannot continue.
We can continue, because the answer was NO.

3. Are any departures within the date range of 4/18/09 to 4/27/09?
Yes, the first booking is leaving 04/25/09.

4. If so, you cannot continue.
We cannot make the reservation, because a deperature falls within the range.


Does this make sense??

BluePaper commented: Thank you for helping me get my head around this! +1
ericstenson 5 Posting Whiz in Training Team Colleague

In my example above BookDate means Arrival Date, sorry on the confusion

ericstenson 5 Posting Whiz in Training Team Colleague

What you need to do is the following:

1. Run a query to see if any bookings fall within your date range.
(Select * from Bookings where BookDate >= YourStartDate or BookDate <=YourEndDate

2. If there is a record returned, you cannot book.

3. Next, check to see if there is a departing record
(Select * from Bookings where Departdate > YourStartDate AND DepartDate =<YourEndDate

4. If a record is returned, someone is departing durign that time. You cannot book.

Make sense?

ericstenson 5 Posting Whiz in Training Team Colleague

No, the page is not always refreshing. The only time you get the page refreshing is when the pop-up appears.

ericstenson 5 Posting Whiz in Training Team Colleague

It's doable. Here is how I would attack it....

1. Drop an ASP UpdatePanel somewhere on the page
2. Create a Session variable called "PopupEvent" (Session.Add("PopUpEvent", "1")
> Set this to a value of 1
3. Put a timer in the UpdatePanel. Let it fire every 2-5 minutes
4. When the timer fires, let it check to see if there is any event in your database that is within the next (X) number of minutes.
5. If there is an event, set the Session("PupUpEvent") = "2"
5a. Create a session object to handle the Event ID / Record ID in your database of the event
6. If there is an event, enable a second timer outside of the UpdatePanel.
7. Turn off the first timer
6. When the 2nd timer is fired, turn it off, and reload the page
8. On the PageLoad call create an if statement:

If Session("PopUpEvent") = 2 then

Response.Write("<script>")

                Response.Write("window.open('WHATEVERNEWPAGENAME.aspx','_blank','toolbar=0,location=0,menubar=0,resizable=0,width=400,height=320')")

                Response.Write("</script>")
    Response.Write("<script>")

                Response.Write("window.open('YOURREMINDERPAGE.aspx','_blank','toolbar=0,location=0,menubar=0,resizable=0,width=400,height=320')")

                Response.Write("</script>")



end if

On loading 'YOURREMINDERPAGE grab out of session the record from the database of the even that is pending.

ericstenson 5 Posting Whiz in Training Team Colleague
Response.Write("<script>")

                Response.Write("window.open('WHATEVERNEWPAGENAME.aspx','_blank','toolbar=0,location=0,menubar=0,resizable=0,width=400,height=320')")

                Response.Write("</script>")

The Pop-Up is just a different page; Play around with the height and width. You would do that action on a "Button Click" or pageload or whatever event...

ericstenson 5 Posting Whiz in Training Team Colleague

Put it in a table, leave a column to the left, give the column some width.

ericstenson 5 Posting Whiz in Training Team Colleague

Search and you shall find.

ericstenson 5 Posting Whiz in Training Team Colleague

Also, I am pretty sure you need to get rid of the ' around @Photo...

ericstenson 5 Posting Whiz in Training Team Colleague

Ah, get rid of the ' around databaseimage

ericstenson 5 Posting Whiz in Training Team Colleague

(stacktrace, too)

ericstenson 5 Posting Whiz in Training Team Colleague

Can you please provide the exact exception being thrown?

ericstenson 5 Posting Whiz in Training Team Colleague

Microsoft outlook.

ericstenson 5 Posting Whiz in Training Team Colleague

Yes, your problem is that you are over complicating the problem.

ericstenson 5 Posting Whiz in Training Team Colleague

This would be on the "SelectedIndexChange" event for the dropdownlist.

ericstenson 5 Posting Whiz in Training Team Colleague

You need AutoPostBack = True on the dropdownlist property so the dropdownlist tells the server the value has changed.

Create a function (or use this for both)

lblResult.text = Val(ddlProduct.text) * (1 + Val(ddlCompany.text))

that's the vb.net.    i am not a c# programmer, but the converter says:

lblResult.text == Conversion.Val(ddlProduct.text) * (1 + Conversion.Val(ddlCompany.text))

If this post helped you, please add it to my reputation and mark the thread as solved.

ericstenson 5 Posting Whiz in Training Team Colleague

Hi - Check the spelling on your SQL database, this is probably the issue. An invalid column name means the column simply doesn't exist as stated.

Also, try a test. What happens when you run the query:

Select DatabaseImage from ImageTable

Best/Eric


P.S. If this helped, give me some points and marked as solved! :-)

ericstenson 5 Posting Whiz in Training Team Colleague

try a response.redirect to the document. i should not ask.

ericstenson 5 Posting Whiz in Training Team Colleague

There is a property called enabled, set it to false.

ericstenson 5 Posting Whiz in Training Team Colleague

To send through GMAIL, there are a few things you need to do to make it work with .NET.

(1) Enable POP and/or IMAP in the GMAIL settings
(2) Enable SSL & use Port 587

Dim ObjectMail As New SmtpClient("smtp.gmail.com", 587)
ObjectMail.EnableSsl = True

Good luck,

Eric

ericstenson 5 Posting Whiz in Training Team Colleague

Use system.net.mail.

There are lots of examples out there. If you are still having trouble, holler back and I will post.

ericstenson 5 Posting Whiz in Training Team Colleague

If it is always 10 digits, it's easy.

One way to do it would be to remove every other digit, then you end up with

Dim String1 as String = 1234567891
String1 = 0 & String1.Substring(1,1) & "0" & string1.substring(3,1) & "0" & string1.substring(5,1) ....
... that gives you the idea.

ericstenson 5 Posting Whiz in Training Team Colleague

(that is, answer that people would give)

ericstenson 5 Posting Whiz in Training Team Colleague

You are on an ASP.NET Forum. I think there is a "more than obvious" answer to your question...

But here is my question: WHY DO YOU FEEL THE NEED TO ASK?!

Do whatever you want. Who give a #$@@^**#$#$^ what we say. If ask the guy that sits next to me, he would say PHP.

In other words, it's a question that doesn't really have an answer. Don't mark this as solved, as the question is rhetorical in nature.

ericstenson 5 Posting Whiz in Training Team Colleague

oh, man, it's not where it's going, it's where it has gone...

ericstenson 5 Posting Whiz in Training Team Colleague

Thanks, can you mark as solved and give me some reputation points?

ericstenson 5 Posting Whiz in Training Team Colleague

sBIG.contains("WHATEVERYOUWANTTOFIND")

so like:

if SBIG.contains("#") then

label1.text = "Hello World"

end if

BluePaper commented: Useful snippet of information :) +1
ericstenson 5 Posting Whiz in Training Team Colleague

Easier is just to drop an e-mail to phonenumber@vtext.com. That will e-mail Verizon

ericstenson 5 Posting Whiz in Training Team Colleague

Or, you can write a program to navigate the carrier's website and send an sms. i wrote this for Verizon if anyone wants it.

ericstenson 5 Posting Whiz in Training Team Colleague

Hi - Try e-mailing the message to PHONENUMBER@CARRIERNAME.COM.

For instance, in the USA, if you wanted to text 212-555-1212, a verizon wireless customer, you could just send an e-mail to 2125551212@vtext.com and it will convert your e-mail into an SMS message to the phone.

Now, let's suppose you don't know what carrier the person belongs to (maybe Cingular, maybe sprint)... you just drop the message to all of them and let 2 of them bounce!

ericstenson 5 Posting Whiz in Training Team Colleague

Please mark as solved and give me some rep points :) I am glad you got it working!

Jx_Man commented: this for you :D +3
ericstenson 5 Posting Whiz in Training Team Colleague
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView1.RowCommand

        If e.CommandName = "YOURCOMMANDNAME" Then


            Label1.Text = GridView1.DataKeys(e.CommandArgument).Values

        End If


    End Sub

You will need to specify the datakey as your unquie ident column from the database. Also, make sure to give the button a command name so you can grab the event. You need also to make sure that you ge the DataKey because if you just returned e.CommandArgument, it would only give you the row number (for isntance, 0 or 2) but not the unique ident record from the database.

ericstenson 5 Posting Whiz in Training Team Colleague

are you using outside hosting? sometimes they have restrictive settings. if it's running on your system, do you have any anti-virus / firewalls running?

ericstenson 5 Posting Whiz in Training Team Colleague

How about the fact that you are rounding the number!

try specifing the number of rounding digits...

Math.Round(asdf, 2)

would give you 0.00 percision

ericstenson 5 Posting Whiz in Training Team Colleague

Are you actually capturing the whole string name, or are you just using the first 10 characters of the string?

ericstenson 5 Posting Whiz in Training Team Colleague

if you need more help, feel free to ask.

ericstenson 5 Posting Whiz in Training Team Colleague
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If Len(TextBox1.Text) > 0 Then
            If Not IsNumeric(TextBox1.Text) Then
                TextBox1.Text = TextBox1.Text.Remove(TextBox1.Text.Length - 1, 1)
            End If
        End If
    End Sub

Basically, it looks at the text in the text box as soon as there is a change to the text. if it isn't numeric, it deletes the character. You need to make sure the length of the textbox text is greater than zero (at least 1), because if someone enters, say "a" as the first digit, it would otherwise delete the "a" and then that triggers another change, leaving the box empty which is not numeric. but it works fairly well.

ericstenson 5 Posting Whiz in Training Team Colleague

double click on your dropdownlist and change the end text of the sub from .selectedindexchanged to .databound

then write your code that sets the selected value to the cell value from the database.

if you are doing it on page load, call a dropdownlistX.databind() to make this code function on load.

jtok commented: very helpful +1
ericstenson 5 Posting Whiz in Training Team Colleague

Hi J Tok... I take it from

AddSystemOS.SelectedValue = OS.Text

That you are trying to set the selected value of the dropdown list to whatever the value is from your database.

1. The dropdownlist has 2 properties. A DataTextField and a DataValueField. Is your DataValue field properly bound to the datasource?

2. If so, set the selected value AFTER DropdownlistX.databound happens. If you are trying to set the value on page load, I am almost 100% sure VS will kick an error.

ericstenson 5 Posting Whiz in Training Team Colleague

wow. that's a long thread for a simple problem.

ericstenson 5 Posting Whiz in Training Team Colleague

i agread with SheSaid, that would work. Otherwise, you could create a record flag that has an int value of 0 or 1. If the database record is at 0, then it's first time log-in... if it's a 1, then they have logged in before. After the password is updated, update the record flag at the same time.

ericstenson 5 Posting Whiz in Training Team Colleague

there are many different ways to do it. where is the date stored? SQL?

ericstenson 5 Posting Whiz in Training Team Colleague

background image:
~/imagefile.jpg

ericstenson 5 Posting Whiz in Training Team Colleague

Come on, man. Add a column "UserType" with a value of 0 or 1. 0 for admin, 1 for user. When you check the username and password, also grab the value from that column.

ericstenson 5 Posting Whiz in Training Team Colleague

Want to sub out the contract? Sound like you are in over your head. I see DW as a place where people can get help on specific nuances they need help with in code, not a place where the world can provide you with a solution that you get paid for. I must ask- why would you accept a project you have no idea how to solve?

ericstenson 5 Posting Whiz in Training Team Colleague

there are plenty of free converters online. i think there might also be one from MSFT.