473,734 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# and Crystal Report 9

I have a sql server7 database using C#. The system runs fine until the
user try to run a report. I get the following error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceEx ception: Object reference not set to an instance of an
object.]
LostToolReporti ng.LostTool.loa dDetails(Int32 rec_id) in
\\rsila1-web\C$\Inetpub\ wwwroot\LostToo lReporting\Lost Tool.aspx.cs:20 4
LostToolReporti ng.LostTool.Pag e_Load(Object sender, EventArgs e) in
\\rsila1-web\C$\Inetpub\ wwwroot\LostToo lReporting\Lost Tool.aspx.cs:14 2
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +742

Version Information: Microsoft .NET Framework Version:1.1.432 2.573;
ASP.NET Version:1.1.432 2.1085

Thanks for the help in advance,

Nov 16 '05 #1
6 2222
OK... so what is LostTool? Is it something you wrote? Something you
bought? Do you have the source code for it?

Nov 16 '05 #2
Lost Tooling is a system that keep track of all Tools that was lost or
found at the company. It was developed by the a programmer who is no
longer with the company. Therefore, I had to take over since I the only
programmer left. I don't know c sharpe, I'm learning as I go. However,
I have taken a training class on Crystal.
Thanks,

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
OK, so then according to the message you have to find

\\rsila1-web\C$\Inetpub\ wwwroot\LostToo lReporting\Lost Tool.a*spx.cs

and post the C# code for the method that encompasses line 204, so we
can see the code that failed, and maybe give you some ideas as to what
might have gone wrong.

Nov 16 '05 #4
Rsila1 is our web server. Here is the code for lost_tool.aspx.

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Net;
using NGIT_Utility_Cl asses;
using Microsoft.Web.U I.WebControls;

namespace LostToolReporti ng
{
/// <summary>
/// Summary description for Inventory.
/// </summary>
public class LostTool : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Labe l Label4;
protected System.Web.UI.W ebControls.Labe l Label5;
protected System.Web.UI.W ebControls.Labe l Label6;
protected System.Web.UI.W ebControls.Labe l Label7;
protected System.Web.UI.W ebControls.Labe l Label8;
protected System.Web.UI.W ebControls.Text Box txtQuantity;
protected System.Web.UI.W ebControls.Labe l Label3;
protected System.Web.UI.W ebControls.Butt on btnSave;
protected System.Web.UI.W ebControls.Butt on Home;
protected System.Web.UI.W ebControls.Butt on btnPrint;
protected System.Web.UI.W ebControls.Chec kBox chkDelete;
protected System.Web.UI.W ebControls.Chec kBox chkMultiple;
protected System.Web.UI.W ebControls.Text Box txtDrawer;
protected System.Web.UI.W ebControls.Text Box txtCategory;
protected System.Web.UI.W ebControls.Text Box txtDescription;
protected System.Web.UI.W ebControls.Chec kBox chkRecovered;
protected System.Web.UI.W ebControls.Drop DownList ddlShift;
protected System.Web.UI.W ebControls.Text Box txtExtension;
protected System.Web.UI.W ebControls.Text Box txtDate;
protected System.Web.UI.W ebControls.Drop DownList ddlAircraft;
protected System.Web.UI.W ebControls.Drop DownList ddlBuilding;
protected System.Web.UI.W ebControls.Drop DownList ddlTypeOfTool;
protected System.Web.UI.W ebControls.Text Box txtDateTimeLost ;
protected System.Web.UI.W ebControls.Chec kBox chkTalkedWithCo workers;
protected System.Web.UI.W ebControls.Chec kBox chkNotifiedSupe rvisor;
protected System.Web.UI.W ebControls.Text Box txtLostToolRepo rtNo;
protected System.Web.UI.W ebControls.Text Box txtDateToolWasF ound;
protected System.Web.UI.W ebControls.Text Box txtWhoFoundTool ;
protected System.Web.UI.W ebControls.Text Box txtIdentifyingM arks;
protected System.Web.UI.W ebControls.Drop DownList ddlColorOfTool;
protected System.Web.UI.W ebControls.Labe l lblMessage;
protected System.Web.UI.W ebControls.Text Box txtEmployeeNumb er;
protected System.Web.UI.W ebControls.Text Box txtEmployeeName ;
protected System.Web.UI.W ebControls.Text Box txtDepartment;
protected System.Web.UI.W ebControls.List Box lbAreaLost;
protected System.Web.UI.W ebControls.List Box lbAreaSearched;
protected System.Web.UI.W ebControls.Drop DownList ddlDescriptionO fTool;
protected System.Web.UI.W ebControls.List Box lbEmployeeActio n;
protected System.Web.UI.W ebControls.Text Box txtFOEResults;
protected System.Web.UI.W ebControls.List Box lbSupervisorAct ion;
protected System.Web.UI.W ebControls.List Box lbQualityAction ;
protected System.Web.UI.W ebControls.List Box lbLocationFound ;
protected System.Web.UI.W ebControls.Text Box txtSupervisorRe sults;
protected System.Web.UI.W ebControls.List Box lbFOEAction;
protected System.Web.UI.W ebControls.Text Box txtFOEComments;
protected System.Web.UI.W ebControls.Text Box txtQualityResul ts;
protected System.Web.UI.W ebControls.Pane l pnlSupervisor;
protected System.Web.UI.W ebControls.Pane l pnlQuality;
protected System.Web.UI.W ebControls.Pane l pnlFOE;
protected System.Web.UI.W ebControls.Chec kBox chkNeedsCalibra tion;
protected System.Web.UI.W ebControls.Drop DownList ddlSupervisor;
protected System.Web.UI.W ebControls.Drop DownList ddlQuality;
protected System.Web.UI.W ebControls.Drop DownList ddlFOECoordinat or;
protected System.Web.UI.W ebControls.Chec kBox chkNotifiedFOE;
protected System.Web.UI.W ebControls.Chec kBox chkNotifiedQual ity;
protected System.Web.UI.W ebControls.Text Box txtAdditionalCo mments;
protected System.Web.UI.W ebControls.Drop DownList
ddlSecondFOECoo rdinator;
protected System.Web.UI.W ebControls.Drop DownList ddlSecondQualit y;
protected System.Web.UI.W ebControls.Pane l pnlEmployee;
protected System.Web.UI.W ebControls.Pane l pnlTracks;
protected System.Web.UI.W ebControls.Repe ater rptrList;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator1;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator2;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator3;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator4;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator5;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator6;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator7;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator8;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator9;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator10;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator11;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator12;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator13;
protected System.Web.UI.W ebControls.Text Box txtSnitch;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator16;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator20;
protected System.Web.UI.W ebControls.Requ iredFieldValida tor
RequiredFieldVa lidator24;
protected System.Web.UI.W ebControls.Drop DownList ddl2ndSuperviso r;

public WebStatic globalWebStatic ;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here

int intRecordNumber ;

globalWebStatic = new WebStatic(this) ;

btnSave.Attribu tes.Add("onClic k", "javascript:don ttattle();");

if (Page.IsPostBac k == true)
{
txtSnitch.Text = "modified";

lblMessage.Visi ble = false;

if (isValidEmploye e(txtEmployeeNu mber.Text) == false)
{
lblMessage.Text = "Employee number not found. Please enter a valid
employee number.";
lblMessage.Visi ble = true;
}
return;
}

loadDropdowns() ;
loadDefaults();

if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() == "Add")
{
pnlSupervisor.V isible = false;
pnlQuality.Visi ble = false;
pnlFOE.Visible = false;
pnlTracks.Visib le = false;
return;
}

intRecordNumber =
System.Int32.Pa rse(Request.Que ryString.GetVal ues(1).GetValue (0).ToString
());

loadDetails(int RecordNumber);

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

rptrList.DataSo urce = dbio.getDataSet ("LIST","MTO_LT R","Select* from
DocumentTracks where ID = " + intRecordNumber .ToString() + " ORDER BY
DateTimeLogged DESC");

rptrList.DataBi nd();

dbio.Dispose();

if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() != "Add")
{
lockDown(pnlEmp loyee);
}
if (isMember("Supe rvisors") == false)
{
lockDown(pnlSup ervisor);
}
if (isMember("Qual ity") == false)
{
lockDown(pnlQua lity);
}
if (isMember("FOE" ) == false)
{
lockDown(pnlFOE );
}
}
private void lockDown(System .Web.UI.WebCont rols.Panel pnl)
{
if (isMember("Supe ruser") == true)
return;

foreach (System.Web.UI. Control control in pnl.Controls)
{
if (control.GetTyp e().FullName ==
"System.Web.UI. WebControls.Tex tBox")
((System.Web.UI .WebControls.Te xtBox)control). Enabled = false;
else
if (control.GetTyp e().FullName ==
"System.Web.UI. WebControls.Lis tBox")
((System.Web.UI .WebControls.Li stBox)control). Enabled = false;
else
if (control.GetTyp e().FullName ==
"System.Web.UI. WebControls.Che ckBox")
((System.Web.UI .WebControls.Ch eckBox)control) .Enabled = false;
else
if (control.GetTyp e().FullName ==
"System.Web.UI. WebControls.Dro pDownList")
((System.Web.UI .WebControls.Dr opDownList)cont rol).Enabled = false;
}
txtSnitch.Enabl ed = true;
}
private void loadDetails(int rec_id)
{
PrimitiveDataba seIO pdio = new PrimitiveDataba seIO();

pdio.createSqlD ataReader("MTO_ LTR", "Select * from LTR WHERE
LostToolReportN umber = " + rec_id.ToString ());

if (pdio.Read())
{
txtEmployeeName .Text =
pdio.getFieldVa lue("EmployeeNa me").ToString() ;
txtDepartment.T ext = pdio.getFieldVa lue("Department ").ToString ();
ddlShift.Items. FindByValue(pdi o.getFieldValue ("Shift").ToStr ing()).S
elected = true;
txtExtension.Te xt = pdio.getFieldVa lue("Extension" ).ToString();
txtEmployeeNumb er.Text =
pdio.getFieldVa lue("EmployeeNu mber").ToString ();
txtDate.Text =
((System.DateTi me)pdio.getFiel dValue("DateTim eCreated")).ToS tring("MM/dd
/yy HH:mm");
ddlAircraft.Ite ms.FindByValue( pdio.getFieldVa lue("Aircraft") .ToStrin
g()).Selected = true;
ddlBuilding.Ite ms.FindByValue( pdio.getFieldVa lue("Building") .ToStrin
g()).Selected = true;
ddlTypeOfTool.I tems.FindByValu e(pdio.getField Value("TypeOfTo ol").ToS
tring()).Select ed = true;
if (pdio.getFieldV alue("DateTimeL ost").ToString( ).Length > 0)
if (pdio.getFieldV alue("DateTimeL ost").ToString( ) != "1/1/1900
12:00:00 AM")
txtDateTimeLost .Text =
((System.DateTi me)pdio.getFiel dValue("DateTim eLost")).ToStri ng("MM/dd/yy
HH:mm");
txtIdentifyingM arks.Text =
pdio.getFieldVa lue("Identifyin gMarks").ToStri ng();
ddlDescriptionO fTool.Items.Fin dByValue(pdio.g etFieldValue("D escripti
onOfTool").ToSt ring()).Selecte d = true;
ddlColorOfTool. Items.FindByVal ue(pdio.getFiel dValue("ColorOf Tool").T
oString()).Sele cted = true;
flagSelected(lb AreaLost,
pdio.getFieldVa lue("AreaToolWa sLost").ToStrin g());
flagSelected(lb AreaSearched,
pdio.getFieldVa lue("AreaSearch ed").ToString() );
chkTalkedWithCo workers.Checked =
(pdio.getFieldV alue("TalkedWit hCoWorkers").To String() == "True");
chkNotifiedSupe rvisor.Checked =
(pdio.getFieldV alue("NotifiedS upervisor").ToS tring() == "True");
chkNotifiedQual ity.Checked =
(pdio.getFieldV alue("NotifiedQ uality").ToStri ng() == "True");
chkNotifiedFOE. Checked =
(pdio.getFieldV alue("NotifiedF OE").ToString () == "True");
flagSelected(lb EmployeeAction,
pdio.getFieldVa lue("ActionEmpl oyeeTook").ToSt ring());
txtAdditionalCo mments.Text =
pdio.getFieldVa lue("Additional Comments").ToSt ring();
if
(ddlSupervisor. Items.FindByVal ue(pdio.getFiel dValue("Supervi sor").ToStri
ng()) != null)
ddlSupervisor.I tems.FindByValu e(pdio.getField Value("Supervis or").To
String()).Selec ted = true;
if (pdio.getFieldV alue("Superviso r").ToString(). Length > 0 &&
pdio.getFieldVa lue("SecondSupe rvisor").ToStri ng().Length > 0)
{
lockDown(pnlSup ervisor);
if (isMember("Supe rvisors") == true)
btnSave.Visible = false;
}
if
(ddl2ndSupervis or.Items.FindBy Value(pdio.getF ieldValue("Seco ndSupervisor
").ToString ()) != null)
ddl2ndSuperviso r.Items.FindByV alue(pdio.getFi eldValue("Secon dSuperv
isor").ToString ()).Selected = true;
flagSelected(lb SupervisorActio n,
pdio.getFieldVa lue("Supervisor ActionTook").To String());
txtSupervisorRe sults.Text =
pdio.getFieldVa lue("Supervisor InvestigationRe sults").ToStrin g();
if
(ddlQuality.Ite ms.FindByValue( pdio.getFieldVa lue("QualityInv estigator").
ToString()) != null)
ddlQuality.Item s.FindByValue(p dio.getFieldVal ue("QualityInve stigato
r").ToString()) .Selected = true;
if (pdio.getFieldV alue("QualityIn vestigator").To String().Length > 0
&& pdio.getFieldVa lue("SecondQual ityPerson").ToS tring().Length > 0)
{
lockDown(pnlQua lity);
if (isMember("Qual ity") == true)
btnSave.Visible = false;
}
if
(ddlSecondQuali ty.Items.FindBy Value(pdio.getF ieldValue("Seco ndQualityPer
son").ToString( )) != null)
ddlSecondQualit y.Items.FindByV alue(pdio.getFi eldValue("Secon dQualit
yPerson").ToStr ing()).Selected = true;
flagSelected(lb QualityAction,
pdio.getFieldVa lue("QualityAct ionTook").ToStr ing());
txtQualityResul ts.Text =
pdio.getFieldVa lue("QualityInv estigationResul ts").ToString() ;
if
(ddlFOECoordina tor.Items.FindB yValue(pdio.get FieldValue("FOE Coordinator"
).ToString()) != null)
ddlFOECoordinat or.Items.FindBy Value(pdio.getF ieldValue("FOEC oordina
tor").ToString( )).Selected = true;
if
(ddlSecondFOECo ordinator.Items .FindByValue(pd io.getFieldValu e("SecondFOE
").ToString ()) != null)
ddlSecondFOECoo rdinator.Items. FindByValue(pdi o.getFieldValue ("Secon
dFOE").ToString ()).Selected = true;
txtLostToolRepo rtNo.Text =
pdio.getFieldVa lue("LostToolRe portNumber").To String();
flagSelected(lb FOEAction,
pdio.getFieldVa lue("FOEActionT ook").ToString( ));
txtFOEResults.T ext =
pdio.getFieldVa lue("FOEInvesti gationResults") .ToString();
if (pdio.getFieldV alue("DateToolF ound").ToString ().Length > 0)
if (pdio.getFieldV alue("DateToolF ound").ToString () != "1/1/1900
12:00:00 AM")
txtDateToolWasF ound.Text =
((System.DateTi me)pdio.getFiel dValue("DateToo lFound")).ToStr ing("MM/dd/y
y HH:mm");
txtWhoFoundTool .Text =
pdio.getFieldVa lue("WhoFoundTo ol").ToString() ;
flagSelected(lb LocationFound,
pdio.getFieldVa lue("WhereToolW asFound").ToStr ing());
txtFOEComments. Text = pdio.getFieldVa lue("FOEComment s").ToString ();
chkRecovered.Ch ecked =
(pdio.getFieldV alue("ToolWasFo und").ToString( ) == "True");
chkNeedsCalibra tion.Checked =
(pdio.getFieldV alue("NeedsCali bration").ToStr ing() == "True");

}

pdio.Dispose();
}
private string getSelected(Sys tem.Web.UI.WebC ontrols.ListBox lb)
{
string result = "";
string result2 = "";

foreach (System.Web.UI. WebControls.Lis tItem item in lb.Items)
{
if (item.Selected == true)
{
result2 = result + item.Value.ToSt ring() + "\r\n";
if (result2.Length < 1025)
result = result2;
}
}
return result;
}
private void flagSelected(Sy stem.Web.UI.Web Controls.ListBo x lb, string
items)
{
if (items == null)
return;
if (items.Length < 1)
return;

string delimStr = "\r\n";
char [] delimiter = delimStr.ToChar Array();
string [] split = null;

try
{

split = items.Split(del imiter, 256);

foreach (string item in split)
{
if (item.Length > 0)
lb.Items.FindBy Value(item).Sel ected = true;
}
}
catch{};
}
private void loadDefaults()
{
txtDate.Text = System.DateTime .Now.ToString(" MM/dd/yy HH:mm");
}
private void loadDropdowns()
{
PrimitiveDataba seIO pdio = new PrimitiveDataba seIO();

pdio = new PrimitiveDataba seIO();

ddlShift.DataSo urce = pdio.getDataSet ("Items", "MTO_LTR", "select
null as Shift union Select DISTINCT Shift from Shifts where shift <>
'zzz' ORDER BY Shift");
ddlShift.DataTe xtField = "Shift";
ddlShift.DataVa lueField = "Shift";

ddlShift.DataBi nd();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

ddlAircraft.Dat aSource = pdio.getDataSet ("Items", "MTO_LTR", "Select
null as Aircraft union Select DISTINCT Aircraft from Aircraft where
aircraft <> 'zzz' ORDER BY Aircraft");
ddlAircraft.Dat aTextField = "Aircraft";
ddlAircraft.Dat aValueField = "Aircraft";

ddlAircraft.Dat aBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

ddlBuilding.Dat aSource = pdio.getDataSet ("Items", "MTO_LTR", "select
null as Building union Select DISTINCT Building from Buildings where
building <> 'zzz' ORDER BY Building");
ddlBuilding.Dat aTextField = "Building";
ddlBuilding.Dat aValueField = "Building";

ddlBuilding.Dat aBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

ddlTypeOfTool.D ataSource = pdio.getDataSet ("Items", "MTO_LTR",
"select null as Type union Select DISTINCT Type from ToolTypes where
type <> 'zzz' ORDER BY Type");
ddlTypeOfTool.D ataTextField = "Type";
ddlTypeOfTool.D ataValueField = "Type";

ddlTypeOfTool.D ataBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

ddlDescriptionO fTool.DataSourc e = pdio.getDataSet ("Items", "MTO_LTR",
"select null as Description union Select DISTINCT Description from
ToolDescription s where description <> 'zzz' ORDER BY Description");
ddlDescriptionO fTool.DataTextF ield = "Descriptio n";
ddlDescriptionO fTool.DataValue Field = "Descriptio n";

ddlDescriptionO fTool.DataBind( );

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

ddlColorOfTool. DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"select null as Color union Select DISTINCT Color from ToolColors where
color <> 'zzz' ORDER BY Color");
ddlColorOfTool. DataTextField = "Color";
ddlColorOfTool. DataValueField = "Color";

ddlColorOfTool. DataBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

lbAreaLost.Data Source = pdio.getDataSet ("Items", "MTO_LTR", "Select
DISTINCT Area from Areas where area <> 'zzz' ORDER BY Area");
lbAreaLost.Data TextField = "Area";
lbAreaLost.Data ValueField = "Area";

lbAreaLost.Data Bind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

lbAreaSearched. DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"Select DISTINCT Area from Areas where area <> 'zzz' ORDER BY Area");
lbAreaSearched. DataTextField = "Area";
lbAreaSearched. DataValueField = "Area";

lbAreaSearched. DataBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

lbEmployeeActio n.DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"Select DISTINCT Action from Actions where action <> 'zzz' and who in
('All','Mechani c') ORDER BY Action");
lbEmployeeActio n.DataTextField = "Action";
lbEmployeeActio n.DataValueFiel d = "Action";

lbEmployeeActio n.DataBind();

pdio.Dispose();

ddlSupervisor.D ataSource = getPeople("Supe rvisors");
ddlSupervisor.D ataTextField = "Individual ";
ddlSupervisor.D ataValueField = "Individual ";

ddlSupervisor.D ataBind();

pdio.Dispose();

ddl2ndSuperviso r.DataSource = getPeople("Supe rvisors");
ddl2ndSuperviso r.DataTextField = "Individual ";
ddl2ndSuperviso r.DataValueFiel d = "Individual ";

ddl2ndSuperviso r.DataBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

lbSupervisorAct ion.DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"Select DISTINCT Action from Actions where action <> 'zzz' and who in
('All','Supervi sor') ORDER BY Action");
lbSupervisorAct ion.DataTextFie ld = "Action";
lbSupervisorAct ion.DataValueFi eld = "Action";

lbSupervisorAct ion.DataBind();

pdio.Dispose();

ddlQuality.Data Source = getPeople("Qual ity");
ddlQuality.Data TextField = "Individual ";
ddlQuality.Data ValueField = "Individual ";

ddlQuality.Data Bind();

ddlSecondQualit y.DataSource = getPeople("Qual ity");
ddlSecondQualit y.DataTextField = "Individual ";
ddlSecondQualit y.DataValueFiel d = "Individual ";

ddlSecondQualit y.DataBind();

lbQualityAction .DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"Select DISTINCT Action from Actions where action <> 'zzz' and who in
('All','Quality ') ORDER BY Action");
lbQualityAction .DataTextField = "Action";
lbQualityAction .DataValueField = "Action";

lbQualityAction .DataBind();

pdio.Dispose();

ddlFOECoordinat or.DataSource = getPeople("FOE" );
ddlFOECoordinat or.DataTextFiel d = "Individual ";
ddlFOECoordinat or.DataValueFie ld = "Individual ";

ddlFOECoordinat or.DataBind();

ddlSecondFOECoo rdinator.DataSo urce = getPeople("FOE" );
ddlSecondFOECoo rdinator.DataTe xtField = "Individual ";
ddlSecondFOECoo rdinator.DataVa lueField = "Individual ";

ddlSecondFOECoo rdinator.DataBi nd();

pdio = new PrimitiveDataba seIO();

lbFOEAction.Dat aSource = pdio.getDataSet ("Items", "MTO_LTR", "Select
DISTINCT Action from Actions where action <> 'zzz' and who in
('All','FOE') ORDER BY Action");
lbFOEAction.Dat aTextField = "Action";
lbFOEAction.Dat aValueField = "Action";

lbFOEAction.Dat aBind();

pdio.Dispose();

pdio = new PrimitiveDataba seIO();

lbLocationFound .DataSource = pdio.getDataSet ("Items", "MTO_LTR",
"Select DISTINCT Area from Areas where area <> 'zzz' ORDER BY Area");
lbLocationFound .DataTextField = "Area";
lbLocationFound .DataValueField = "Area";

lbLocationFound .DataBind();

pdio.Dispose();

}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.txtEmploye eNumber.TextCha nged += new
System.EventHan dler(this.txtEm ployeeNumber_Ch anged);
this.Home.Click += new System.EventHan dler(this.Home_ Click);
this.btnPrint.C lick += new System.EventHan dler(this.btnPr int_Click);
this.btnSave.Cl ick += new System.EventHan dler(this.btnSa ve_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

public bool isValidEmployee (string perm)
{
if (perm == null)
return false;
if (perm.Length < 1)
return false;

bool result = false;

while (perm.Length > 0 && perm.StartsWith ("0") == true)
perm = perm.Substring( 1,perm.Length-1);

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "Select EmployeeNumber,
EmployeeName, Department from Employees where EmployeeNumber = '" + perm
+ "'");

if (dbio.Read())
{
result = true;
txtEmployeeNumb er.Text = perm;
txtEmployeeName .Text =
dbio.getFieldVa lue("EmployeeNa me").ToString() ;
txtDepartment.T ext = dbio.getFieldVa lue("Department ").ToString ();
}

dbio.Dispose();

return result;
}
private bool validateDateTim e(string victim)
{
bool result = true;
System.DateTime dt;

if (victim == null || victim.Length < 1)
return true;

System.IFormatP rovider format = new
System.Globaliz ation.CultureIn fo("en-US", true);

try
{
dt = System.DateTime .Parse(victim, format);
}
catch {result = false;}
return result;
}
private bool isInvalidEmploy ee()
{
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() != "Add")
return false;

foreach (System.Web.UI. Control control in pnlEmployee.Con trols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
((System.Web.UI .WebControls.Re quiredFieldVali dator)control). Valida
te();
}
foreach (System.Web.UI. Control control in pnlEmployee.Con trols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
if
(((System.Web.U I.WebControls.R equiredFieldVal idator)control) .IsValid ==
false)
{
lblMessage.Text = "*Required employee data was not entered.
Please enter all the required data then click save.";
lblMessage.Visi ble = true;
return true;
}
}
if (ddlTypeOfTool. SelectedValue.T oUpper().Trim() == "OTHER")
if (txtAdditionalC omments.Text.Le ngth < 1)
{
lblMessage.Text = "*Please enter the type of tool in the additional
comments text box.";
lblMessage.Visi ble = true;
return true;
}

if (chkNotifiedSup ervisor.Checked != true)
{
lblMessage.Text = "Please notify your supervisor then click the
'Notified Supervisor' checkbox.";
lblMessage.Visi ble = true;
return true;
}
if (chkNotifiedFOE .Checked != true)
{
lblMessage.Text = "Please notify the FOE team then click the
'Notified FOE' checkbox.";
lblMessage.Visi ble = true;
return true;
}

if (isTooLong(pnlE mployee).Length > 0)
{
lblMessage.Text = isTooLong(pnlEm ployee);
lblMessage.Visi ble = true;
return true;
}

return false;
}
private bool isInvalidSuperv isor()
{
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() == "Add")
return false;

if (isMember("Supe ruser") == false && isMember("Super visors") ==
false)
return false;

if (chkRecovered.C hecked == true)
return false;

if (ddlSupervisor. SelectedValue.L ength > 0 &&
ddlSupervisor.S electedValue.Su bstring(0,4) == "PASI")
{
if (txtSupervisorR esults.Text.Len gth < 1)
{
lblMessage.Text = "You must enter your name in the Additional
Investigation Results edit box.";
lblMessage.Visi ble = true;
return true;
}
}

foreach (System.Web.UI. Control control in pnlSupervisor.C ontrols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
((System.Web.UI .WebControls.Re quiredFieldVali dator)control). Valida
te();
}
foreach (System.Web.UI. Control control in pnlSupervisor.C ontrols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
if
(((System.Web.U I.WebControls.R equiredFieldVal idator)control) .IsValid ==
false)
{
lblMessage.Text = "*Required supervisor data was not entered.
Please enter all the required data then click save.";
lblMessage.Visi ble = true;
return true;
}
}
if (ddlSupervisor. SelectedValue.L ength < 1 &&
ddl2ndSuperviso r.SelectedValue .Length < 1)
{
lblMessage.Text = "You must select either a first shift or second
shift supervisor.";
lblMessage.Visi ble = true;
return true;
}
if (isTooLong(pnlS upervisor).Leng th > 0)
{
lblMessage.Text = isTooLong(pnlSu pervisor);
lblMessage.Visi ble = true;
return true;
}

return false;
}
private bool isInvalidQualit y()
{
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() == "Add")
return false;

if (isMember("Supe ruser") == false && isMember("Quali ty") == false)
return false;

if (chkRecovered.C hecked == true)
return false;

if (ddlQuality.Sel ectedValue.Leng th > 0 &&
ddlQuality.Sele ctedValue.Subst ring(0,4) == "PASI")
{
if (txtQualityResu lts.Text.Length < 1)
{
lblMessage.Text = "You must enter your name in the Investigation
Results By Quality Person edit box.";
lblMessage.Visi ble = true;
return true;
}
}
if (ddlSecondQuali ty.SelectedValu e.Length > 0 &&
ddlSecondQualit y.SelectedValue .Substring(0,4) == "PASI")
{
if (txtQualityResu lts.Text.Length < 1)
{
lblMessage.Text = "You must enter your name in the Investigation
Results By Quality Person edit box.";
lblMessage.Visi ble = true;
return true;
}
}
foreach (System.Web.UI. Control control in pnlQuality.Cont rols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
((System.Web.UI .WebControls.Re quiredFieldVali dator)control). Valida
te();
}
foreach (System.Web.UI. Control control in pnlQuality.Cont rols)
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
if
(((System.Web.U I.WebControls.R equiredFieldVal idator)control) .IsValid ==
false)
{
lblMessage.Text = "*Required quality data was not entered. Please
enter all the required data then click save.";
lblMessage.Visi ble = true;
return true;
}
}

if (ddlQuality.Sel ectedValue.Leng th < 1 &&
ddlSecondQualit y.SelectedValue .Length < 1)
{
lblMessage.Text = "You must select either a first shift or second
shift quality person.";
lblMessage.Visi ble = true;
return true;
}

if (isTooLong(pnlQ uality).Length > 0)
{
lblMessage.Text = isTooLong(pnlQu ality);
lblMessage.Visi ble = true;
return true;
}

return false;
}
private bool isInvalidFOE()
{
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() == "Add")
return false;

if (isMember("Supe ruser") == false && isMember("FOE") == false)
return false;

foreach (System.Web.UI. Control control in pnlFOE.Controls )
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
((System.Web.UI .WebControls.Re quiredFieldVali dator)control). Valida
te();
}
foreach (System.Web.UI. Control control in pnlFOE.Controls )
{
if (control.ID != null)
if (control.ID.Sta rtsWith("Requir edFieldValidato r"))
if
(((System.Web.U I.WebControls.R equiredFieldVal idator)control) .IsValid ==
false)
{
lblMessage.Text = "*Required FOE data was not entered. Please
enter all the required data then click save.";
lblMessage.Visi ble = true;
return true;
}
}
if (ddlFOECoordina tor.SelectedVal ue.Length < 1 &&
ddlSecondFOECoo rdinator.Select edValue.Length < 1)
{
lblMessage.Text = "You must select either a first shift or second
shift FOE coordinator.";
lblMessage.Visi ble = true;
return true;
}

if (isTooLong(pnlF OE).Length > 0)
{
lblMessage.Text = isTooLong(pnlFO E);
lblMessage.Visi ble = true;
return true;
}

return false;
}
private void disableSave()
{
Session.Add("Sa ve","Disabled") ;
}
private void enableSave()
{
Session.Remove( "Save");
}
private void btnSave_Click(o bject sender, System.EventArg s e)
{
globalWebStatic = new WebStatic(this) ;

try
{
if (Session["Save"].ToString() == "Disabled")
{
lblMessage.Text = "Please wait...";
lblMessage.Visi ble = true;
return;
}
}
catch{};

disableSave();

txtSnitch.Text = "modified";

lblMessage.Visi ble = false;

if (isInvalidEmplo yee() == true)
{
enableSave();
return;
}
if (isInvalidSuper visor() == true)
{
enableSave();
return;
}
if (isInvalidQuali ty() == true)
{
enableSave();
return;
}
if (isInvalidFOE() == true)
{
enableSave();
return;
}

if (validateDateTi me(txtDateTimeL ost.Text) == false)
{
lblMessage.Text = "The Date/Time the tool was lost must be a date in
MM/DD/YY HH:MM format. Please correct the error and click Save again.";
lblMessage.Visi ble = true;
enableSave();
return;
}
if (validateDateTi me(txtDateToolW asFound.Text) == false)
{
lblMessage.Text = "The Date/Time the tool was found must be a date
in MM/DD/YY HH:MM format. Please correct the error and click Save
again.";
lblMessage.Visi ble = true;
enableSave();
return;
}

if (isValidEmploye e(txtEmployeeNu mber.Text) == false)
{
lblMessage.Text = "Employee number not found. Please enter a valid
employee number.";
lblMessage.Visi ble = true;
enableSave();
return;
}
if (chkRecovered.C hecked == true)
{
if (txtDateToolWas Found.Text.Leng th < 1)
{
lblMessage.Text = "The Date/Time the tool was found must be entered
for recovered tools.";
lblMessage.Visi ble = true;
enableSave();
return;
}
}
if (chkRecovered.C hecked == true)
{
if (txtWhoFoundToo l.Text.Length < 1)
{
lblMessage.Text = "You must enter who found the tool for recovered
tools.";
lblMessage.Visi ble = true;
enableSave();
return;
}
}
if (chkRecovered.C hecked == true)
{
if (lbLocationFoun d.SelectedValue .Length < 1)
{
lblMessage.Text = "You must enter the location a tool was
recovered.";
lblMessage.Visi ble = true;
enableSave();
return;
}
}

if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() == "Add")
{
addRecord();
promoteDocument (retrieveReport Number());
makeTracks(retr ieveReportNumbe r());
enableSave();
Response.Redire ct("LTR_ACK.asp x");
}
else
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() ==
"Update")
{
updateRecord(Sy stem.Int32.Pars e(Request.Query String.GetValue s(1).Get
Value(0).ToStri ng()));
promoteDocument (System.Int32.P arse(Request.Qu eryString.GetVa lues(1).
GetValue(0).ToS tring()));
makeTracks(Syst em.Int32.Parse( Request.QuerySt ring.GetValues( 1).GetVa
lue(0).ToString ()));
enableSave();
Response.Redire ct("LTR_ACK.asp x");
}
enableSave();
}
private void addRecord()
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@Type", "M4-F051");
dbio.addSqlPara meter("@Subtype ", "N/A");
dbio.addSqlPara meter("@Employe eName", txtEmployeeName .Text);
dbio.addSqlPara meter("@Departm ent", txtDepartment.T ext);
dbio.addSqlPara meter("@Shift", ddlShift.Select edValue);
dbio.addSqlPara meter("@Extensi on", txtExtension.Te xt);
dbio.addSqlPara meter("@Employe eNumber", txtEmployeeNumb er.Text);
dbio.addSqlPara meter("@DateTim eCreated", txtDate.Text);
dbio.addSqlPara meter("@Aircraf t", ddlAircraft.Sel ectedValue);
dbio.addSqlPara meter("@Buildin g", ddlBuilding.Sel ectedValue);
dbio.addSqlPara meter("@TypeOfT ool", ddlTypeOfTool.S electedValue);
dbio.addSqlPara meter("@DateTim eLost", txtDateTimeLost .Text);
dbio.addSqlPara meter("@Identif yingMarks", txtIdentifyingM arks.Text);
dbio.addSqlPara meter("@Descrip tionOfTool",
ddlDescriptionO fTool.SelectedV alue);
dbio.addSqlPara meter("@ColorOf Tool", ddlColorOfTool. SelectedValue);
dbio.addSqlPara meter("@AreaToo lWasLost", getSelected(lbA reaLost));
dbio.addSqlPara meter("@AreaSea rched", getSelected(lbA reaSearched));
dbio.addSqlPara meter("@TalkedW ithCoWorkers",
chkTalkedWithCo workers.Checked );
dbio.addSqlPara meter("@Notifie dSupervisor",
chkNotifiedSupe rvisor.Checked) ;
dbio.addSqlPara meter("@Notifie dQuality", chkNotifiedQual ity.Checked);
dbio.addSqlPara meter("@Notifie dFOE", chkNotifiedFOE. Checked);
dbio.addSqlPara meter("@ActionE mployeeTook",
getSelected(lbE mployeeAction)) ;
dbio.addSqlPara meter("@Additio nalComments",
txtAdditionalCo mments.Text);
dbio.addSqlPara meter("@Supervi sor", ddlSupervisor.S electedValue);
dbio.addSqlPara meter("@SecondS upervisor",
ddl2ndSuperviso r.SelectedValue );
dbio.addSqlPara meter("@ActionS upervisorTook",
getSelected(lbS upervisorAction ));
dbio.addSqlPara meter("@Supervi sorInvestigatio nResults",
txtSupervisorRe sults.Text);
dbio.addSqlPara meter("@Quality Investigator",
ddlQuality.Sele ctedValue);
dbio.addSqlPara meter("@Quality ActionTook",
getSelected(lbQ ualityAction));
dbio.addSqlPara meter("@Quality InvestigationRe sults",
txtQualityResul ts.Text);
dbio.addSqlPara meter("@FOECoor dinator",
ddlFOECoordinat or.SelectedValu e);
dbio.addSqlPara meter("@FOEActi onTook", getSelected(lbF OEAction));
dbio.addSqlPara meter("@FOEInve stigationResult s", txtFOEResults.T ext);
dbio.addSqlPara meter("@DateToo lFound", System.DBNull.V alue);
dbio.addSqlPara meter("@WhoFoun dTool", txtWhoFoundTool .Text);
dbio.addSqlPara meter("@WhereTo olWasFound",
lbLocationFound .SelectedValue) ;
dbio.addSqlPara meter("@FOEComm ents", txtFOEComments. Text);
dbio.addSqlPara meter("@ToolWas Found", chkRecovered.Ch ecked);
dbio.addSqlPara meter("@NeedsCa libration",
chkNeedsCalibra tion.Checked);
dbio.addSqlPara meter("@SecondQ ualityPerson",
ddlSecondQualit y.SelectedValue );
dbio.addSqlPara meter("@SecondF OE",
ddlSecondFOECoo rdinator.Select edValue);

strSQL = "INSERT INTO LTR
(Type,Subtype,E mployeeName,Dep artment,Shift,E xtension,Employ eeNumber,Dat
eTimeCreated,Ai rcraft,Building ,TypeOfTool,Dat eTimeLost,Ident ifyingMarks,
DescriptionOfTo ol,ColorOfTool, AreaToolWasLost ,AreaSearched,T alkedWithCoW
orkers,Notified Supervisor,Noti fiedQuality,Not ifiedFOE,Action EmployeeTook
,AdditionalComm ents,Supervisor ,SecondSupervis or,SupervisorAc tionTook,Sup
ervisorInvestig ationResults,Qu alityInvestigat or,QualityActio nTook,Qualit
yInvestigationR esults,FOECoord inator,FOEActio nTook,FOEInvest igationResul
ts,DateToolFoun d,WhoFoundTool, WhereToolWasFou nd,FOEComments, ToolWasFound
,NeedsCalibrati on,SecondQualit yPerson,SecondF OE) ";
strSQL = strSQL +
"VALUES(@Type,@ Subtype,@Employ eeName,@Departm ent,@Shift,@Ext ension,@Empl
oyeeNumber,@Dat eTimeCreated,@A ircraft,@Buildi ng,@TypeOfTool, @DateTimeLos
t,@IdentifyingM arks,@Descripti onOfTool,@Color OfTool,@AreaToo lWasLost,@Ar
eaSearched,@Tal kedWithCoWorker s,@NotifiedSupe rvisor,@Notifie dQuality,@No
tifiedFOE,@Acti onEmployeeTook, @AdditionalComm ents,@Superviso r,@SecondSup
ervisor,@Action SupervisorTook, @SupervisorInve stigationResult s,@QualityIn
vestigator,@Qua lityActionTook, @QualityInvesti gationResults,@ FOECoordinat
or,@FOEActionTo ok,@FOEInvestig ationResults,@D ateToolFound,@W hoFoundTool,
@WhereToolWasFo und,@FOEComment s,@ToolWasFound ,@NeedsCalibrat ion,@SecondQ
ualityPerson,@S econdFOE)";

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private int retrieveReportN umber()
{
int result = -1;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "SELECT LostToolReportN umber from
LTR where EmployeeNumber = '" + txtEmployeeNumb er.Text + "' and
DateTimeCreated = '" + txtDate.Text + "'");

if (dbio.Read())
{
result = (int)dbio.getFi eldValue("LostT oolReportNumber ");
}
dbio.Dispose();

return result;
}
private void promoteDocument sv(int intLostToolRepo rtNumber)
{
int intQueue = -1;
string strAircraft = "";

SendMail smtp = new SendMail();

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "Select CurrentQueue,
ToolWasFound, Aircraft from LTR where LostToolReportN umber = " +
intLostToolRepo rtNumber.ToStri ng());

if (dbio.Read())
{
intQueue = (int)dbio.getFi eldValue("Curre ntQueue");
strAircraft = dbio.getFieldVa lue("Aircraft") .ToString();
if (dbio.getFieldV alue("ToolWasFo und").ToString( ) == "True")
intQueue = 5;
}

dbio.Dispose();

if (intQueue == -1)
return;
if (intQueue == 4)
return;

dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@LostToo lReportNumber",
intLostToolRepo rtNumber);

if (intQueue == 5)
{
intQueue = 4;
dbio.executeNon Query("UPDATE LTR set CurrentQueue = 5 WHERE
LostToolReportN umber = @LostToolReport Number");
}
else
dbio.executeNon Query("UPDATE LTR set CurrentQueue = CurrentQueue + 1
WHERE LostToolReportN umber = @LostToolReport Number");

dbio.Dispose();

dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "Select * from QueueNotificati on
where NotificationTyp e = 'Approved' and QueueNumber = " + (intQueue +
1).ToString());

while (dbio.Read())
{
smtp.from = "LostToolReport ing";
smtp.to = getTo(dbio.getF ieldValue("Send To").ToString() );
smtp.subject =
dbio.getFieldVa lue("Subject"). ToString().Repl ace("[AIRCRAFT]",strAircra f
t);
smtp.body =
dbio.getFieldVa lue("Body").ToS tring().Replace ("[DocumentNumber]",intLost
ToolReportNumbe r.ToString());
smtp.body =
smtp.body.ToStr ing().Replace("[HostName]",Dns.GetHostNa me().ToString() );
smtp.send();
}

dbio.Dispose();

}
private void promoteDocument (int intLostToolRepo rtNumber)
{
string strAircraft = "";

int intQueue = getNextQueue(in tLostToolReport Number);

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "Select Aircraft from LTR where
LostToolReportN umber = " + intLostToolRepo rtNumber.ToStri ng());

if (!dbio.Read())
{
dbio.Dispose();
return;
}

strAircraft = dbio.getFieldVa lue("Aircraft") .ToString();

dbio.Dispose();

dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
if (intQueue == -1)
dbio.addSqlPara meter("@Current Queue", 1);
else
dbio.addSqlPara meter("@Current Queue", intQueue);
dbio.addSqlPara meter("@LostToo lReportNumber",
intLostToolRepo rtNumber);

dbio.executeNon Query("UPDATE LTR set CurrentQueue = @CurrentQueue
WHERE LostToolReportN umber = @LostToolReport Number");

dbio.Dispose();

dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "Select * from QueueNotificati on
where NotificationTyp e = 'Approved' and QueueNumber = " +
intQueue.ToStri ng());

SendMail smtp = new SendMail();

while (dbio.Read())
{
smtp.from = "mi*********@ng c.com";//"LostToolReport ing";
smtp.to = getTo(dbio.getF ieldValue("Send To").ToString() );
smtp.subject =
dbio.getFieldVa lue("Subject"). ToString().Repl ace("[AIRCRAFT]",strAircra f
t);
smtp.body =
dbio.getFieldVa lue("Body").ToS tring().Replace ("[DocumentNumber]",intLost
ToolReportNumbe r.ToString());
smtp.body =
smtp.body.ToStr ing().Replace("[HostName]",Dns.GetHostNa me().ToString() );
smtp.send();
}

smtp = null;

dbio.Dispose();

}
private int getNextQueue(in t intLostToolRepo rtNumber)
{
int currentQueue = -1;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlD ataReader("MTO_ LTR", "select ToolWasFound,
len(Supervisor) + len(SecondSuper visor) as SupervisorUpdat ed,
len(QualityInve stigator) + len(SecondQuali tyPerson) as QualityUpdated,
len(FOECoordina tor) + len(SecondFOE) as FOEUpdated from LTR where
LostToolReportN umber = " + intLostToolRepo rtNumber.ToStri ng());

if (!dbio.Read())
{
dbio.Dispose();
return 1;
}

if (dbio.getFieldV alue("ToolWasFo und").ToString( ) == "True")
currentQueue = 5;
else
if ((int)dbio.getF ieldValue("Supe rvisorUpdated") == 0
&& ((int)dbio.getF ieldValue("Qual ityUpdated") != 0
|| (int)dbio.getFi eldValue("FOEUp dated") != 0))
currentQueue = -1;
else
if ((int)dbio.getF ieldValue("Supe rvisorUpdated") == 0)
currentQueue = 1;
else
if ((int)dbio.getF ieldValue("Qual ityUpdated") == 0)
currentQueue = 2;
else
if ((int)dbio.getF ieldValue("FOEU pdated") == 0)
currentQueue = 3;
else
currentQueue = 4;

dbio.Dispose();

return currentQueue;

}
private string getTo(string sendto)
{
string result = "";
string strTo = sendto;

if (strTo.Length < 1)
return "";

strTo = strTo.Replace("[","'");
strTo = strTo.Replace("]","'");
strTo = strTo.Replace(" ;",",");
strTo = " where [group] in (" + strTo + ")";

PrimitiveDataba seIO faucet = new PrimitiveDataba seIO();

faucet.createSq lDataReader("MT O_LTR", "SELECT * FROM users" + strTo);

ExchangeInfoADO xcng = new ExchangeInfoADO ();

while (faucet.Read())
{
if (faucet.getFiel dValue("Group") .ToString() == "Calibratio n")
{
if (chkNeedsCalibr ation.Checked == true)
{
if (faucet.getFiel dValue("Externa lEmail").ToStri ng().Length > 0)
result = result + ";" +
faucet.getField Value("External Email").ToStrin g();
xcng.getUserInf o(faucet.getFie ldValue("UserNa me").ToString() );
result = result + ";" + xcng.mail;
}
}
else
if (faucet.getFiel dValue("Group") .ToString() == "DCMA")
{
result = result + ";" +
faucet.getField Value("External Email").ToStrin g();
}
else
{
if (faucet.getFiel dValue("Externa lEmail").ToStri ng().Length > 0)
result = result + ";" +
faucet.getField Value("External Email").ToStrin g();
xcng.getUserInf o(faucet.getFie ldValue("UserNa me").ToString() );
result = result + ";" + xcng.mail;
}
}

xcng = null;
faucet.Dispose( );

return result;
}
private void updateRecord(in t rec_id)
{
if (Request.QueryS tring.GetValues (0).GetValue(0) .ToString() ==
"Add")
updateRecord_Em ployee(rec_id);
else
if (isMember("Supe ruser") == true)
updateRecord_Su peruser(rec_id) ;
else
if (isMember("Supe rvisors") == true)
updateRecord_Su pervisor(rec_id );
else
if (isMember("Qual ity") == true)
updateRecord_Qu ality(rec_id);
else
if (isMember("FOE" ) == true)
updateRecord_FO E(rec_id);
}
private void updateRecord_Em ployee(int rec_id)
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@Employe eName", txtEmployeeName .Text);
dbio.addSqlPara meter("@Departm ent", txtDepartment.T ext);
dbio.addSqlPara meter("@Shift", ddlShift.Select edValue);
dbio.addSqlPara meter("@Extensi on", txtExtension.Te xt);
dbio.addSqlPara meter("@Employe eNumber", txtEmployeeNumb er.Text);
dbio.addSqlPara meter("@DateTim eCreated", txtDate.Text);
dbio.addSqlPara meter("@Aircraf t", ddlAircraft.Sel ectedValue);
dbio.addSqlPara meter("@Buildin g", ddlBuilding.Sel ectedValue);
dbio.addSqlPara meter("@TypeOfT ool", ddlTypeOfTool.S electedValue);
dbio.addSqlPara meter("@DateTim eLost", txtDateTimeLost .Text);
dbio.addSqlPara meter("@Identif yingMarks", txtIdentifyingM arks.Text);
dbio.addSqlPara meter("@Descrip tionOfTool",
ddlDescriptionO fTool.SelectedV alue);
dbio.addSqlPara meter("@ColorOf Tool", ddlColorOfTool. SelectedValue);
dbio.addSqlPara meter("@AreaToo lWasLost", getSelected(lbA reaLost));
dbio.addSqlPara meter("@AreaSea rched", getSelected(lbA reaSearched));
dbio.addSqlPara meter("@TalkedW ithCoWorkers",
chkTalkedWithCo workers.Checked );
dbio.addSqlPara meter("@Notifie dSupervisor",
chkNotifiedSupe rvisor.Checked) ;
dbio.addSqlPara meter("@Notifie dQuality", chkNotifiedQual ity.Checked);
dbio.addSqlPara meter("@Notifie dFOE", chkNotifiedFOE. Checked);
dbio.addSqlPara meter("@ActionE mployeeTook",
getSelected(lbE mployeeAction)) ;
dbio.addSqlPara meter("@Additio nalComments",
txtAdditionalCo mments.Text);

strSQL = "UPDATE LTR SET
EmployeeName=@E mployeeName,Dep artment=@Depart ment,Shift=@Shi ft,Extension
=@Extension,Emp loyeeNumber=@Em ployeeNumber,Da teTimeCreated=@ DateTimeCrea
ted,Aircraft=@A ircraft,Buildin g=@Building,Typ eOfTool=@TypeOf Tool,DateTim
eLost=@DateTime Lost,Identifyin gMarks=@Identif yingMarks,Descr iptionOfTool
=@DescriptionOf Tool,ColorOfToo l=@ColorOfTool, AreaToolWasLost =@AreaToolWa
sLost,AreaSearc hed=@AreaSearch ed,TalkedWithCo Workers=@Talked WithCoWorker
s,NotifiedSuper visor=@Notified Supervisor,Noti fiedQuality=@No tifiedQualit
y,NotifiedFOE=@ NotifiedFOE,Act ionEmployeeTook =@ActionEmploye eTook,Additi
onalComments=@A dditionalCommen ts where losttoolreportn umber = " +
rec_id.ToString ();

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private void updateRecord_Su pervisor(int rec_id)
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@Supervi sor", ddlSupervisor.S electedValue);
dbio.addSqlPara meter("@SecondS upervisor",
ddl2ndSuperviso r.SelectedValue );
dbio.addSqlPara meter("@ActionS upervisorTook",
getSelected(lbS upervisorAction ));
dbio.addSqlPara meter("@Supervi sorInvestigatio nResults",
txtSupervisorRe sults.Text);

strSQL = "UPDATE LTR SET
Supervisor=@Sup ervisor,SecondS upervisor=@Seco ndSupervisor,Su pervisorActi
onTook=@ActionS upervisorTook,S upervisorInvest igationResults= @SupervisorI
nvestigationRes ults where losttoolreportn umber = " + rec_id.ToString ();

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private void updateRecord_Qu ality(int rec_id)
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@Quality Investigator",
ddlQuality.Sele ctedValue);
dbio.addSqlPara meter("@Quality ActionTook",
getSelected(lbQ ualityAction));
dbio.addSqlPara meter("@Quality InvestigationRe sults",
txtQualityResul ts.Text);
dbio.addSqlPara meter("@NeedsCa libration",
chkNeedsCalibra tion.Checked);
dbio.addSqlPara meter("@SecondQ ualityPerson",
ddlSecondQualit y.SelectedValue );

strSQL = "UPDATE LTR SET
QualityInvestig ator=@QualityIn vestigator,Qual ityActionTook=@ QualityActio
nTook,QualityIn vestigationResu lts=@QualityInv estigationResul ts,NeedsCali
bration=@NeedsC alibration,Seco ndQualityPerson =@SecondQuality Person where
losttoolreportn umber = " + rec_id.ToString ();

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private void updateRecord_FO E(int rec_id)
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@FOECoor dinator",
ddlFOECoordinat or.SelectedValu e);
dbio.addSqlPara meter("@FOEActi onTook", getSelected(lbF OEAction));
dbio.addSqlPara meter("@FOEInve stigationResult s", txtFOEResults.T ext);
if (txtDateToolWas Found.Text.Leng th > 0)
dbio.addSqlPara meter("@DateToo lFound",
txtDateToolWasF ound.Text);
else
dbio.addSqlPara meter("@DateToo lFound", System.DBNull.V alue);
dbio.addSqlPara meter("@WhoFoun dTool", txtWhoFoundTool .Text);
dbio.addSqlPara meter("@WhereTo olWasFound",
getSelected(lbL ocationFound));
dbio.addSqlPara meter("@FOEComm ents", txtFOEComments. Text);
dbio.addSqlPara meter("@ToolWas Found", chkRecovered.Ch ecked);
dbio.addSqlPara meter("@SecondF OE",
ddlSecondFOECoo rdinator.Select edValue);

strSQL = "UPDATE LTR SET
FOECoordinator= @FOECoordinator ,FOEActionTook= @FOEActionTook, FOEInvestiga
tionResults=@FO EInvestigationR esults,DateTool Found=@DateTool Found,WhoFou
ndTool=@WhoFoun dTool,WhereTool WasFound=@Where ToolWasFound,FO EComments=@F
OEComments,Tool WasFound=@ToolW asFound,SecondF OE=@SecondFOE where
losttoolreportn umber = " + rec_id.ToString ();

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private void updateRecord_Su peruser(int rec_id)
{
string strSQL;

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@Type", "M4-F051");
dbio.addSqlPara meter("@Subtype ", "N/A");
dbio.addSqlPara meter("@Employe eName", txtEmployeeName .Text);
dbio.addSqlPara meter("@Departm ent", txtDepartment.T ext);
dbio.addSqlPara meter("@Shift", ddlShift.Select edValue);
dbio.addSqlPara meter("@Extensi on", txtExtension.Te xt);
dbio.addSqlPara meter("@Employe eNumber", txtEmployeeNumb er.Text);
dbio.addSqlPara meter("@DateTim eCreated", txtDate.Text);
dbio.addSqlPara meter("@Aircraf t", ddlAircraft.Sel ectedValue);
dbio.addSqlPara meter("@Buildin g", ddlBuilding.Sel ectedValue);
dbio.addSqlPara meter("@TypeOfT ool", ddlTypeOfTool.S electedValue);
dbio.addSqlPara meter("@DateTim eLost", txtDateTimeLost .Text);
dbio.addSqlPara meter("@Identif yingMarks", txtIdentifyingM arks.Text);
dbio.addSqlPara meter("@Descrip tionOfTool",
ddlDescriptionO fTool.SelectedV alue);
dbio.addSqlPara meter("@ColorOf Tool", ddlColorOfTool. SelectedValue);
dbio.addSqlPara meter("@AreaToo lWasLost", getSelected(lbA reaLost));
dbio.addSqlPara meter("@AreaSea rched", getSelected(lbA reaSearched));
dbio.addSqlPara meter("@TalkedW ithCoWorkers",
chkTalkedWithCo workers.Checked );
dbio.addSqlPara meter("@Notifie dSupervisor",
chkNotifiedSupe rvisor.Checked) ;
dbio.addSqlPara meter("@Notifie dQuality", chkNotifiedQual ity.Checked);
dbio.addSqlPara meter("@Notifie dFOE", chkNotifiedFOE. Checked);
dbio.addSqlPara meter("@ActionE mployeeTook",
getSelected(lbE mployeeAction)) ;
dbio.addSqlPara meter("@Additio nalComments",
txtAdditionalCo mments.Text);
dbio.addSqlPara meter("@Supervi sor", ddlSupervisor.S electedValue);
dbio.addSqlPara meter("@SecondS upervisor",
ddl2ndSuperviso r.SelectedValue );
dbio.addSqlPara meter("@ActionS upervisorTook",
getSelected(lbS upervisorAction ));
dbio.addSqlPara meter("@Supervi sorInvestigatio nResults",
txtSupervisorRe sults.Text);
dbio.addSqlPara meter("@Quality Investigator",
ddlQuality.Sele ctedValue);
dbio.addSqlPara meter("@Quality ActionTook",
getSelected(lbQ ualityAction));
dbio.addSqlPara meter("@Quality InvestigationRe sults",
txtQualityResul ts.Text);
dbio.addSqlPara meter("@FOECoor dinator",
ddlFOECoordinat or.SelectedValu e);
dbio.addSqlPara meter("@FOEActi onTook", getSelected(lbF OEAction));
dbio.addSqlPara meter("@FOEInve stigationResult s", txtFOEResults.T ext);
if (txtDateToolWas Found.Text.Leng th > 0)
dbio.addSqlPara meter("@DateToo lFound", txtDateToolWasF ound.Text);
else
dbio.addSqlPara meter("@DateToo lFound", System.DBNull.V alue);
dbio.addSqlPara meter("@WhoFoun dTool", txtWhoFoundTool .Text);
dbio.addSqlPara meter("@WhereTo olWasFound",
getSelected(lbL ocationFound));
dbio.addSqlPara meter("@FOEComm ents", txtFOEComments. Text);
dbio.addSqlPara meter("@ToolWas Found", chkRecovered.Ch ecked);
dbio.addSqlPara meter("@NeedsCa libration",
chkNeedsCalibra tion.Checked);
dbio.addSqlPara meter("@SecondQ ualityPerson",
ddlSecondQualit y.SelectedValue );
dbio.addSqlPara meter("@SecondF OE",
ddlSecondFOECoo rdinator.Select edValue);

strSQL = "UPDATE LTR SET
Type=@Type,Subt ype=@Subtype,Em ployeeName=@Emp loyeeName,Depar tment=@Depar
tment,Shift=@Sh ift,Extension=@ Extension,Emplo yeeNumber=@Empl oyeeNumber,D
ateTimeCreated= @DateTimeCreate d,Aircraft=@Air craft,Building= @Building,Ty
peOfTool=@TypeO fTool,DateTimeL ost=@DateTimeLo st,IdentifyingM arks=@Identi
fyingMarks,Desc riptionOfTool=@ DescriptionOfTo ol,ColorOfTool= @ColorOfTool
,AreaToolWasLos t=@AreaToolWasL ost,AreaSearche d=@AreaSearched ,TalkedWithC
oWorkers=@Talke dWithCoWorkers, NotifiedSupervi sor=@NotifiedSu pervisor,Not
ifiedQuality=@N otifiedQuality, NotifiedFOE=@No tifiedFOE,Actio nEmployeeToo
k=@ActionEmploy eeTook,Addition alComments=@Add itionalComments ,Supervisor=
@Supervisor,Sec ondSupervisor=@ SecondSuperviso r,SupervisorAct ionTook=@Act
ionSupervisorTo ok,SupervisorIn vestigationResu lts=@Supervisor Investigatio
nResults,Qualit yInvestigator=@ QualityInvestig ator,QualityAct ionTook=@Qua
lityActionTook, QualityInvestig ationResults=@Q ualityInvestiga tionResults,
FOECoordinator= @FOECoordinator ,FOEActionTook= @FOEActionTook, FOEInvestiga
tionResults=@FO EInvestigationR esults,DateTool Found=@DateTool Found,WhoFou
ndTool=@WhoFoun dTool,WhereTool WasFound=@Where ToolWasFound,FO EComments=@F
OEComments,Tool WasFound=@ToolW asFound,NeedsCa libration=@Need sCalibration
,SecondQualityP erson=@SecondQu alityPerson,Sec ondFOE=@SecondF OE where
losttoolreportn umber = " + rec_id.ToString ();

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private int getInteger(stri ng id,
System.Web.UI.W ebControls.Repe aterItem row)
{
System.Web.UI.W ebControls.Text Box txtBox =
(System.Web.UI. WebControls.Tex tBox)getControl (id, row);

if (txtBox == null)
return 0;
if (txtBox.Text.Le ngth < 1)
return 0;
return System.Int32.Pa rse(txtBox.Text );
}
private bool getBool(string id, System.Web.UI.W ebControls.Repe aterItem
row)
{
System.Web.UI.W ebControls.Chec kBox chkBox =
(System.Web.UI. WebControls.Che ckBox)getContro l(id, row);

if (chkBox == null)
return false;

return chkBox.Checked;
}
private string getString(strin g id,
System.Web.UI.W ebControls.Repe aterItem row)
{
System.Web.UI.W ebControls.Text Box txtBox =
(System.Web.UI. WebControls.Tex tBox)getControl (id, row);

if (txtBox == null)
return null;
if (txtBox.Text.Le ngth < 1)
return "";

return txtBox.Text;
}
private System.Web.UI.C ontrol getControl(stri ng id,
System.Web.UI.W ebControls.Repe aterItem row)
{
foreach (System.Web.UI. Control control in row.Controls)
{
if (control.ID == id)
return control;
}

return null;
}
private void Home_Click(obje ct sender, System.EventArg s e)
{
string strRedirect;

strRedirect = "<script language='Javas cript'>";
strRedirect += "parent.main.lo cation.href='we lcome.aspx';";
strRedirect += "</script>";

Response.Write( strRedirect);
}
private bool isMember(string strGroup)
{
bool result = false;

PrimitiveDataba seIO faucet = new PrimitiveDataba seIO();

faucet.createSq lDataReader("MT O_LTR", "SELECT username FROM users
WHERE [group] = '" + strGroup + "' and username = '" +
User.Identity.N ame.Substring(1 0, User.Identity.N ame.Length - 10) + "'");

if (faucet.Read())
{
result = true;
}

faucet.Dispose( );

return result;
}
private bool isAuthorized(in t intQueue)
{
string strGroup = "";

if (intQueue == 0)
return true;
if (intQueue == 4)
return false;
if (intQueue == 5)
return false;

switch (intQueue)
{
case 1:
strGroup = "Supervisor s";
break;
case 2:
strGroup = "Quality";
break;
case 3:
strGroup = "FOE";
break;
default:
return false;
}

return isMember(strGro up);
}
private DataSet getPeople(strin g group)
{
DataSet result = new DataSet("people ");
DataRow row;
DataColumn col;

result.Tables.A dd();

col = new DataColumn();
col.DataType = System.Type.Get Type("System.St ring");
col.ColumnName= "Individual ";
result.Tables[0].Columns.Add(co l);

row = result.Tables[0].NewRow();
row["Individual "] = null;
result.Tables[0].Rows.Add(row);

PrimitiveDataba seIO faucet = new PrimitiveDataba seIO();

faucet.createSq lDataReader("MT O_LTR", "SELECT username FROM users
where [group] = '" + group + "' order by username");

ExchangeInfoADO xcng = new ExchangeInfoADO ();

while(faucet.Re ad())
{
if (faucet.getFiel dValue("usernam e").ToString(). Substring(0,4) ==
"PASI")
{
row = result.Tables[0].NewRow();
row["Individual "] = faucet.getField Value("username ").ToString ();
result.Tables[0].Rows.Add(row);
}
else
{
xcng.name = "";
xcng.getUserInf o(faucet.getFie ldValue("userna me").ToString() );

if (xcng.name != null && xcng.name.Lengt h > 2)
{
row = result.Tables[0].NewRow();
row["Individual "] = xcng.name;
result.Tables[0].Rows.Add(row);
}
}
}

xcng = null;

faucet.Dispose( );

return result;
}

private void txtEmployeeNumb er_Changed(obje ct sender, System.EventArg s
e)
{
isValidEmployee (txtEmployeeNum ber.Text);
}
private void makeTracks(int id)
{
string strSQL;
string strMemberships = "";

if (isMember("Supe ruser") == true)
strMemberships = strMemberships + "Superuser| ";
if (isMember("Supe rvisors") == true)
strMemberships = strMemberships + "Supervisor s|";
if (isMember("Qual ity") == true)
strMemberships = strMemberships + "Quality|";
if (isMember("FOE" ) == true)
strMemberships = strMemberships + "FOE|";
if (isMember("DCMA ") == true)
strMemberships = strMemberships + "DCMA|";

if (strMemberships .Length < 1)
strMemberships = "Employee|" ;

strMemberships = strMemberships. Substring(0,str Memberships.Len gth
-1);

PrimitiveDataba seIO dbio = new PrimitiveDataba seIO();

dbio.createSqlC ommand("MTO_LTR ");
dbio.addSqlPara meter("@ID", id);
dbio.addSqlPara meter("@DateTim eLogged", System.DateTime .Now);
dbio.addSqlPara meter("@Documen tType", "M4-F051");
dbio.addSqlPara meter("@Documen tSubtype", "N/A");
dbio.addSqlPara meter("@QueueNa me", strMemberships) ;
dbio.addSqlPara meter("@PlacedH ereBy", User.Identity.N ame);

strSQL = "INSERT INTO DocumentTracks
(ID,DateTimeLog ged,DocumentTyp e,DocumentSubty pe,QueueName,Pl acedHereBy)
";
strSQL = strSQL +
"VALUES(@ID,@Da teTimeLogged,@D ocumentType,@Do cumentSubtype,@ QueueName,@P
lacedHereBy)";

dbio.executeNon Query(strSQL);

dbio.Dispose();
}
private void btnPrint_Click( object sender, System.EventArg s e)
{
string strReport =
"LTR_ReportView .aspx?Report=Lo stToolReport&Se lectionFormula= {LTR.LostToo
lReportNumber}= " + txtLostToolRepo rtNo.Text + "";

Response.Redire ct(strReport);
}
private string isTooLong(Syste m.Web.UI.WebCon trols.Panel pnl)
{
foreach (System.Web.UI. Control control in pnl.Controls)
{
if (control.GetTyp e().FullName ==
"System.Web.UI. WebControls.Tex tBox")
{
if (((System.Web.U I.WebControls.T extBox)control) .Text.Length >
((System.Web.UI .WebControls.Te xtBox)control). MaxLength)
{
((System.Web.UI .WebControls.Te xtBox)control). Font.Bold = true;
((System.Web.UI .WebControls.Te xtBox)control). ForeColor =
System.Drawing. Color.Red;
return "The text you typed is too long to be stored in the Lost
Tool Reporting database. Please adjust the text length.";
}
else
{
((System.Web.UI .WebControls.Te xtBox)control). Font.Bold = false;
((System.Web.UI .WebControls.Te xtBox)control). ForeColor =
System.Drawing. Color.Black;
}
}
}

return "";
}

}
}


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5
OK... so which is line 204, where the exception is occurring?

Nov 16 '05 #6

Sorry that is the wrong code. Below is the code where I'm getting the
exception.
ddlAircraft.Ite ms.FindByValue( pdio.getFieldVa lue("Aircraft") .ToString())
.Selected = true;

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
19178
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
13
15175
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports designer it shows up very fast. When the report is printed from my application it takes about ten times as long to get the report to appear. When printing straight from the Crystal Reports
0
4492
by: Dr. Indera | last post by:
hello, i previously posted the questions below on several crystal reports newsgroups, including the one for the company that makes crystal reports, but never got an answer, so i'm hoping that someone on this board knows the answers to them. the questions are for the version of crystal that ships with visual studio.net 2003. if it helps, the reports that i create are in a visual basic.net project. it was recommended that i post the...
2
4933
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set on all reports)? Thanks for any and all help, in advance :) Mythran
1
12174
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to know how will this affect a report rendered by a crystal viewer. I have a web page with a crystal viewer rendering the report on the page. I build my application in one of my development machines and deploy it
1
3082
by: bthomas71chevy | last post by:
I have just setup a WebServer and all the applications work fine, but when every any of the applications try to generate a Crystal Report the page errors out. "File or assembly name CrystalKeyCodeLib, or one of its dependencies, was not found." I read that the 4 MSM files need to be moved to the a MERGE MODULES folder in the Common Files folder, but didn't seem to do a thing.
0
2270
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a SQL Server DB (pull method). 3.)The Stored Proc has two input parameters of type date. 4.)The Stored Proc is a rather complex proc that was not written by me, but does work(see next item). It currently returns about 13K rows of data. 5.)The...
9
8270
by: Altman | last post by:
I am currently using ASP.Net 2003 and will be upgrading to 2005 sometime in the near future. I have been having issues with using Crystal Reports that were included with .Net to handle my reporting needs. I was wondering if anybody has an opinion on how the new reportViewer control works in comparison to Crystal. One of the main problems I have been having with Crystal Reports is that they seem to load very slow no matter how small the...
0
2976
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
11
9688
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.