Simple database: Difference between revisions

Line 378:
{
//
// For appropriate use of this program
// use standard Windows Command Processor or cmd.exe
//
Line 389:
// To start cmd just double click at cmd.bat file.
//
//
//
// Console application command line start command
Line 422:
//
//
//
{
//
// Command line example
Line 438 ⟶ 439:
//
// Brackets and space between arguments and parameters are necessary.
// Quotes must be used when parameters have more than one word.
//
// If not used as shown in examples, program will show error message.
//
Line 488 ⟶ 489:
// Check parameters
//
bool parameters_ok = true;
foreach (string a in args)
{
if(!a.StartsWith("[") || !a.EndsWith("]"))
{
parameters_ok = !parameters_ok;
break;
}
}
//
// Minimum one parameter, category
// Add new entry to Data base document
//
if(parameters_okargs.Length==1)
{
//
//
//
Console.WriteLine();
Console.WriteLine(" ParametersMissing areParameters okError..... ");
Console.WriteLine();
}
Console.WriteLine(" Writing new entry to database..... ");
//else
{
// Create new Data base entry
bool parameters_ok = true;
//
args[0] = string.Empty;
string line = string.Empty;
foreach (string a in args)
{
if(!a.StartsWith("[") || !a.EndsWith("]"))
line+=a;
{
parameters_ok = !parameters_ok;
break;
}
}
line+="[" + DateTime.Now.ToString() + "]";
args[0] = "[" + DateTime.Now.ToString() + "]";
//
// WriteAdd new entry to Data base document
//
StreamWriter w = new StreamWriter("Data base.txt",true);
w.WriteLine(line);
//
if(parameters_ok)
// Close and dispose stream writer
//{
w.Close(); //
w.Dispose(); //
//
Console.WriteLine();
//
Console.WriteLine(" Parameters are ok..... ");
//
Console.WriteLine();
Console.WriteLine(" NewWriting new entry is written to database..... ");
//
// Create new Data base entry
//
args[0] = string.Empty;
string line = string.Empty;
foreach (string a in args)
{
line+=a;
}
line+="[" + DateTime.Now.ToString() + "]";
args[0] = "[" + DateTime.Now.ToString() + "]";
//
// Add newWrite entry to Data base document
//
StreamWriter w = new StreamWriter("Data base.txt",true);
w.WriteLine(line);
//
// Close and dispose stream writer
//
w.Close();
w.Dispose();
//
//
//
Console.WriteLine();
Console.WriteLine(" Writing newNew entry is written to database..... ");
 
Create_Print_Documents(args);
//
//
//
Console.WriteLine();
Console.WriteLine(" Add new entry command executed. ");
//
//
//
}
else
{
Console.WriteLine();
Console.WriteLine(" ! Parameters are not ok ! ");
Console.WriteLine();
Console.WriteLine(" Add new entry command is not executed. ");
Console.WriteLine();
}
}
}