Click here to Skip to main content
15,880,967 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to incorporate pagination feature into my repository Pin
Mou_kol13-Dec-17 3:31
Mou_kol13-Dec-17 3:31 
AnswerRe: How to incorporate pagination feature into my repository Pin
Richard Deeming13-Dec-17 7:17
mveRichard Deeming13-Dec-17 7:17 
GeneralRe: How to incorporate pagination feature into my repository Pin
Mou_kol14-Dec-17 20:33
Mou_kol14-Dec-17 20:33 
GeneralRe: How to incorporate pagination feature into my repository Pin
F-ES Sitecore14-Dec-17 22:56
professionalF-ES Sitecore14-Dec-17 22:56 
GeneralRe: How to incorporate pagination feature into my repository Pin
Richard Deeming18-Dec-17 1:47
mveRichard Deeming18-Dec-17 1:47 
GeneralRe: How to incorporate pagination feature into my repository Pin
Mou_kol18-Dec-17 20:49
Mou_kol18-Dec-17 20:49 
GeneralRe: How to incorporate pagination feature into my repository Pin
Richard Deeming19-Dec-17 1:59
mveRichard Deeming19-Dec-17 1:59 
QuestionAm I approaching this problem the wrong way? Pin
samflex11-Dec-17 5:25
samflex11-Dec-17 5:25 
We have a form on our intranet site that employees must complete yearly.

To complete this form, employee must first enter his/her employee ID.

This ID is checked to see if this employee has completed this form before.

For instance, if this employee completed this form in the year 2016 but has not completed it in the year 2017, then his/her existing info (name, email, title) are pulled and are populated into their respective textboxes with a message that says, "Proceed"

If the employee has completed the current year of 2017, again, his/her information is pulled from employee table and populated into the textboxes so they don't have to enter those information again.

This time, the employee gets a message, "You have already completed this form"

If however, the employee has never completed this form, then the textboxes containing employee's info (name, email, title) are blank with a message, "Proceed"

So far, the only solution that seems to work is when employee has completed the form for the current year because the employee gets a message, "You have already completed the form".

How should I modify this to work in the other two situations where employee has completed previous year but has not completed the current year and employee has not never completed the form before?

PHP
Protected Sub txtEmpID_TextChanged(sender As Object, e As EventArgs) Handles txtEmpID.TextChanged
    If Not String.IsNullOrEmpty(txtEmpID.Text) Then
        Dim Conn As SqlConnection
        'Read in connection String
        Conn = New SqlConnection(ConfigurationManager.ConnectionStrings("constr").ConnectionString)
        Conn.Open()
        Dim cmd As New SqlCommand("select * from Employees e inner join dateDetails d on e.employeeID = d.EmployeeID where EmpID=@empID and Year(d.enterDate) >= 2016  and Year(d.enterDate)<= 2017", Conn)
        cmd.Parameters.AddWithValue("@empID", txtEmpID.Text)
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        If dr.HasRows Then
            dr.Read()
            checkusername.Visible = True
            'imgstatus.ImageUrl = "images/NotAvailable.jpg"
            lblStatus.Text = "Please verify your information for accuracy. Then complete rest of the form."
            lblStatus.ForeColor = System.Drawing.Color.Red
            System.Threading.Thread.Sleep(100)
            txteName.Text = dr("employeeName").ToString()
            txttitle.Text = dr("empTitle").ToString()
            txtemail.Text = dr("email").ToString()
            txtEmpID.Text = dr("empID").ToString()
        Else
            dr.Read()
            checkusername.Visible = True
            'imgstatus.ImageUrl = "images/Icon_Available.gif"
            lblStatus.Text = "Proceed"
            lblStatus.ForeColor = System.Drawing.Color.Red
            System.Threading.Thread.Sleep(100)
            txteName.Text = dr("employeeName").ToString()
            txttitle.Text = dr("empTitle").ToString()
            txtemail.Text = dr("email").ToString()
            txtEmpID.Text = dr("empID").ToString()
        End If
    Else
        checkusername.Visible = False
    End If
End Sub

AnswerRe: Am I approaching this problem the wrong way? Pin
jkirkerx13-Dec-17 9:53
professionaljkirkerx13-Dec-17 9:53 
QuestionHow to setup and use VSTS for five user Pin
Mou_kol7-Dec-17 23:19
Mou_kol7-Dec-17 23:19 
AnswerRe: How to setup and use VSTS for five user Pin
Richard MacCutchan8-Dec-17 0:05
mveRichard MacCutchan8-Dec-17 0:05 
QuestionVisual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx7-Dec-17 13:38
professionaljkirkerx7-Dec-17 13:38 
AnswerRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
Richard Deeming8-Dec-17 1:28
mveRichard Deeming8-Dec-17 1:28 
GeneralRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx8-Dec-17 6:20
professionaljkirkerx8-Dec-17 6:20 
AnswerRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx10-Dec-17 10:33
professionaljkirkerx10-Dec-17 10:33 
QuestionConsuming a homemade rest service in asp.net webform Pin
wilcodk7-Dec-17 2:47
wilcodk7-Dec-17 2:47 
AnswerRe: Consuming a homemade rest service in asp.net webform Pin
Richard Deeming7-Dec-17 8:54
mveRichard Deeming7-Dec-17 8:54 
GeneralRe: Consuming a homemade rest service in asp.net webform Pin
wilcodk7-Dec-17 22:20
wilcodk7-Dec-17 22:20 
QuestionPopulating pdf on the server Pin
Michael Clinton6-Dec-17 7:49
Michael Clinton6-Dec-17 7:49 
AnswerRe: Populating pdf on the server Pin
Richard Deeming6-Dec-17 9:43
mveRichard Deeming6-Dec-17 9:43 
QuestionHow to disable gridview by checkbox? Pin
samflex4-Dec-17 7:56
samflex4-Dec-17 7:56 
AnswerRe: How to disable gridview by checkbox? Pin
jkirkerx4-Dec-17 8:02
professionaljkirkerx4-Dec-17 8:02 
GeneralRe: How to disable gridview by checkbox? Pin
samflex4-Dec-17 8:48
samflex4-Dec-17 8:48 
GeneralRe: How to disable gridview by checkbox? Pin
jkirkerx4-Dec-17 10:11
professionaljkirkerx4-Dec-17 10:11 
GeneralRe: How to disable gridview by checkbox? Pin
samflex4-Dec-17 10:32
samflex4-Dec-17 10:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.