align="justify"> {
/// lt; summary gt;
/// Головна точка входу для програми.
/// lt;/summary gt;
[STAThread] static void Main ()
{. EnableVisualStyles () ;. SetCompatibleTextRenderingDefault (false); splashScreen=new SplashScreenForm (); end=DateTime.Now + TimeSpan.FromSeconds (2) ;. Show (); (end gt; DateTime.Now)
{. DoEvents ();
}. Close () ;. Dispose (); authorizationForm=new AuthorizationAndSelectDBForm () ;. Visible=true; (authorizationForm.selectDB == false amp; amp; authorizationForm.close == false)
{. DoEvents ();
} mainForm=new MainForm (); (authorizationFormboBoxLogin.Text == Адміністратор amp; amp; authorizationForm.textBoxPassword.Text == adm )
{. admin=true;
}
{(authorizationFormboBoxLogin.Text == Менеджер amp; amp; authorizationForm.textBoxPassword.Text == men )
{. admin=false;
}
{. Show ( Помилка пароля або логіна raquo ;, Вхід заборонено raquo ;, MessageBoxButtons.OK, MessageBoxIcon.Error) ;;
}
} (authorizationForm.close) ;. Run (mainForm);
}
}
}
Текст модуля SQLOperations
System;System.Collections.Generic;System.Data.SqlClient;System.Windows.Forms;MariosWindows
{SqlOperation
{
//З'єднання з БД T-FLEX DOCs (SQL-аутентифікація) SqlConnection GetConnection (string source)
{connection=null; sqlConStringBuilder=new SqlConnectionStringBuilder () ;. DataSource=source; .InitialCatalog= MariosWindows raquo ;;. Password=Decoder.decode ( 36-57-300-192-300-136-201-57-36- raquo ;, 377 raquo ;, 121 ) ;. UserID= admin raquo ;;=new SqlConnection (sqlConStringBuilder.ToString ());
{= new SqlConnection (sqlConStringBuilder.ToString ()) ;. ClearPool (connection) ;. Open (); connection;
} (Exception exc)
{. Show (exc.Message);
} connection;
}
//З'єднання з БД T-FLEX DOCs (SQL-аутентифікація)
public void CheckConnection (string source)
{connection=null; sqlConStringBuilder=new SqlConnectionStringBuilder () ;. DataSource=source; .InitialCatalog= MariosWindows raquo ;;. Password=Decoder.decode ( 36-57-300-192-300-136-201-57-36- raquo ;, 377 raquo ;, 121 ) ;. UserID= admin raquo ;;=new SqlConnection (sqlConStringBuilder.ToString ());=new SqlConnection (sqlConStringBuilder.ToString ()) ;. ClearPool (connection) ;. Open () ;. Close ();
}
//Отримати сотрудніковList lt; Employee gt; GetEmployees (string source)
{employees=new List lt; Employee gt; (); connection=GetConnection (source); specificationsQuery=String.Format (
@" SELECT Id ,,,,,,,,,
[Address], Employees" ); specificationsCommand=new SqlCommand (specificationsQuery, connection) ;. CommandTimeout=0; reader=specificationsCommand.ExecuteReader (); (reader.Read ())
{employee=new Employee () ;. Id=Convert.ToInt32 (reader [0] .ToString ()) ;. Surname=reader [1] .ToString () ;. Name=reader [ 2] .ToString () ;. Patronomic=reader [3] .ToString () ;. BusinessPhone=reader [4] .ToString () ;. Email=reader [5] .ToString () ;. PasportName=reader [6].ToString () ;. PasportSeries=reader [7] .ToString () ;. Profession=reader [8] .ToString () ;. Address=reader [9] .ToString () ;. Birthday=Convert.ToDateTime (reader [ 10]). Date; .Add (employee);
}. Close () ;. Close (); employees;
}
//Отримати список услугDictionary lt; string, List lt; Service gt; gt; GetServices (string source)
{categoryServices=new Dictionary lt; string, List lt; Service gt; gt; (); services=new List lt; Service gt; (); connection=GetConnection (source); specificationsQuery=String.Format (
@" SELECT [Id]
, [ServicesKind]
, [Cost]
, [Category] [MariosWindows]. [dbo]. [Services] BY Category" ); specificationsCommand=new SqlCommand (specificationsQuery, connection) ;. CommandTimeout=0; reader=specificationsCommand.ExecuteReader () ; key=string.Empty; (reader.Read ())
{service=new Service () ;. Id=Convert.ToInt32 (reader [0]) ;. Name=rea...