New to Visual Studio (C# Question)

EvilAlchemist

2[H]4U
Joined
Jan 11, 2008
Messages
2,730
About 6 years ago, I worked for a very small Sheriff Dept and plan to go back there soon.

While, I was there, I wrote a simply bat file to help with reports.

Here is the original code (well the chunk I need help with)
Code:
set Case=
set /P Case=   Enter the Last Five of MCSD Case Number: %=%
if "%Case%"=="" goto input
echo.
echo. 
echo. 
echo      Your Case Numbers Is: %Year%-C-%Case%
echo.
echo.

:: Confirm Case Number before Case Number is Saved in Batch File 
:choice
set /P c=   Is the Case Number Correct?  [Y/N]?
if /I "%c%" EQU "Y" goto :TIBRS2
if /I "%c%" EQU "N" goto :ManualTIBRS

:TIBRS2
::Duplicate file CheCK
IF EXIST \\Mcj_pdc\DeputyReports\TIBRS\%Year%-C-%Case%.pdf (goto TIBRS3) ELSE (echo.)

copy "\\Mcj_pdc\DeputyReports\MasterForms\TIBRS.pdf" \\Mcj_pdc\DeputyReports\TIBRS\%Year%-C-%Case%.pdf

:TIBRS3
start AcroRd32.exe /A "navpanes=0&messages=0" \\Mcj_pdc\DeputyReports\TIBRS\%Year%-C-%Case%.pdf
goto menu

I have been working with Visual Studio 2012 and learning very much so far ..

Can anyone point me to some resources on where I can learn to replicate this in the new program.

It basically had them enter last five of case number ( year was auto based on system)
Copy or open based on if it existed ...

I want to learn this so any help would be beneficial.
 
So Update #1

I have been able to figure out the if - then statement using test names.

Code:
        FileInfo file = new FileInfo(@"\\STORAGE\Deputy\Forms\TIBRS.pdf");
        private void TIBRS_Click(object sender, EventArgs e)
        {
            if (File.Exists(@"\\STORAGE\Reports\Case_Holder.pdf"))
            {
                System.Diagnostics.Process.Start(@"\\STORAGE\Reports\Case_Holder.pdf");
            }
            else
            {
                file.CopyTo(@"\\STORAGE\Reports\Case_Holder.pdf");
                System.Diagnostics.Process.Start(@"\\STORAGE\Reports\Case_Holder.pdf");
            }

Now I am needing to get the data from a text field ... then pass that on to the if then statement
 
Last edited:
Use the Text property of the text box control

Okay , I have the date part worked out correctly now ... i think


Code:
 InitializeComponent();
            Case_Number.Text = DateTime.Today.ToString("yyyy");
            Case_Number.AppendText("-C-");
 
If you are setting the TextBox's Text property to a value, why use a TextBox at all? Why not just use a string variable?
 
Got this entire problem solved .. thanks to everyone for the help.

My code is not the cleanest but it is stable and working!!!
 
Second Question .. Deleted .. found answer and took different approach
 
Last edited:
Unrelated; surely there's some decent commercial software available to deal with police report/case filings?
 
Unrelated; surely there's some decent commercial software available to deal with police report/case filings?

The software packages do exist but a very expensive for small departments.

Why most of the smaller agencies still do hand written reports.

Only medium to large agencies can afford the base software, not to mention the customization needed to make it state compliant, then the "maintenance" fee companies charge for support/per use license.
 
Back
Top