Imagine you are a manager of three consultants and you want to keep a running to
ID: 3821381 • Letter: I
Question
Imagine you are a manager of three consultants and you want to keep a running total of their value. You need a form where you can add brownie points to their running total whne they have done something for points from the running total when they error. Write a web form that has a dropdown list that is pre-loaded with company's three employers names(text field) and ID'S(value field), a textbo wherein you can type in a textbox for putput. Create one variable for each employee. Write the procedure tht can take the employee chosend in the dropdownlist, and give them more brownie points based on the number typed into the textbox (if you type -5 the employee lose 5 points if you trype employee gains 5 points). After each transaction write the status of each employee's value on seperate textbox, format the ouput nicely.Explanation / Answer
Following is the HTML code for your Question. Copy it into source code of your form.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Select Employee"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>XYZ</asp:ListItem>
<asp:ListItem>ABC</asp:ListItem>
<asp:ListItem>PQR</asp:ListItem>
</asp:DropDownList>
<br />
</div>
Brownie Points
<asp:TextBox ID="TextBox1" runat="server" Width="56px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Submit" />
<br />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="XYZ"></asp:Label>
<asp:TextBox ID="TBXYZ" runat="server" Width="55px">0</asp:TextBox>
<br />
<br />
ABC
<asp:TextBox ID="TBABC" runat="server" Width="55px">0</asp:TextBox>
<br />
<br />
PQR
<asp:TextBox ID="TBPQR" runat="server" Width="56px">0</asp:TextBox>
</form>
</body>
</html>
Following is the VB.NET code for your quesion. Copy it into your aspx.vb code file.
Partial Public Class _Default
Inherits System.Web.UI.Page
Dim first As Integer
Dim second As Integer
Dim third As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
If (DropDownList1.SelectedItem.Text = "XYZ") Then
first = Integer.Parse(TBXYZ.Text) + Integer.Parse(TextBox1.Text)
TBXYZ.Text = first.ToString()
End If
If (DropDownList1.SelectedItem.Text = "ABC") Then
second = Integer.Parse(TBABC.Text) + Integer.Parse(TextBox1.Text)
TBABC.Text = second.ToString()
End If
If (DropDownList1.SelectedItem.Text = "PQR") Then
third = Integer.Parse(TBPQR.Text) + Integer.Parse(TextBox1.Text)
TBPQR.Text = third.ToString()
End If
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.