nd (query, connection) ;. CommandTimeout=0; reader2=specificationsEmployeesCommand.ExecuteReader (); (reader2.Read ())
{employee=new Employee () ;. Id=Convert.ToInt32 (reader2 [0] .ToString ()) ;. Surname=reader2 [1] .ToString () ;. Name=reader2 [ 2] .ToString () ;. Patronomic=reader2 [3] .ToString () ;. BusinessPhone=reader2 [4] .ToString () ;. Email=reader2 [5] .ToString () ;. PasportName=reader2 [6].ToString () ;. PasportSeries=reader2 [7] .ToString () ;. Profession=reader2 [8] .ToString () ;. Address=reader2 [9] .ToString () ;. Birthday=Convert.ToDateTime (reader2 [ 10]). Date; (reader2 [11]!=DBNull.Value) .PersonHour=Convert.ToDouble (reader2 [11]) ;. PersonHour=0; .Add (employee);
}. Employees=employees; .Close (); services=new List lt; Service gt; (); specificationsServiceQuery=String.Format (
@" SELECT s. [Id]
, s. [ServicesKind]
, s. [Cost]
, s. [Category]
, so.Count [Services] s INNER JOIN OrdersServices so ON (s.Id=so.idServices) so.IdOrder={0} BY Category" , order.IdOrder);
var specificationsServiceCommand=new SqlCommand (specificationsServiceQuery, connection);
specificationsServiceCommand.CommandTimeout=0; reader3=specificationsServiceCommand.ExecuteReader (); (reader3.Read ())
{service=new Service () ;. Id=Convert.ToInt32 (reader3 [0]) ;. Name=reader3 [1] .ToString () ;. Cost=Convert.ToDouble (reader3 [ 2] .ToString ()) ;. Category=reader3 [3] .ToString () ;. Count=Convert.ToInt32 (reader3 [4]) ;. Add (service);
}. Services=services; .Close ();
var configurations=new List lt; Configuration gt; ();
string specificationsConfigurationQuery=String.Format (
@" SELECT conf. [Id]
, conf. [ConfigurationKind]
, conf. [PriceWithMargin]
, conf. [PriceSupplier]
, conf. [CountStore]
, conf. [Category]
, oc.Count [MariosWindows]. [dbo]. [Configuration] conf INNER JOIN OrdersConfigurations oc ON (conf.Id=oc.IdConfiguration) oc.IdOrder={0} BY Category" , order.IdOrder);
var specificationsConfigurationCommand=new SqlCommand (specificationsConfigurationQuery, connection);
specificationsConfigurationCommand.CommandTimeout=0; reader4=specificationsConfigurationCommand.ExecuteReader (); (reader4.Read ())
{configuration=new Configuration () ;. Id=Convert.ToInt32 (reader4 [0]) ;. Name=reader4 [1] .ToString () ;. PriceWithMargin=Convert.ToDouble (reader4 [ 2] .ToString ()) ;. PriceSupplier=Convert.ToDouble (reader4 [3] .ToString ()) ;. CountStore=Convert.ToInt32 (reader4 [4] .ToString ()) ;. Category=reader4 [5]. ToString () ;. Count=Convert.ToInt32 (reader4 [6]) ;. Add (configuration);
}. Configurations=configurations; .Close ();
}. Close (); orders;
}
//Отримати список ПоставщіковList lt; Supplier gt; GetSuppliers (string source)
{listSuppliers=new List lt; Supplier gt; ();
SqlConnection connection=GetConnection (source); specificationsQuery=String.Format (
@" SELECT [Id]
, [Name]
, [Address]
, [INN]
, [KPP] [MariosWindows]. [dbo]. [Suppliers] By Name" );
var specificationsCommand=new SqlCommand (specificationsQuery, connection);
specificationsCommand.CommandTimeout=0; reader=specificationsCommand.ExecuteReader (); (reader.Read ())
{supplier=new Supplier () ;. Id=Convert.ToInt32 (reader [0]) ;. Name=reader [1] .ToString () ;. Address=reader [2] .ToString () ;. INN=reader [3] .ToString () ;. KPP=reader [4] .ToString () ;. Add (supplier);
}. Close () ;. Close (); listSuppliers;
}
} SqlFindOrder
{static string FindOrder=String.Format (@" SELECT o.IdOrder
, o. [OrderNumber]
, o. [OrderDate]
, o. [TermPerfomance]
, o. [PaymentKind]
, o. [AdvancePayment]
, o. [TotalSum]
, o. [OrderPaid]
, o. [BeginWorkDate]
, c.Family
, c.Name
, c.Patronomic
, c.AddressResidence
, c....