DataClasses1.designer.cs 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635
  1. #pragma warning disable 1591
  2. //------------------------------------------------------------------------------
  3. // <auto-generated>
  4. // Этот код создан программой.
  5. // Исполняемая версия:4.0.30319.42000
  6. //
  7. // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
  8. // повторной генерации кода.
  9. // </auto-generated>
  10. //------------------------------------------------------------------------------
  11. namespace lyahov_tim
  12. {
  13. using System.Data.Linq;
  14. using System.Data.Linq.Mapping;
  15. using System.Data;
  16. using System.Collections.Generic;
  17. using System.Reflection;
  18. using System.Linq;
  19. using System.Linq.Expressions;
  20. using System.ComponentModel;
  21. using System;
  22. [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="lyahov_port")]
  23. public partial class DataClasses1DataContext : System.Data.Linq.DataContext
  24. {
  25. private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
  26. #region Определения метода расширяемости
  27. partial void OnCreated();
  28. partial void InsertUsers(Users instance);
  29. partial void UpdateUsers(Users instance);
  30. partial void DeleteUsers(Users instance);
  31. partial void InsertTickets(Tickets instance);
  32. partial void UpdateTickets(Tickets instance);
  33. partial void DeleteTickets(Tickets instance);
  34. partial void InsertRoutes(Routes instance);
  35. partial void UpdateRoutes(Routes instance);
  36. partial void DeleteRoutes(Routes instance);
  37. partial void InsertSchedules(Schedules instance);
  38. partial void UpdateSchedules(Schedules instance);
  39. partial void DeleteSchedules(Schedules instance);
  40. partial void InsertRoles(Roles instance);
  41. partial void UpdateRoles(Roles instance);
  42. partial void DeleteRoles(Roles instance);
  43. partial void InsertOffices(Offices instance);
  44. partial void UpdateOffices(Offices instance);
  45. partial void DeleteOffices(Offices instance);
  46. partial void InsertCountries(Countries instance);
  47. partial void UpdateCountries(Countries instance);
  48. partial void DeleteCountries(Countries instance);
  49. partial void InsertCabinTypes(CabinTypes instance);
  50. partial void UpdateCabinTypes(CabinTypes instance);
  51. partial void DeleteCabinTypes(CabinTypes instance);
  52. partial void InsertAirports(Airports instance);
  53. partial void UpdateAirports(Airports instance);
  54. partial void DeleteAirports(Airports instance);
  55. partial void InsertAircrafts(Aircrafts instance);
  56. partial void UpdateAircrafts(Aircrafts instance);
  57. partial void DeleteAircrafts(Aircrafts instance);
  58. #endregion
  59. public DataClasses1DataContext() :
  60. base(global::lyahov_tim.Properties.Settings.Default.lyahov_portConnectionString, mappingSource)
  61. {
  62. OnCreated();
  63. }
  64. public DataClasses1DataContext(string connection) :
  65. base(connection, mappingSource)
  66. {
  67. OnCreated();
  68. }
  69. public DataClasses1DataContext(System.Data.IDbConnection connection) :
  70. base(connection, mappingSource)
  71. {
  72. OnCreated();
  73. }
  74. public DataClasses1DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  75. base(connection, mappingSource)
  76. {
  77. OnCreated();
  78. }
  79. public DataClasses1DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  80. base(connection, mappingSource)
  81. {
  82. OnCreated();
  83. }
  84. public System.Data.Linq.Table<Users> Users
  85. {
  86. get
  87. {
  88. return this.GetTable<Users>();
  89. }
  90. }
  91. public System.Data.Linq.Table<Tickets> Tickets
  92. {
  93. get
  94. {
  95. return this.GetTable<Tickets>();
  96. }
  97. }
  98. public System.Data.Linq.Table<Routes> Routes
  99. {
  100. get
  101. {
  102. return this.GetTable<Routes>();
  103. }
  104. }
  105. public System.Data.Linq.Table<Schedules> Schedules
  106. {
  107. get
  108. {
  109. return this.GetTable<Schedules>();
  110. }
  111. }
  112. public System.Data.Linq.Table<Roles> Roles
  113. {
  114. get
  115. {
  116. return this.GetTable<Roles>();
  117. }
  118. }
  119. public System.Data.Linq.Table<Offices> Offices
  120. {
  121. get
  122. {
  123. return this.GetTable<Offices>();
  124. }
  125. }
  126. public System.Data.Linq.Table<Countries> Countries
  127. {
  128. get
  129. {
  130. return this.GetTable<Countries>();
  131. }
  132. }
  133. public System.Data.Linq.Table<CabinTypes> CabinTypes
  134. {
  135. get
  136. {
  137. return this.GetTable<CabinTypes>();
  138. }
  139. }
  140. public System.Data.Linq.Table<Airports> Airports
  141. {
  142. get
  143. {
  144. return this.GetTable<Airports>();
  145. }
  146. }
  147. public System.Data.Linq.Table<Aircrafts> Aircrafts
  148. {
  149. get
  150. {
  151. return this.GetTable<Aircrafts>();
  152. }
  153. }
  154. }
  155. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Users")]
  156. public partial class Users : INotifyPropertyChanging, INotifyPropertyChanged
  157. {
  158. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  159. private int _ID;
  160. private int _RoleID;
  161. private string _Email;
  162. private string _Password;
  163. private string _FirstName;
  164. private string _LastName;
  165. private System.Nullable<int> _OfficeID;
  166. private System.Nullable<System.DateTime> _Birthdate;
  167. private System.Nullable<bool> _Active;
  168. private EntitySet<Tickets> _Tickets;
  169. private EntityRef<Roles> _Roles;
  170. private EntityRef<Offices> _Offices;
  171. #region Определения метода расширяемости
  172. partial void OnLoaded();
  173. partial void OnValidate(System.Data.Linq.ChangeAction action);
  174. partial void OnCreated();
  175. partial void OnIDChanging(int value);
  176. partial void OnIDChanged();
  177. partial void OnRoleIDChanging(int value);
  178. partial void OnRoleIDChanged();
  179. partial void OnEmailChanging(string value);
  180. partial void OnEmailChanged();
  181. partial void OnPasswordChanging(string value);
  182. partial void OnPasswordChanged();
  183. partial void OnFirstNameChanging(string value);
  184. partial void OnFirstNameChanged();
  185. partial void OnLastNameChanging(string value);
  186. partial void OnLastNameChanged();
  187. partial void OnOfficeIDChanging(System.Nullable<int> value);
  188. partial void OnOfficeIDChanged();
  189. partial void OnBirthdateChanging(System.Nullable<System.DateTime> value);
  190. partial void OnBirthdateChanged();
  191. partial void OnActiveChanging(System.Nullable<bool> value);
  192. partial void OnActiveChanged();
  193. #endregion
  194. public Users()
  195. {
  196. this._Tickets = new EntitySet<Tickets>(new Action<Tickets>(this.attach_Tickets), new Action<Tickets>(this.detach_Tickets));
  197. this._Roles = default(EntityRef<Roles>);
  198. this._Offices = default(EntityRef<Offices>);
  199. OnCreated();
  200. }
  201. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  202. public int ID
  203. {
  204. get
  205. {
  206. return this._ID;
  207. }
  208. set
  209. {
  210. if ((this._ID != value))
  211. {
  212. this.OnIDChanging(value);
  213. this.SendPropertyChanging();
  214. this._ID = value;
  215. this.SendPropertyChanged("ID");
  216. this.OnIDChanged();
  217. }
  218. }
  219. }
  220. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleID", DbType="Int NOT NULL")]
  221. public int RoleID
  222. {
  223. get
  224. {
  225. return this._RoleID;
  226. }
  227. set
  228. {
  229. if ((this._RoleID != value))
  230. {
  231. if (this._Roles.HasLoadedOrAssignedValue)
  232. {
  233. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  234. }
  235. this.OnRoleIDChanging(value);
  236. this.SendPropertyChanging();
  237. this._RoleID = value;
  238. this.SendPropertyChanged("RoleID");
  239. this.OnRoleIDChanged();
  240. }
  241. }
  242. }
  243. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Email", DbType="NVarChar(150) NOT NULL", CanBeNull=false)]
  244. public string Email
  245. {
  246. get
  247. {
  248. return this._Email;
  249. }
  250. set
  251. {
  252. if ((this._Email != value))
  253. {
  254. this.OnEmailChanging(value);
  255. this.SendPropertyChanging();
  256. this._Email = value;
  257. this.SendPropertyChanged("Email");
  258. this.OnEmailChanged();
  259. }
  260. }
  261. }
  262. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Password", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  263. public string Password
  264. {
  265. get
  266. {
  267. return this._Password;
  268. }
  269. set
  270. {
  271. if ((this._Password != value))
  272. {
  273. this.OnPasswordChanging(value);
  274. this.SendPropertyChanging();
  275. this._Password = value;
  276. this.SendPropertyChanged("Password");
  277. this.OnPasswordChanged();
  278. }
  279. }
  280. }
  281. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FirstName", DbType="NVarChar(50)")]
  282. public string FirstName
  283. {
  284. get
  285. {
  286. return this._FirstName;
  287. }
  288. set
  289. {
  290. if ((this._FirstName != value))
  291. {
  292. this.OnFirstNameChanging(value);
  293. this.SendPropertyChanging();
  294. this._FirstName = value;
  295. this.SendPropertyChanged("FirstName");
  296. this.OnFirstNameChanged();
  297. }
  298. }
  299. }
  300. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  301. public string LastName
  302. {
  303. get
  304. {
  305. return this._LastName;
  306. }
  307. set
  308. {
  309. if ((this._LastName != value))
  310. {
  311. this.OnLastNameChanging(value);
  312. this.SendPropertyChanging();
  313. this._LastName = value;
  314. this.SendPropertyChanged("LastName");
  315. this.OnLastNameChanged();
  316. }
  317. }
  318. }
  319. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OfficeID", DbType="Int")]
  320. public System.Nullable<int> OfficeID
  321. {
  322. get
  323. {
  324. return this._OfficeID;
  325. }
  326. set
  327. {
  328. if ((this._OfficeID != value))
  329. {
  330. if (this._Offices.HasLoadedOrAssignedValue)
  331. {
  332. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  333. }
  334. this.OnOfficeIDChanging(value);
  335. this.SendPropertyChanging();
  336. this._OfficeID = value;
  337. this.SendPropertyChanged("OfficeID");
  338. this.OnOfficeIDChanged();
  339. }
  340. }
  341. }
  342. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Birthdate", DbType="Date")]
  343. public System.Nullable<System.DateTime> Birthdate
  344. {
  345. get
  346. {
  347. return this._Birthdate;
  348. }
  349. set
  350. {
  351. if ((this._Birthdate != value))
  352. {
  353. this.OnBirthdateChanging(value);
  354. this.SendPropertyChanging();
  355. this._Birthdate = value;
  356. this.SendPropertyChanged("Birthdate");
  357. this.OnBirthdateChanged();
  358. }
  359. }
  360. }
  361. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Active", DbType="Bit")]
  362. public System.Nullable<bool> Active
  363. {
  364. get
  365. {
  366. return this._Active;
  367. }
  368. set
  369. {
  370. if ((this._Active != value))
  371. {
  372. this.OnActiveChanging(value);
  373. this.SendPropertyChanging();
  374. this._Active = value;
  375. this.SendPropertyChanged("Active");
  376. this.OnActiveChanged();
  377. }
  378. }
  379. }
  380. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Users_Tickets", Storage="_Tickets", ThisKey="ID", OtherKey="UserID")]
  381. public EntitySet<Tickets> Tickets
  382. {
  383. get
  384. {
  385. return this._Tickets;
  386. }
  387. set
  388. {
  389. this._Tickets.Assign(value);
  390. }
  391. }
  392. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Roles_Users", Storage="_Roles", ThisKey="RoleID", OtherKey="ID", IsForeignKey=true)]
  393. public Roles Roles
  394. {
  395. get
  396. {
  397. return this._Roles.Entity;
  398. }
  399. set
  400. {
  401. Roles previousValue = this._Roles.Entity;
  402. if (((previousValue != value)
  403. || (this._Roles.HasLoadedOrAssignedValue == false)))
  404. {
  405. this.SendPropertyChanging();
  406. if ((previousValue != null))
  407. {
  408. this._Roles.Entity = null;
  409. previousValue.Users.Remove(this);
  410. }
  411. this._Roles.Entity = value;
  412. if ((value != null))
  413. {
  414. value.Users.Add(this);
  415. this._RoleID = value.ID;
  416. }
  417. else
  418. {
  419. this._RoleID = default(int);
  420. }
  421. this.SendPropertyChanged("Roles");
  422. }
  423. }
  424. }
  425. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Offices_Users", Storage="_Offices", ThisKey="OfficeID", OtherKey="ID", IsForeignKey=true)]
  426. public Offices Offices
  427. {
  428. get
  429. {
  430. return this._Offices.Entity;
  431. }
  432. set
  433. {
  434. Offices previousValue = this._Offices.Entity;
  435. if (((previousValue != value)
  436. || (this._Offices.HasLoadedOrAssignedValue == false)))
  437. {
  438. this.SendPropertyChanging();
  439. if ((previousValue != null))
  440. {
  441. this._Offices.Entity = null;
  442. previousValue.Users.Remove(this);
  443. }
  444. this._Offices.Entity = value;
  445. if ((value != null))
  446. {
  447. value.Users.Add(this);
  448. this._OfficeID = value.ID;
  449. }
  450. else
  451. {
  452. this._OfficeID = default(Nullable<int>);
  453. }
  454. this.SendPropertyChanged("Offices");
  455. }
  456. }
  457. }
  458. public event PropertyChangingEventHandler PropertyChanging;
  459. public event PropertyChangedEventHandler PropertyChanged;
  460. protected virtual void SendPropertyChanging()
  461. {
  462. if ((this.PropertyChanging != null))
  463. {
  464. this.PropertyChanging(this, emptyChangingEventArgs);
  465. }
  466. }
  467. protected virtual void SendPropertyChanged(String propertyName)
  468. {
  469. if ((this.PropertyChanged != null))
  470. {
  471. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  472. }
  473. }
  474. private void attach_Tickets(Tickets entity)
  475. {
  476. this.SendPropertyChanging();
  477. entity.Users = this;
  478. }
  479. private void detach_Tickets(Tickets entity)
  480. {
  481. this.SendPropertyChanging();
  482. entity.Users = null;
  483. }
  484. }
  485. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tickets")]
  486. public partial class Tickets : INotifyPropertyChanging, INotifyPropertyChanged
  487. {
  488. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  489. private int _ID;
  490. private int _UserID;
  491. private int _ScheduleID;
  492. private int _CabinTypeID;
  493. private string _Firstname;
  494. private string _Lastname;
  495. private string _Email;
  496. private string _Phone;
  497. private string _PassportNumber;
  498. private int _PassportCountryID;
  499. private string _BookingReference;
  500. private bool _Confirmed;
  501. private EntityRef<Users> _Users;
  502. private EntityRef<Schedules> _Schedules;
  503. private EntityRef<CabinTypes> _CabinTypes;
  504. #region Определения метода расширяемости
  505. partial void OnLoaded();
  506. partial void OnValidate(System.Data.Linq.ChangeAction action);
  507. partial void OnCreated();
  508. partial void OnIDChanging(int value);
  509. partial void OnIDChanged();
  510. partial void OnUserIDChanging(int value);
  511. partial void OnUserIDChanged();
  512. partial void OnScheduleIDChanging(int value);
  513. partial void OnScheduleIDChanged();
  514. partial void OnCabinTypeIDChanging(int value);
  515. partial void OnCabinTypeIDChanged();
  516. partial void OnFirstnameChanging(string value);
  517. partial void OnFirstnameChanged();
  518. partial void OnLastnameChanging(string value);
  519. partial void OnLastnameChanged();
  520. partial void OnEmailChanging(string value);
  521. partial void OnEmailChanged();
  522. partial void OnPhoneChanging(string value);
  523. partial void OnPhoneChanged();
  524. partial void OnPassportNumberChanging(string value);
  525. partial void OnPassportNumberChanged();
  526. partial void OnPassportCountryIDChanging(int value);
  527. partial void OnPassportCountryIDChanged();
  528. partial void OnBookingReferenceChanging(string value);
  529. partial void OnBookingReferenceChanged();
  530. partial void OnConfirmedChanging(bool value);
  531. partial void OnConfirmedChanged();
  532. #endregion
  533. public Tickets()
  534. {
  535. this._Users = default(EntityRef<Users>);
  536. this._Schedules = default(EntityRef<Schedules>);
  537. this._CabinTypes = default(EntityRef<CabinTypes>);
  538. OnCreated();
  539. }
  540. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  541. public int ID
  542. {
  543. get
  544. {
  545. return this._ID;
  546. }
  547. set
  548. {
  549. if ((this._ID != value))
  550. {
  551. this.OnIDChanging(value);
  552. this.SendPropertyChanging();
  553. this._ID = value;
  554. this.SendPropertyChanged("ID");
  555. this.OnIDChanged();
  556. }
  557. }
  558. }
  559. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
  560. public int UserID
  561. {
  562. get
  563. {
  564. return this._UserID;
  565. }
  566. set
  567. {
  568. if ((this._UserID != value))
  569. {
  570. if (this._Users.HasLoadedOrAssignedValue)
  571. {
  572. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  573. }
  574. this.OnUserIDChanging(value);
  575. this.SendPropertyChanging();
  576. this._UserID = value;
  577. this.SendPropertyChanged("UserID");
  578. this.OnUserIDChanged();
  579. }
  580. }
  581. }
  582. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ScheduleID", DbType="Int NOT NULL")]
  583. public int ScheduleID
  584. {
  585. get
  586. {
  587. return this._ScheduleID;
  588. }
  589. set
  590. {
  591. if ((this._ScheduleID != value))
  592. {
  593. if (this._Schedules.HasLoadedOrAssignedValue)
  594. {
  595. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  596. }
  597. this.OnScheduleIDChanging(value);
  598. this.SendPropertyChanging();
  599. this._ScheduleID = value;
  600. this.SendPropertyChanged("ScheduleID");
  601. this.OnScheduleIDChanged();
  602. }
  603. }
  604. }
  605. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CabinTypeID", DbType="Int NOT NULL")]
  606. public int CabinTypeID
  607. {
  608. get
  609. {
  610. return this._CabinTypeID;
  611. }
  612. set
  613. {
  614. if ((this._CabinTypeID != value))
  615. {
  616. if (this._CabinTypes.HasLoadedOrAssignedValue)
  617. {
  618. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  619. }
  620. this.OnCabinTypeIDChanging(value);
  621. this.SendPropertyChanging();
  622. this._CabinTypeID = value;
  623. this.SendPropertyChanged("CabinTypeID");
  624. this.OnCabinTypeIDChanged();
  625. }
  626. }
  627. }
  628. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Firstname", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  629. public string Firstname
  630. {
  631. get
  632. {
  633. return this._Firstname;
  634. }
  635. set
  636. {
  637. if ((this._Firstname != value))
  638. {
  639. this.OnFirstnameChanging(value);
  640. this.SendPropertyChanging();
  641. this._Firstname = value;
  642. this.SendPropertyChanged("Firstname");
  643. this.OnFirstnameChanged();
  644. }
  645. }
  646. }
  647. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Lastname", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  648. public string Lastname
  649. {
  650. get
  651. {
  652. return this._Lastname;
  653. }
  654. set
  655. {
  656. if ((this._Lastname != value))
  657. {
  658. this.OnLastnameChanging(value);
  659. this.SendPropertyChanging();
  660. this._Lastname = value;
  661. this.SendPropertyChanged("Lastname");
  662. this.OnLastnameChanged();
  663. }
  664. }
  665. }
  666. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Email", DbType="NVarChar(50)")]
  667. public string Email
  668. {
  669. get
  670. {
  671. return this._Email;
  672. }
  673. set
  674. {
  675. if ((this._Email != value))
  676. {
  677. this.OnEmailChanging(value);
  678. this.SendPropertyChanging();
  679. this._Email = value;
  680. this.SendPropertyChanged("Email");
  681. this.OnEmailChanged();
  682. }
  683. }
  684. }
  685. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Phone", DbType="NVarChar(14) NOT NULL", CanBeNull=false)]
  686. public string Phone
  687. {
  688. get
  689. {
  690. return this._Phone;
  691. }
  692. set
  693. {
  694. if ((this._Phone != value))
  695. {
  696. this.OnPhoneChanging(value);
  697. this.SendPropertyChanging();
  698. this._Phone = value;
  699. this.SendPropertyChanged("Phone");
  700. this.OnPhoneChanged();
  701. }
  702. }
  703. }
  704. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PassportNumber", DbType="NVarChar(9) NOT NULL", CanBeNull=false)]
  705. public string PassportNumber
  706. {
  707. get
  708. {
  709. return this._PassportNumber;
  710. }
  711. set
  712. {
  713. if ((this._PassportNumber != value))
  714. {
  715. this.OnPassportNumberChanging(value);
  716. this.SendPropertyChanging();
  717. this._PassportNumber = value;
  718. this.SendPropertyChanged("PassportNumber");
  719. this.OnPassportNumberChanged();
  720. }
  721. }
  722. }
  723. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PassportCountryID", DbType="Int NOT NULL")]
  724. public int PassportCountryID
  725. {
  726. get
  727. {
  728. return this._PassportCountryID;
  729. }
  730. set
  731. {
  732. if ((this._PassportCountryID != value))
  733. {
  734. this.OnPassportCountryIDChanging(value);
  735. this.SendPropertyChanging();
  736. this._PassportCountryID = value;
  737. this.SendPropertyChanged("PassportCountryID");
  738. this.OnPassportCountryIDChanged();
  739. }
  740. }
  741. }
  742. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookingReference", DbType="NVarChar(6) NOT NULL", CanBeNull=false)]
  743. public string BookingReference
  744. {
  745. get
  746. {
  747. return this._BookingReference;
  748. }
  749. set
  750. {
  751. if ((this._BookingReference != value))
  752. {
  753. this.OnBookingReferenceChanging(value);
  754. this.SendPropertyChanging();
  755. this._BookingReference = value;
  756. this.SendPropertyChanged("BookingReference");
  757. this.OnBookingReferenceChanged();
  758. }
  759. }
  760. }
  761. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Confirmed", DbType="Bit NOT NULL")]
  762. public bool Confirmed
  763. {
  764. get
  765. {
  766. return this._Confirmed;
  767. }
  768. set
  769. {
  770. if ((this._Confirmed != value))
  771. {
  772. this.OnConfirmedChanging(value);
  773. this.SendPropertyChanging();
  774. this._Confirmed = value;
  775. this.SendPropertyChanged("Confirmed");
  776. this.OnConfirmedChanged();
  777. }
  778. }
  779. }
  780. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Users_Tickets", Storage="_Users", ThisKey="UserID", OtherKey="ID", IsForeignKey=true)]
  781. public Users Users
  782. {
  783. get
  784. {
  785. return this._Users.Entity;
  786. }
  787. set
  788. {
  789. Users previousValue = this._Users.Entity;
  790. if (((previousValue != value)
  791. || (this._Users.HasLoadedOrAssignedValue == false)))
  792. {
  793. this.SendPropertyChanging();
  794. if ((previousValue != null))
  795. {
  796. this._Users.Entity = null;
  797. previousValue.Tickets.Remove(this);
  798. }
  799. this._Users.Entity = value;
  800. if ((value != null))
  801. {
  802. value.Tickets.Add(this);
  803. this._UserID = value.ID;
  804. }
  805. else
  806. {
  807. this._UserID = default(int);
  808. }
  809. this.SendPropertyChanged("Users");
  810. }
  811. }
  812. }
  813. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Schedules_Tickets", Storage="_Schedules", ThisKey="ScheduleID", OtherKey="ID", IsForeignKey=true)]
  814. public Schedules Schedules
  815. {
  816. get
  817. {
  818. return this._Schedules.Entity;
  819. }
  820. set
  821. {
  822. Schedules previousValue = this._Schedules.Entity;
  823. if (((previousValue != value)
  824. || (this._Schedules.HasLoadedOrAssignedValue == false)))
  825. {
  826. this.SendPropertyChanging();
  827. if ((previousValue != null))
  828. {
  829. this._Schedules.Entity = null;
  830. previousValue.Tickets.Remove(this);
  831. }
  832. this._Schedules.Entity = value;
  833. if ((value != null))
  834. {
  835. value.Tickets.Add(this);
  836. this._ScheduleID = value.ID;
  837. }
  838. else
  839. {
  840. this._ScheduleID = default(int);
  841. }
  842. this.SendPropertyChanged("Schedules");
  843. }
  844. }
  845. }
  846. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="CabinTypes_Tickets", Storage="_CabinTypes", ThisKey="CabinTypeID", OtherKey="ID", IsForeignKey=true)]
  847. public CabinTypes CabinTypes
  848. {
  849. get
  850. {
  851. return this._CabinTypes.Entity;
  852. }
  853. set
  854. {
  855. CabinTypes previousValue = this._CabinTypes.Entity;
  856. if (((previousValue != value)
  857. || (this._CabinTypes.HasLoadedOrAssignedValue == false)))
  858. {
  859. this.SendPropertyChanging();
  860. if ((previousValue != null))
  861. {
  862. this._CabinTypes.Entity = null;
  863. previousValue.Tickets.Remove(this);
  864. }
  865. this._CabinTypes.Entity = value;
  866. if ((value != null))
  867. {
  868. value.Tickets.Add(this);
  869. this._CabinTypeID = value.ID;
  870. }
  871. else
  872. {
  873. this._CabinTypeID = default(int);
  874. }
  875. this.SendPropertyChanged("CabinTypes");
  876. }
  877. }
  878. }
  879. public event PropertyChangingEventHandler PropertyChanging;
  880. public event PropertyChangedEventHandler PropertyChanged;
  881. protected virtual void SendPropertyChanging()
  882. {
  883. if ((this.PropertyChanging != null))
  884. {
  885. this.PropertyChanging(this, emptyChangingEventArgs);
  886. }
  887. }
  888. protected virtual void SendPropertyChanged(String propertyName)
  889. {
  890. if ((this.PropertyChanged != null))
  891. {
  892. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  893. }
  894. }
  895. }
  896. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Routes")]
  897. public partial class Routes : INotifyPropertyChanging, INotifyPropertyChanged
  898. {
  899. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  900. private int _ID;
  901. private int _DepartureAirportID;
  902. private int _ArrivalAirportID;
  903. private int _Distance;
  904. private int _FlightTime;
  905. private EntitySet<Schedules> _Schedules;
  906. private EntityRef<Airports> _Airports;
  907. private EntityRef<Airports> _Airports1;
  908. #region Определения метода расширяемости
  909. partial void OnLoaded();
  910. partial void OnValidate(System.Data.Linq.ChangeAction action);
  911. partial void OnCreated();
  912. partial void OnIDChanging(int value);
  913. partial void OnIDChanged();
  914. partial void OnDepartureAirportIDChanging(int value);
  915. partial void OnDepartureAirportIDChanged();
  916. partial void OnArrivalAirportIDChanging(int value);
  917. partial void OnArrivalAirportIDChanged();
  918. partial void OnDistanceChanging(int value);
  919. partial void OnDistanceChanged();
  920. partial void OnFlightTimeChanging(int value);
  921. partial void OnFlightTimeChanged();
  922. #endregion
  923. public Routes()
  924. {
  925. this._Schedules = new EntitySet<Schedules>(new Action<Schedules>(this.attach_Schedules), new Action<Schedules>(this.detach_Schedules));
  926. this._Airports = default(EntityRef<Airports>);
  927. this._Airports1 = default(EntityRef<Airports>);
  928. OnCreated();
  929. }
  930. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  931. public int ID
  932. {
  933. get
  934. {
  935. return this._ID;
  936. }
  937. set
  938. {
  939. if ((this._ID != value))
  940. {
  941. this.OnIDChanging(value);
  942. this.SendPropertyChanging();
  943. this._ID = value;
  944. this.SendPropertyChanged("ID");
  945. this.OnIDChanged();
  946. }
  947. }
  948. }
  949. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DepartureAirportID", DbType="Int NOT NULL")]
  950. public int DepartureAirportID
  951. {
  952. get
  953. {
  954. return this._DepartureAirportID;
  955. }
  956. set
  957. {
  958. if ((this._DepartureAirportID != value))
  959. {
  960. if (this._Airports.HasLoadedOrAssignedValue)
  961. {
  962. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  963. }
  964. this.OnDepartureAirportIDChanging(value);
  965. this.SendPropertyChanging();
  966. this._DepartureAirportID = value;
  967. this.SendPropertyChanged("DepartureAirportID");
  968. this.OnDepartureAirportIDChanged();
  969. }
  970. }
  971. }
  972. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ArrivalAirportID", DbType="Int NOT NULL")]
  973. public int ArrivalAirportID
  974. {
  975. get
  976. {
  977. return this._ArrivalAirportID;
  978. }
  979. set
  980. {
  981. if ((this._ArrivalAirportID != value))
  982. {
  983. if (this._Airports1.HasLoadedOrAssignedValue)
  984. {
  985. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  986. }
  987. this.OnArrivalAirportIDChanging(value);
  988. this.SendPropertyChanging();
  989. this._ArrivalAirportID = value;
  990. this.SendPropertyChanged("ArrivalAirportID");
  991. this.OnArrivalAirportIDChanged();
  992. }
  993. }
  994. }
  995. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Distance", DbType="Int NOT NULL")]
  996. public int Distance
  997. {
  998. get
  999. {
  1000. return this._Distance;
  1001. }
  1002. set
  1003. {
  1004. if ((this._Distance != value))
  1005. {
  1006. this.OnDistanceChanging(value);
  1007. this.SendPropertyChanging();
  1008. this._Distance = value;
  1009. this.SendPropertyChanged("Distance");
  1010. this.OnDistanceChanged();
  1011. }
  1012. }
  1013. }
  1014. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FlightTime", DbType="Int NOT NULL")]
  1015. public int FlightTime
  1016. {
  1017. get
  1018. {
  1019. return this._FlightTime;
  1020. }
  1021. set
  1022. {
  1023. if ((this._FlightTime != value))
  1024. {
  1025. this.OnFlightTimeChanging(value);
  1026. this.SendPropertyChanging();
  1027. this._FlightTime = value;
  1028. this.SendPropertyChanged("FlightTime");
  1029. this.OnFlightTimeChanged();
  1030. }
  1031. }
  1032. }
  1033. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Routes_Schedules", Storage="_Schedules", ThisKey="ID", OtherKey="RouteID")]
  1034. public EntitySet<Schedules> Schedules
  1035. {
  1036. get
  1037. {
  1038. return this._Schedules;
  1039. }
  1040. set
  1041. {
  1042. this._Schedules.Assign(value);
  1043. }
  1044. }
  1045. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Airports_Routes", Storage="_Airports", ThisKey="DepartureAirportID", OtherKey="ID", IsForeignKey=true)]
  1046. public Airports Airports
  1047. {
  1048. get
  1049. {
  1050. return this._Airports.Entity;
  1051. }
  1052. set
  1053. {
  1054. Airports previousValue = this._Airports.Entity;
  1055. if (((previousValue != value)
  1056. || (this._Airports.HasLoadedOrAssignedValue == false)))
  1057. {
  1058. this.SendPropertyChanging();
  1059. if ((previousValue != null))
  1060. {
  1061. this._Airports.Entity = null;
  1062. previousValue.Routes.Remove(this);
  1063. }
  1064. this._Airports.Entity = value;
  1065. if ((value != null))
  1066. {
  1067. value.Routes.Add(this);
  1068. this._DepartureAirportID = value.ID;
  1069. }
  1070. else
  1071. {
  1072. this._DepartureAirportID = default(int);
  1073. }
  1074. this.SendPropertyChanged("Airports");
  1075. }
  1076. }
  1077. }
  1078. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Airports_Routes1", Storage="_Airports1", ThisKey="ArrivalAirportID", OtherKey="ID", IsForeignKey=true)]
  1079. public Airports Airports1
  1080. {
  1081. get
  1082. {
  1083. return this._Airports1.Entity;
  1084. }
  1085. set
  1086. {
  1087. Airports previousValue = this._Airports1.Entity;
  1088. if (((previousValue != value)
  1089. || (this._Airports1.HasLoadedOrAssignedValue == false)))
  1090. {
  1091. this.SendPropertyChanging();
  1092. if ((previousValue != null))
  1093. {
  1094. this._Airports1.Entity = null;
  1095. previousValue.Routes1.Remove(this);
  1096. }
  1097. this._Airports1.Entity = value;
  1098. if ((value != null))
  1099. {
  1100. value.Routes1.Add(this);
  1101. this._ArrivalAirportID = value.ID;
  1102. }
  1103. else
  1104. {
  1105. this._ArrivalAirportID = default(int);
  1106. }
  1107. this.SendPropertyChanged("Airports1");
  1108. }
  1109. }
  1110. }
  1111. public event PropertyChangingEventHandler PropertyChanging;
  1112. public event PropertyChangedEventHandler PropertyChanged;
  1113. protected virtual void SendPropertyChanging()
  1114. {
  1115. if ((this.PropertyChanging != null))
  1116. {
  1117. this.PropertyChanging(this, emptyChangingEventArgs);
  1118. }
  1119. }
  1120. protected virtual void SendPropertyChanged(String propertyName)
  1121. {
  1122. if ((this.PropertyChanged != null))
  1123. {
  1124. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1125. }
  1126. }
  1127. private void attach_Schedules(Schedules entity)
  1128. {
  1129. this.SendPropertyChanging();
  1130. entity.Routes = this;
  1131. }
  1132. private void detach_Schedules(Schedules entity)
  1133. {
  1134. this.SendPropertyChanging();
  1135. entity.Routes = null;
  1136. }
  1137. }
  1138. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Schedules")]
  1139. public partial class Schedules : INotifyPropertyChanging, INotifyPropertyChanged
  1140. {
  1141. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1142. private int _ID;
  1143. private System.DateTime _Date;
  1144. private System.TimeSpan _Time;
  1145. private int _AircraftID;
  1146. private int _RouteID;
  1147. private decimal _EconomyPrice;
  1148. private bool _Confirmed;
  1149. private string _FlightNumber;
  1150. private EntitySet<Tickets> _Tickets;
  1151. private EntityRef<Routes> _Routes;
  1152. private EntityRef<Aircrafts> _Aircrafts;
  1153. #region Определения метода расширяемости
  1154. partial void OnLoaded();
  1155. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1156. partial void OnCreated();
  1157. partial void OnIDChanging(int value);
  1158. partial void OnIDChanged();
  1159. partial void OnDateChanging(System.DateTime value);
  1160. partial void OnDateChanged();
  1161. partial void OnTimeChanging(System.TimeSpan value);
  1162. partial void OnTimeChanged();
  1163. partial void OnAircraftIDChanging(int value);
  1164. partial void OnAircraftIDChanged();
  1165. partial void OnRouteIDChanging(int value);
  1166. partial void OnRouteIDChanged();
  1167. partial void OnEconomyPriceChanging(decimal value);
  1168. partial void OnEconomyPriceChanged();
  1169. partial void OnConfirmedChanging(bool value);
  1170. partial void OnConfirmedChanged();
  1171. partial void OnFlightNumberChanging(string value);
  1172. partial void OnFlightNumberChanged();
  1173. #endregion
  1174. public Schedules()
  1175. {
  1176. this._Tickets = new EntitySet<Tickets>(new Action<Tickets>(this.attach_Tickets), new Action<Tickets>(this.detach_Tickets));
  1177. this._Routes = default(EntityRef<Routes>);
  1178. this._Aircrafts = default(EntityRef<Aircrafts>);
  1179. OnCreated();
  1180. }
  1181. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1182. public int ID
  1183. {
  1184. get
  1185. {
  1186. return this._ID;
  1187. }
  1188. set
  1189. {
  1190. if ((this._ID != value))
  1191. {
  1192. this.OnIDChanging(value);
  1193. this.SendPropertyChanging();
  1194. this._ID = value;
  1195. this.SendPropertyChanged("ID");
  1196. this.OnIDChanged();
  1197. }
  1198. }
  1199. }
  1200. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Date", DbType="Date NOT NULL")]
  1201. public System.DateTime Date
  1202. {
  1203. get
  1204. {
  1205. return this._Date;
  1206. }
  1207. set
  1208. {
  1209. if ((this._Date != value))
  1210. {
  1211. this.OnDateChanging(value);
  1212. this.SendPropertyChanging();
  1213. this._Date = value;
  1214. this.SendPropertyChanged("Date");
  1215. this.OnDateChanged();
  1216. }
  1217. }
  1218. }
  1219. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Time", DbType="Time NOT NULL")]
  1220. public System.TimeSpan Time
  1221. {
  1222. get
  1223. {
  1224. return this._Time;
  1225. }
  1226. set
  1227. {
  1228. if ((this._Time != value))
  1229. {
  1230. this.OnTimeChanging(value);
  1231. this.SendPropertyChanging();
  1232. this._Time = value;
  1233. this.SendPropertyChanged("Time");
  1234. this.OnTimeChanged();
  1235. }
  1236. }
  1237. }
  1238. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AircraftID", DbType="Int NOT NULL")]
  1239. public int AircraftID
  1240. {
  1241. get
  1242. {
  1243. return this._AircraftID;
  1244. }
  1245. set
  1246. {
  1247. if ((this._AircraftID != value))
  1248. {
  1249. if (this._Aircrafts.HasLoadedOrAssignedValue)
  1250. {
  1251. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1252. }
  1253. this.OnAircraftIDChanging(value);
  1254. this.SendPropertyChanging();
  1255. this._AircraftID = value;
  1256. this.SendPropertyChanged("AircraftID");
  1257. this.OnAircraftIDChanged();
  1258. }
  1259. }
  1260. }
  1261. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RouteID", DbType="Int NOT NULL")]
  1262. public int RouteID
  1263. {
  1264. get
  1265. {
  1266. return this._RouteID;
  1267. }
  1268. set
  1269. {
  1270. if ((this._RouteID != value))
  1271. {
  1272. if (this._Routes.HasLoadedOrAssignedValue)
  1273. {
  1274. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1275. }
  1276. this.OnRouteIDChanging(value);
  1277. this.SendPropertyChanging();
  1278. this._RouteID = value;
  1279. this.SendPropertyChanged("RouteID");
  1280. this.OnRouteIDChanged();
  1281. }
  1282. }
  1283. }
  1284. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EconomyPrice", DbType="Money NOT NULL")]
  1285. public decimal EconomyPrice
  1286. {
  1287. get
  1288. {
  1289. return this._EconomyPrice;
  1290. }
  1291. set
  1292. {
  1293. if ((this._EconomyPrice != value))
  1294. {
  1295. this.OnEconomyPriceChanging(value);
  1296. this.SendPropertyChanging();
  1297. this._EconomyPrice = value;
  1298. this.SendPropertyChanged("EconomyPrice");
  1299. this.OnEconomyPriceChanged();
  1300. }
  1301. }
  1302. }
  1303. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Confirmed", DbType="Bit NOT NULL")]
  1304. public bool Confirmed
  1305. {
  1306. get
  1307. {
  1308. return this._Confirmed;
  1309. }
  1310. set
  1311. {
  1312. if ((this._Confirmed != value))
  1313. {
  1314. this.OnConfirmedChanging(value);
  1315. this.SendPropertyChanging();
  1316. this._Confirmed = value;
  1317. this.SendPropertyChanged("Confirmed");
  1318. this.OnConfirmedChanged();
  1319. }
  1320. }
  1321. }
  1322. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FlightNumber", DbType="NVarChar(10)")]
  1323. public string FlightNumber
  1324. {
  1325. get
  1326. {
  1327. return this._FlightNumber;
  1328. }
  1329. set
  1330. {
  1331. if ((this._FlightNumber != value))
  1332. {
  1333. this.OnFlightNumberChanging(value);
  1334. this.SendPropertyChanging();
  1335. this._FlightNumber = value;
  1336. this.SendPropertyChanged("FlightNumber");
  1337. this.OnFlightNumberChanged();
  1338. }
  1339. }
  1340. }
  1341. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Schedules_Tickets", Storage="_Tickets", ThisKey="ID", OtherKey="ScheduleID")]
  1342. public EntitySet<Tickets> Tickets
  1343. {
  1344. get
  1345. {
  1346. return this._Tickets;
  1347. }
  1348. set
  1349. {
  1350. this._Tickets.Assign(value);
  1351. }
  1352. }
  1353. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Routes_Schedules", Storage="_Routes", ThisKey="RouteID", OtherKey="ID", IsForeignKey=true)]
  1354. public Routes Routes
  1355. {
  1356. get
  1357. {
  1358. return this._Routes.Entity;
  1359. }
  1360. set
  1361. {
  1362. Routes previousValue = this._Routes.Entity;
  1363. if (((previousValue != value)
  1364. || (this._Routes.HasLoadedOrAssignedValue == false)))
  1365. {
  1366. this.SendPropertyChanging();
  1367. if ((previousValue != null))
  1368. {
  1369. this._Routes.Entity = null;
  1370. previousValue.Schedules.Remove(this);
  1371. }
  1372. this._Routes.Entity = value;
  1373. if ((value != null))
  1374. {
  1375. value.Schedules.Add(this);
  1376. this._RouteID = value.ID;
  1377. }
  1378. else
  1379. {
  1380. this._RouteID = default(int);
  1381. }
  1382. this.SendPropertyChanged("Routes");
  1383. }
  1384. }
  1385. }
  1386. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Aircrafts_Schedules", Storage="_Aircrafts", ThisKey="AircraftID", OtherKey="ID", IsForeignKey=true)]
  1387. public Aircrafts Aircrafts
  1388. {
  1389. get
  1390. {
  1391. return this._Aircrafts.Entity;
  1392. }
  1393. set
  1394. {
  1395. Aircrafts previousValue = this._Aircrafts.Entity;
  1396. if (((previousValue != value)
  1397. || (this._Aircrafts.HasLoadedOrAssignedValue == false)))
  1398. {
  1399. this.SendPropertyChanging();
  1400. if ((previousValue != null))
  1401. {
  1402. this._Aircrafts.Entity = null;
  1403. previousValue.Schedules.Remove(this);
  1404. }
  1405. this._Aircrafts.Entity = value;
  1406. if ((value != null))
  1407. {
  1408. value.Schedules.Add(this);
  1409. this._AircraftID = value.ID;
  1410. }
  1411. else
  1412. {
  1413. this._AircraftID = default(int);
  1414. }
  1415. this.SendPropertyChanged("Aircrafts");
  1416. }
  1417. }
  1418. }
  1419. public event PropertyChangingEventHandler PropertyChanging;
  1420. public event PropertyChangedEventHandler PropertyChanged;
  1421. protected virtual void SendPropertyChanging()
  1422. {
  1423. if ((this.PropertyChanging != null))
  1424. {
  1425. this.PropertyChanging(this, emptyChangingEventArgs);
  1426. }
  1427. }
  1428. protected virtual void SendPropertyChanged(String propertyName)
  1429. {
  1430. if ((this.PropertyChanged != null))
  1431. {
  1432. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1433. }
  1434. }
  1435. private void attach_Tickets(Tickets entity)
  1436. {
  1437. this.SendPropertyChanging();
  1438. entity.Schedules = this;
  1439. }
  1440. private void detach_Tickets(Tickets entity)
  1441. {
  1442. this.SendPropertyChanging();
  1443. entity.Schedules = null;
  1444. }
  1445. }
  1446. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Roles")]
  1447. public partial class Roles : INotifyPropertyChanging, INotifyPropertyChanged
  1448. {
  1449. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1450. private int _ID;
  1451. private string _Title;
  1452. private EntitySet<Users> _Users;
  1453. #region Определения метода расширяемости
  1454. partial void OnLoaded();
  1455. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1456. partial void OnCreated();
  1457. partial void OnIDChanging(int value);
  1458. partial void OnIDChanged();
  1459. partial void OnTitleChanging(string value);
  1460. partial void OnTitleChanged();
  1461. #endregion
  1462. public Roles()
  1463. {
  1464. this._Users = new EntitySet<Users>(new Action<Users>(this.attach_Users), new Action<Users>(this.detach_Users));
  1465. OnCreated();
  1466. }
  1467. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1468. public int ID
  1469. {
  1470. get
  1471. {
  1472. return this._ID;
  1473. }
  1474. set
  1475. {
  1476. if ((this._ID != value))
  1477. {
  1478. this.OnIDChanging(value);
  1479. this.SendPropertyChanging();
  1480. this._ID = value;
  1481. this.SendPropertyChanged("ID");
  1482. this.OnIDChanged();
  1483. }
  1484. }
  1485. }
  1486. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  1487. public string Title
  1488. {
  1489. get
  1490. {
  1491. return this._Title;
  1492. }
  1493. set
  1494. {
  1495. if ((this._Title != value))
  1496. {
  1497. this.OnTitleChanging(value);
  1498. this.SendPropertyChanging();
  1499. this._Title = value;
  1500. this.SendPropertyChanged("Title");
  1501. this.OnTitleChanged();
  1502. }
  1503. }
  1504. }
  1505. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Roles_Users", Storage="_Users", ThisKey="ID", OtherKey="RoleID")]
  1506. public EntitySet<Users> Users
  1507. {
  1508. get
  1509. {
  1510. return this._Users;
  1511. }
  1512. set
  1513. {
  1514. this._Users.Assign(value);
  1515. }
  1516. }
  1517. public event PropertyChangingEventHandler PropertyChanging;
  1518. public event PropertyChangedEventHandler PropertyChanged;
  1519. protected virtual void SendPropertyChanging()
  1520. {
  1521. if ((this.PropertyChanging != null))
  1522. {
  1523. this.PropertyChanging(this, emptyChangingEventArgs);
  1524. }
  1525. }
  1526. protected virtual void SendPropertyChanged(String propertyName)
  1527. {
  1528. if ((this.PropertyChanged != null))
  1529. {
  1530. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1531. }
  1532. }
  1533. private void attach_Users(Users entity)
  1534. {
  1535. this.SendPropertyChanging();
  1536. entity.Roles = this;
  1537. }
  1538. private void detach_Users(Users entity)
  1539. {
  1540. this.SendPropertyChanging();
  1541. entity.Roles = null;
  1542. }
  1543. }
  1544. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Offices")]
  1545. public partial class Offices : INotifyPropertyChanging, INotifyPropertyChanged
  1546. {
  1547. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1548. private int _ID;
  1549. private int _CountryID;
  1550. private string _Title;
  1551. private string _Phone;
  1552. private string _Contact;
  1553. private EntitySet<Users> _Users;
  1554. private EntityRef<Countries> _Countries;
  1555. #region Определения метода расширяемости
  1556. partial void OnLoaded();
  1557. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1558. partial void OnCreated();
  1559. partial void OnIDChanging(int value);
  1560. partial void OnIDChanged();
  1561. partial void OnCountryIDChanging(int value);
  1562. partial void OnCountryIDChanged();
  1563. partial void OnTitleChanging(string value);
  1564. partial void OnTitleChanged();
  1565. partial void OnPhoneChanging(string value);
  1566. partial void OnPhoneChanged();
  1567. partial void OnContactChanging(string value);
  1568. partial void OnContactChanged();
  1569. #endregion
  1570. public Offices()
  1571. {
  1572. this._Users = new EntitySet<Users>(new Action<Users>(this.attach_Users), new Action<Users>(this.detach_Users));
  1573. this._Countries = default(EntityRef<Countries>);
  1574. OnCreated();
  1575. }
  1576. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1577. public int ID
  1578. {
  1579. get
  1580. {
  1581. return this._ID;
  1582. }
  1583. set
  1584. {
  1585. if ((this._ID != value))
  1586. {
  1587. this.OnIDChanging(value);
  1588. this.SendPropertyChanging();
  1589. this._ID = value;
  1590. this.SendPropertyChanged("ID");
  1591. this.OnIDChanged();
  1592. }
  1593. }
  1594. }
  1595. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CountryID", DbType="Int NOT NULL")]
  1596. public int CountryID
  1597. {
  1598. get
  1599. {
  1600. return this._CountryID;
  1601. }
  1602. set
  1603. {
  1604. if ((this._CountryID != value))
  1605. {
  1606. if (this._Countries.HasLoadedOrAssignedValue)
  1607. {
  1608. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1609. }
  1610. this.OnCountryIDChanging(value);
  1611. this.SendPropertyChanging();
  1612. this._CountryID = value;
  1613. this.SendPropertyChanged("CountryID");
  1614. this.OnCountryIDChanged();
  1615. }
  1616. }
  1617. }
  1618. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  1619. public string Title
  1620. {
  1621. get
  1622. {
  1623. return this._Title;
  1624. }
  1625. set
  1626. {
  1627. if ((this._Title != value))
  1628. {
  1629. this.OnTitleChanging(value);
  1630. this.SendPropertyChanging();
  1631. this._Title = value;
  1632. this.SendPropertyChanged("Title");
  1633. this.OnTitleChanged();
  1634. }
  1635. }
  1636. }
  1637. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Phone", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  1638. public string Phone
  1639. {
  1640. get
  1641. {
  1642. return this._Phone;
  1643. }
  1644. set
  1645. {
  1646. if ((this._Phone != value))
  1647. {
  1648. this.OnPhoneChanging(value);
  1649. this.SendPropertyChanging();
  1650. this._Phone = value;
  1651. this.SendPropertyChanged("Phone");
  1652. this.OnPhoneChanged();
  1653. }
  1654. }
  1655. }
  1656. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Contact", DbType="NVarChar(250) NOT NULL", CanBeNull=false)]
  1657. public string Contact
  1658. {
  1659. get
  1660. {
  1661. return this._Contact;
  1662. }
  1663. set
  1664. {
  1665. if ((this._Contact != value))
  1666. {
  1667. this.OnContactChanging(value);
  1668. this.SendPropertyChanging();
  1669. this._Contact = value;
  1670. this.SendPropertyChanged("Contact");
  1671. this.OnContactChanged();
  1672. }
  1673. }
  1674. }
  1675. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Offices_Users", Storage="_Users", ThisKey="ID", OtherKey="OfficeID")]
  1676. public EntitySet<Users> Users
  1677. {
  1678. get
  1679. {
  1680. return this._Users;
  1681. }
  1682. set
  1683. {
  1684. this._Users.Assign(value);
  1685. }
  1686. }
  1687. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Countries_Offices", Storage="_Countries", ThisKey="CountryID", OtherKey="ID", IsForeignKey=true)]
  1688. public Countries Countries
  1689. {
  1690. get
  1691. {
  1692. return this._Countries.Entity;
  1693. }
  1694. set
  1695. {
  1696. Countries previousValue = this._Countries.Entity;
  1697. if (((previousValue != value)
  1698. || (this._Countries.HasLoadedOrAssignedValue == false)))
  1699. {
  1700. this.SendPropertyChanging();
  1701. if ((previousValue != null))
  1702. {
  1703. this._Countries.Entity = null;
  1704. previousValue.Offices.Remove(this);
  1705. }
  1706. this._Countries.Entity = value;
  1707. if ((value != null))
  1708. {
  1709. value.Offices.Add(this);
  1710. this._CountryID = value.ID;
  1711. }
  1712. else
  1713. {
  1714. this._CountryID = default(int);
  1715. }
  1716. this.SendPropertyChanged("Countries");
  1717. }
  1718. }
  1719. }
  1720. public event PropertyChangingEventHandler PropertyChanging;
  1721. public event PropertyChangedEventHandler PropertyChanged;
  1722. protected virtual void SendPropertyChanging()
  1723. {
  1724. if ((this.PropertyChanging != null))
  1725. {
  1726. this.PropertyChanging(this, emptyChangingEventArgs);
  1727. }
  1728. }
  1729. protected virtual void SendPropertyChanged(String propertyName)
  1730. {
  1731. if ((this.PropertyChanged != null))
  1732. {
  1733. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1734. }
  1735. }
  1736. private void attach_Users(Users entity)
  1737. {
  1738. this.SendPropertyChanging();
  1739. entity.Offices = this;
  1740. }
  1741. private void detach_Users(Users entity)
  1742. {
  1743. this.SendPropertyChanging();
  1744. entity.Offices = null;
  1745. }
  1746. }
  1747. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Countries")]
  1748. public partial class Countries : INotifyPropertyChanging, INotifyPropertyChanged
  1749. {
  1750. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1751. private int _ID;
  1752. private string _Name;
  1753. private EntitySet<Offices> _Offices;
  1754. private EntitySet<Airports> _Airports;
  1755. #region Определения метода расширяемости
  1756. partial void OnLoaded();
  1757. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1758. partial void OnCreated();
  1759. partial void OnIDChanging(int value);
  1760. partial void OnIDChanged();
  1761. partial void OnNameChanging(string value);
  1762. partial void OnNameChanged();
  1763. #endregion
  1764. public Countries()
  1765. {
  1766. this._Offices = new EntitySet<Offices>(new Action<Offices>(this.attach_Offices), new Action<Offices>(this.detach_Offices));
  1767. this._Airports = new EntitySet<Airports>(new Action<Airports>(this.attach_Airports), new Action<Airports>(this.detach_Airports));
  1768. OnCreated();
  1769. }
  1770. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1771. public int ID
  1772. {
  1773. get
  1774. {
  1775. return this._ID;
  1776. }
  1777. set
  1778. {
  1779. if ((this._ID != value))
  1780. {
  1781. this.OnIDChanging(value);
  1782. this.SendPropertyChanging();
  1783. this._ID = value;
  1784. this.SendPropertyChanged("ID");
  1785. this.OnIDChanged();
  1786. }
  1787. }
  1788. }
  1789. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  1790. public string Name
  1791. {
  1792. get
  1793. {
  1794. return this._Name;
  1795. }
  1796. set
  1797. {
  1798. if ((this._Name != value))
  1799. {
  1800. this.OnNameChanging(value);
  1801. this.SendPropertyChanging();
  1802. this._Name = value;
  1803. this.SendPropertyChanged("Name");
  1804. this.OnNameChanged();
  1805. }
  1806. }
  1807. }
  1808. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Countries_Offices", Storage="_Offices", ThisKey="ID", OtherKey="CountryID")]
  1809. public EntitySet<Offices> Offices
  1810. {
  1811. get
  1812. {
  1813. return this._Offices;
  1814. }
  1815. set
  1816. {
  1817. this._Offices.Assign(value);
  1818. }
  1819. }
  1820. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Countries_Airports", Storage="_Airports", ThisKey="ID", OtherKey="CountryID")]
  1821. public EntitySet<Airports> Airports
  1822. {
  1823. get
  1824. {
  1825. return this._Airports;
  1826. }
  1827. set
  1828. {
  1829. this._Airports.Assign(value);
  1830. }
  1831. }
  1832. public event PropertyChangingEventHandler PropertyChanging;
  1833. public event PropertyChangedEventHandler PropertyChanged;
  1834. protected virtual void SendPropertyChanging()
  1835. {
  1836. if ((this.PropertyChanging != null))
  1837. {
  1838. this.PropertyChanging(this, emptyChangingEventArgs);
  1839. }
  1840. }
  1841. protected virtual void SendPropertyChanged(String propertyName)
  1842. {
  1843. if ((this.PropertyChanged != null))
  1844. {
  1845. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1846. }
  1847. }
  1848. private void attach_Offices(Offices entity)
  1849. {
  1850. this.SendPropertyChanging();
  1851. entity.Countries = this;
  1852. }
  1853. private void detach_Offices(Offices entity)
  1854. {
  1855. this.SendPropertyChanging();
  1856. entity.Countries = null;
  1857. }
  1858. private void attach_Airports(Airports entity)
  1859. {
  1860. this.SendPropertyChanging();
  1861. entity.Countries = this;
  1862. }
  1863. private void detach_Airports(Airports entity)
  1864. {
  1865. this.SendPropertyChanging();
  1866. entity.Countries = null;
  1867. }
  1868. }
  1869. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CabinTypes")]
  1870. public partial class CabinTypes : INotifyPropertyChanging, INotifyPropertyChanged
  1871. {
  1872. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1873. private int _ID;
  1874. private string _Name;
  1875. private EntitySet<Tickets> _Tickets;
  1876. #region Определения метода расширяемости
  1877. partial void OnLoaded();
  1878. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1879. partial void OnCreated();
  1880. partial void OnIDChanging(int value);
  1881. partial void OnIDChanged();
  1882. partial void OnNameChanging(string value);
  1883. partial void OnNameChanged();
  1884. #endregion
  1885. public CabinTypes()
  1886. {
  1887. this._Tickets = new EntitySet<Tickets>(new Action<Tickets>(this.attach_Tickets), new Action<Tickets>(this.detach_Tickets));
  1888. OnCreated();
  1889. }
  1890. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1891. public int ID
  1892. {
  1893. get
  1894. {
  1895. return this._ID;
  1896. }
  1897. set
  1898. {
  1899. if ((this._ID != value))
  1900. {
  1901. this.OnIDChanging(value);
  1902. this.SendPropertyChanging();
  1903. this._ID = value;
  1904. this.SendPropertyChanged("ID");
  1905. this.OnIDChanged();
  1906. }
  1907. }
  1908. }
  1909. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  1910. public string Name
  1911. {
  1912. get
  1913. {
  1914. return this._Name;
  1915. }
  1916. set
  1917. {
  1918. if ((this._Name != value))
  1919. {
  1920. this.OnNameChanging(value);
  1921. this.SendPropertyChanging();
  1922. this._Name = value;
  1923. this.SendPropertyChanged("Name");
  1924. this.OnNameChanged();
  1925. }
  1926. }
  1927. }
  1928. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="CabinTypes_Tickets", Storage="_Tickets", ThisKey="ID", OtherKey="CabinTypeID")]
  1929. public EntitySet<Tickets> Tickets
  1930. {
  1931. get
  1932. {
  1933. return this._Tickets;
  1934. }
  1935. set
  1936. {
  1937. this._Tickets.Assign(value);
  1938. }
  1939. }
  1940. public event PropertyChangingEventHandler PropertyChanging;
  1941. public event PropertyChangedEventHandler PropertyChanged;
  1942. protected virtual void SendPropertyChanging()
  1943. {
  1944. if ((this.PropertyChanging != null))
  1945. {
  1946. this.PropertyChanging(this, emptyChangingEventArgs);
  1947. }
  1948. }
  1949. protected virtual void SendPropertyChanged(String propertyName)
  1950. {
  1951. if ((this.PropertyChanged != null))
  1952. {
  1953. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1954. }
  1955. }
  1956. private void attach_Tickets(Tickets entity)
  1957. {
  1958. this.SendPropertyChanging();
  1959. entity.CabinTypes = this;
  1960. }
  1961. private void detach_Tickets(Tickets entity)
  1962. {
  1963. this.SendPropertyChanging();
  1964. entity.CabinTypes = null;
  1965. }
  1966. }
  1967. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Airports")]
  1968. public partial class Airports : INotifyPropertyChanging, INotifyPropertyChanged
  1969. {
  1970. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1971. private int _ID;
  1972. private int _CountryID;
  1973. private string _IATACode;
  1974. private string _Name;
  1975. private EntitySet<Routes> _Routes;
  1976. private EntitySet<Routes> _Routes1;
  1977. private EntityRef<Countries> _Countries;
  1978. #region Определения метода расширяемости
  1979. partial void OnLoaded();
  1980. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1981. partial void OnCreated();
  1982. partial void OnIDChanging(int value);
  1983. partial void OnIDChanged();
  1984. partial void OnCountryIDChanging(int value);
  1985. partial void OnCountryIDChanged();
  1986. partial void OnIATACodeChanging(string value);
  1987. partial void OnIATACodeChanged();
  1988. partial void OnNameChanging(string value);
  1989. partial void OnNameChanged();
  1990. #endregion
  1991. public Airports()
  1992. {
  1993. this._Routes = new EntitySet<Routes>(new Action<Routes>(this.attach_Routes), new Action<Routes>(this.detach_Routes));
  1994. this._Routes1 = new EntitySet<Routes>(new Action<Routes>(this.attach_Routes1), new Action<Routes>(this.detach_Routes1));
  1995. this._Countries = default(EntityRef<Countries>);
  1996. OnCreated();
  1997. }
  1998. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1999. public int ID
  2000. {
  2001. get
  2002. {
  2003. return this._ID;
  2004. }
  2005. set
  2006. {
  2007. if ((this._ID != value))
  2008. {
  2009. this.OnIDChanging(value);
  2010. this.SendPropertyChanging();
  2011. this._ID = value;
  2012. this.SendPropertyChanged("ID");
  2013. this.OnIDChanged();
  2014. }
  2015. }
  2016. }
  2017. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CountryID", DbType="Int NOT NULL")]
  2018. public int CountryID
  2019. {
  2020. get
  2021. {
  2022. return this._CountryID;
  2023. }
  2024. set
  2025. {
  2026. if ((this._CountryID != value))
  2027. {
  2028. if (this._Countries.HasLoadedOrAssignedValue)
  2029. {
  2030. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  2031. }
  2032. this.OnCountryIDChanging(value);
  2033. this.SendPropertyChanging();
  2034. this._CountryID = value;
  2035. this.SendPropertyChanged("CountryID");
  2036. this.OnCountryIDChanged();
  2037. }
  2038. }
  2039. }
  2040. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IATACode", DbType="VarChar(3) NOT NULL", CanBeNull=false)]
  2041. public string IATACode
  2042. {
  2043. get
  2044. {
  2045. return this._IATACode;
  2046. }
  2047. set
  2048. {
  2049. if ((this._IATACode != value))
  2050. {
  2051. this.OnIATACodeChanging(value);
  2052. this.SendPropertyChanging();
  2053. this._IATACode = value;
  2054. this.SendPropertyChanged("IATACode");
  2055. this.OnIATACodeChanged();
  2056. }
  2057. }
  2058. }
  2059. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")]
  2060. public string Name
  2061. {
  2062. get
  2063. {
  2064. return this._Name;
  2065. }
  2066. set
  2067. {
  2068. if ((this._Name != value))
  2069. {
  2070. this.OnNameChanging(value);
  2071. this.SendPropertyChanging();
  2072. this._Name = value;
  2073. this.SendPropertyChanged("Name");
  2074. this.OnNameChanged();
  2075. }
  2076. }
  2077. }
  2078. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Airports_Routes", Storage="_Routes", ThisKey="ID", OtherKey="DepartureAirportID")]
  2079. public EntitySet<Routes> Routes
  2080. {
  2081. get
  2082. {
  2083. return this._Routes;
  2084. }
  2085. set
  2086. {
  2087. this._Routes.Assign(value);
  2088. }
  2089. }
  2090. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Airports_Routes1", Storage="_Routes1", ThisKey="ID", OtherKey="ArrivalAirportID")]
  2091. public EntitySet<Routes> Routes1
  2092. {
  2093. get
  2094. {
  2095. return this._Routes1;
  2096. }
  2097. set
  2098. {
  2099. this._Routes1.Assign(value);
  2100. }
  2101. }
  2102. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Countries_Airports", Storage="_Countries", ThisKey="CountryID", OtherKey="ID", IsForeignKey=true)]
  2103. public Countries Countries
  2104. {
  2105. get
  2106. {
  2107. return this._Countries.Entity;
  2108. }
  2109. set
  2110. {
  2111. Countries previousValue = this._Countries.Entity;
  2112. if (((previousValue != value)
  2113. || (this._Countries.HasLoadedOrAssignedValue == false)))
  2114. {
  2115. this.SendPropertyChanging();
  2116. if ((previousValue != null))
  2117. {
  2118. this._Countries.Entity = null;
  2119. previousValue.Airports.Remove(this);
  2120. }
  2121. this._Countries.Entity = value;
  2122. if ((value != null))
  2123. {
  2124. value.Airports.Add(this);
  2125. this._CountryID = value.ID;
  2126. }
  2127. else
  2128. {
  2129. this._CountryID = default(int);
  2130. }
  2131. this.SendPropertyChanged("Countries");
  2132. }
  2133. }
  2134. }
  2135. public event PropertyChangingEventHandler PropertyChanging;
  2136. public event PropertyChangedEventHandler PropertyChanged;
  2137. protected virtual void SendPropertyChanging()
  2138. {
  2139. if ((this.PropertyChanging != null))
  2140. {
  2141. this.PropertyChanging(this, emptyChangingEventArgs);
  2142. }
  2143. }
  2144. protected virtual void SendPropertyChanged(String propertyName)
  2145. {
  2146. if ((this.PropertyChanged != null))
  2147. {
  2148. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  2149. }
  2150. }
  2151. private void attach_Routes(Routes entity)
  2152. {
  2153. this.SendPropertyChanging();
  2154. entity.Airports = this;
  2155. }
  2156. private void detach_Routes(Routes entity)
  2157. {
  2158. this.SendPropertyChanging();
  2159. entity.Airports = null;
  2160. }
  2161. private void attach_Routes1(Routes entity)
  2162. {
  2163. this.SendPropertyChanging();
  2164. entity.Airports1 = this;
  2165. }
  2166. private void detach_Routes1(Routes entity)
  2167. {
  2168. this.SendPropertyChanging();
  2169. entity.Airports1 = null;
  2170. }
  2171. }
  2172. [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Aircrafts")]
  2173. public partial class Aircrafts : INotifyPropertyChanging, INotifyPropertyChanged
  2174. {
  2175. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  2176. private int _ID;
  2177. private string _Name;
  2178. private string _MakeModel;
  2179. private int _TotalSeats;
  2180. private int _EconomySeats;
  2181. private int _BusinessSeats;
  2182. private EntitySet<Schedules> _Schedules;
  2183. #region Определения метода расширяемости
  2184. partial void OnLoaded();
  2185. partial void OnValidate(System.Data.Linq.ChangeAction action);
  2186. partial void OnCreated();
  2187. partial void OnIDChanging(int value);
  2188. partial void OnIDChanged();
  2189. partial void OnNameChanging(string value);
  2190. partial void OnNameChanged();
  2191. partial void OnMakeModelChanging(string value);
  2192. partial void OnMakeModelChanged();
  2193. partial void OnTotalSeatsChanging(int value);
  2194. partial void OnTotalSeatsChanged();
  2195. partial void OnEconomySeatsChanging(int value);
  2196. partial void OnEconomySeatsChanged();
  2197. partial void OnBusinessSeatsChanging(int value);
  2198. partial void OnBusinessSeatsChanged();
  2199. #endregion
  2200. public Aircrafts()
  2201. {
  2202. this._Schedules = new EntitySet<Schedules>(new Action<Schedules>(this.attach_Schedules), new Action<Schedules>(this.detach_Schedules));
  2203. OnCreated();
  2204. }
  2205. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  2206. public int ID
  2207. {
  2208. get
  2209. {
  2210. return this._ID;
  2211. }
  2212. set
  2213. {
  2214. if ((this._ID != value))
  2215. {
  2216. this.OnIDChanging(value);
  2217. this.SendPropertyChanging();
  2218. this._ID = value;
  2219. this.SendPropertyChanged("ID");
  2220. this.OnIDChanged();
  2221. }
  2222. }
  2223. }
  2224. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  2225. public string Name
  2226. {
  2227. get
  2228. {
  2229. return this._Name;
  2230. }
  2231. set
  2232. {
  2233. if ((this._Name != value))
  2234. {
  2235. this.OnNameChanging(value);
  2236. this.SendPropertyChanging();
  2237. this._Name = value;
  2238. this.SendPropertyChanged("Name");
  2239. this.OnNameChanged();
  2240. }
  2241. }
  2242. }
  2243. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MakeModel", DbType="NVarChar(10)")]
  2244. public string MakeModel
  2245. {
  2246. get
  2247. {
  2248. return this._MakeModel;
  2249. }
  2250. set
  2251. {
  2252. if ((this._MakeModel != value))
  2253. {
  2254. this.OnMakeModelChanging(value);
  2255. this.SendPropertyChanging();
  2256. this._MakeModel = value;
  2257. this.SendPropertyChanged("MakeModel");
  2258. this.OnMakeModelChanged();
  2259. }
  2260. }
  2261. }
  2262. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalSeats", DbType="Int NOT NULL")]
  2263. public int TotalSeats
  2264. {
  2265. get
  2266. {
  2267. return this._TotalSeats;
  2268. }
  2269. set
  2270. {
  2271. if ((this._TotalSeats != value))
  2272. {
  2273. this.OnTotalSeatsChanging(value);
  2274. this.SendPropertyChanging();
  2275. this._TotalSeats = value;
  2276. this.SendPropertyChanged("TotalSeats");
  2277. this.OnTotalSeatsChanged();
  2278. }
  2279. }
  2280. }
  2281. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EconomySeats", DbType="Int NOT NULL")]
  2282. public int EconomySeats
  2283. {
  2284. get
  2285. {
  2286. return this._EconomySeats;
  2287. }
  2288. set
  2289. {
  2290. if ((this._EconomySeats != value))
  2291. {
  2292. this.OnEconomySeatsChanging(value);
  2293. this.SendPropertyChanging();
  2294. this._EconomySeats = value;
  2295. this.SendPropertyChanged("EconomySeats");
  2296. this.OnEconomySeatsChanged();
  2297. }
  2298. }
  2299. }
  2300. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BusinessSeats", DbType="Int NOT NULL")]
  2301. public int BusinessSeats
  2302. {
  2303. get
  2304. {
  2305. return this._BusinessSeats;
  2306. }
  2307. set
  2308. {
  2309. if ((this._BusinessSeats != value))
  2310. {
  2311. this.OnBusinessSeatsChanging(value);
  2312. this.SendPropertyChanging();
  2313. this._BusinessSeats = value;
  2314. this.SendPropertyChanged("BusinessSeats");
  2315. this.OnBusinessSeatsChanged();
  2316. }
  2317. }
  2318. }
  2319. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Aircrafts_Schedules", Storage="_Schedules", ThisKey="ID", OtherKey="AircraftID")]
  2320. public EntitySet<Schedules> Schedules
  2321. {
  2322. get
  2323. {
  2324. return this._Schedules;
  2325. }
  2326. set
  2327. {
  2328. this._Schedules.Assign(value);
  2329. }
  2330. }
  2331. public event PropertyChangingEventHandler PropertyChanging;
  2332. public event PropertyChangedEventHandler PropertyChanged;
  2333. protected virtual void SendPropertyChanging()
  2334. {
  2335. if ((this.PropertyChanging != null))
  2336. {
  2337. this.PropertyChanging(this, emptyChangingEventArgs);
  2338. }
  2339. }
  2340. protected virtual void SendPropertyChanged(String propertyName)
  2341. {
  2342. if ((this.PropertyChanged != null))
  2343. {
  2344. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  2345. }
  2346. }
  2347. private void attach_Schedules(Schedules entity)
  2348. {
  2349. this.SendPropertyChanging();
  2350. entity.Aircrafts = this;
  2351. }
  2352. private void detach_Schedules(Schedules entity)
  2353. {
  2354. this.SendPropertyChanging();
  2355. entity.Aircrafts = null;
  2356. }
  2357. }
  2358. }
  2359. #pragma warning restore 1591