Hệ thống quản lý phòng tập trong C#

1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated
by a tool.
4 // Runtime Version:
4.0.30319.18408
5 //
6 // Changes to
this file may cause incorrect behavior and will be lost if
7 // the code
is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------

10
11 #pragma warning disable
1591
12
13 namespace
GymManagementSystem {
14     
15     
16     ///
<summary>
17     ///
Represents a strongly typed in-memory cache of data.
18     ///</summary>

19     
[global::System.Serializable()]
20     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
21     
[global::System.ComponentModel.ToolboxItem(true)]
22     
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
23     
[global::System.Xml.Serialization.XmlRootAttribute("GymDataSet2")]
24     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
25     
public partial class GymDataSet2 : global::System.Data.DataSet {
26         
27         
private equipmentDataTable tableequipment;
28         
29         
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
30         
31         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
32         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
33         
public GymDataSet2() {
34             
this.BeginInit();
35             
this.InitClass();
36             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
37             
base.Tables.CollectionChanged += schemaChangedHandler;
38             
base.Relations.CollectionChanged += schemaChangedHandler;
39             
this.EndInit();
40         }
41         
42         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
43         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
44         
protected GymDataSet2(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
45                 
base(info, context, false) {
46             
if ((this.IsBinarySerialized(info, context) == true)) {
47                 
this.InitVars(false);
48                 
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
49                 
this.Tables.CollectionChanged += schemaChangedHandler1;
50                 
this.Relations.CollectionChanged += schemaChangedHandler1;
51                 
return;
52             }
53             
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
54             
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
55                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
56                 ds.ReadXmlSchema(
new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
57                 
if ((ds.Tables["equipment"] != null)) {
58                     
base.Tables.Add(new equipmentDataTable(ds.Tables["equipment"]));
59                 }
60                 
this.DataSetName = ds.DataSetName;
61                 
this.Prefix = ds.Prefix;
62                 
this.Namespace = ds.Namespace;
63                 
this.Locale = ds.Locale;
64                 
this.CaseSensitive = ds.CaseSensitive;
65                 
this.EnforceConstraints = ds.EnforceConstraints;
66                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
67                 
this.InitVars();
68             }
69             
else {
70                 
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
71             }
72             
this.GetSerializationData(info, context);
73             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
74             
base.Tables.CollectionChanged += schemaChangedHandler;
75             
this.Relations.CollectionChanged += schemaChangedHandler;
76         }
77         
78         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
79         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
80         
[global::System.ComponentModel.Browsable(false)]
81         
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
82         
public equipmentDataTable equipment {
83             
get {
84                 
return this.tableequipment;
85             }
86         }
87         
88         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
89         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
90         
[global::System.ComponentModel.BrowsableAttribute(true)]
91         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
92         
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
93             
get {
94                 
return this._schemaSerializationMode;
95             }
96             
set {
97                 
this._schemaSerializationMode = value;
98             }
99         }
100         
101         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
102         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
103         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
104         
public new global::System.Data.DataTableCollection Tables {
105             
get {
106                 
return base.Tables;
107             }
108         }
109         
110         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
111         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
112         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
113         
public new global::System.Data.DataRelationCollection Relations {
114             
get {
115                 
return base.Relations;
116             }
117         }
118         
119         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
120         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
121         
protected override void InitializeDerivedDataSet() {
122             
this.BeginInit();
123             
this.InitClass();
124             
this.EndInit();
125         }
126         
127         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
128         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
129         
public override global::System.Data.DataSet Clone() {
130             GymDataSet2 cln = ((GymDataSet2)(
base.Clone()));
131             cln.InitVars();
132             cln.SchemaSerializationMode =
this.SchemaSerializationMode;
133             
return cln;
134         }
135         
136         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
137         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
138         
protected override bool ShouldSerializeTables() {
139             
return false;
140         }
141         
142         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
143         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
144         
protected override bool ShouldSerializeRelations() {
145             
return false;
146         }
147         
148         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
149         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
150         
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
151             
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
152                 
this.Reset();
153                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
154                 ds.ReadXml(reader);
155                 
if ((ds.Tables["equipment"] != null)) {
156                     
base.Tables.Add(new equipmentDataTable(ds.Tables["equipment"]));
157                 }
158                 
this.DataSetName = ds.DataSetName;
159                 
this.Prefix = ds.Prefix;
160                 
this.Namespace = ds.Namespace;
161                 
this.Locale = ds.Locale;
162                 
this.CaseSensitive = ds.CaseSensitive;
163                 
this.EnforceConstraints = ds.EnforceConstraints;
164                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
165                 
this.InitVars();
166             }
167             
else {
168                 
this.ReadXml(reader);
169                 
this.InitVars();
170             }
171         }
172         
173         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
174         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
175         
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
176             
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
177             
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
178             stream.Position =
0;
179             
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
180         }
181         
182         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
183         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
184         
internal void InitVars() {
185             
this.InitVars(true);
186         }
187         
188         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
189         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
190         
internal void InitVars(bool initTable) {
191             
this.tableequipment = ((equipmentDataTable)(base.Tables["equipment"]));
192             
if ((initTable == true)) {
193                 
if ((this.tableequipment != null)) {
194                     
this.tableequipment.InitVars();
195                 }
196             }
197         }
198         
199         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
200         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
201         
private void InitClass() {
202             
this.DataSetName = "GymDataSet2";
203             
this.Prefix = "";
204             
this.Namespace = "http://tempuri.org/GymDataSet2.xsd";
205             
this.EnforceConstraints = true;
206             
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
207             
this.tableequipment = new equipmentDataTable();
208             
base.Tables.Add(this.tableequipment);
209         }
210         
211         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
212         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
213         
private bool ShouldSerializeequipment() {
214             
return false;
215         }
216         
217         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
218         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
219         
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
220             
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
221                 
this.InitVars();
222             }
223         }
224         
225         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
226         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
227         
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
228             GymDataSet2 ds =
new GymDataSet2();
229             
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
230             
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
231             
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
232             any.Namespace = ds.Namespace;
233             sequence.Items.Add(any);
234             type.Particle = sequence;
235             
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
236             
if (xs.Contains(dsSchema.TargetNamespace)) {
237                 
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
238                 
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
239                 
try {
240                     
global::System.Xml.Schema.XmlSchema schema = null;
241                     dsSchema.Write(s1);
242                     
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
243                         schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
244                         s2.SetLength(
0);
245                         schema.Write(s2);
246                         
if ((s1.Length == s2.Length)) {
247                             s1.Position =
0;
248                             s2.Position =
0;
249                             
for (; ((s1.Position != s1.Length)
250                                         && (s1.ReadByte() == s2.ReadByte())); ) {
251                                 ;
252                             }
253                             
if ((s1.Position == s1.Length)) {
254                                 
return type;
255                             }
256                         }
257                     }
258                 }
259                 
finally {
260                     
if ((s1 != null)) {
261                         s1.Close();
262                     }
263                     
if ((s2 != null)) {
264                         s2.Close();
265                     }
266                 }
267             }
268             xs.Add(dsSchema);
269             
return type;
270         }
271         
272         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
273         
public delegate void equipmentRowChangeEventHandler(object sender, equipmentRowChangeEvent e);
274         
275         ///
<summary>
276         ///
Represents the strongly named DataTable class.
277         ///</summary>

278         
[global::System.Serializable()]
279         
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
280         
public partial class equipmentDataTable : global::System.Data.TypedTableBase<equipmentRow> {
281             
282             
private global::System.Data.DataColumn columneqp_id;
283             
284             
private global::System.Data.DataColumn columnname;
285             
286             
private global::System.Data.DataColumn columndescription;
287             
288             
private global::System.Data.DataColumn columnused;
289             
290             
private global::System.Data.DataColumn columncost;
291             
292             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
293             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
294             
public equipmentDataTable() {
295                 
this.TableName = "equipment";
296                 
this.BeginInit();
297                 
this.InitClass();
298                 
this.EndInit();
299             }
300             
301             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
302             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
303             
internal equipmentDataTable(global::System.Data.DataTable table) {
304                 
this.TableName = table.TableName;
305                 
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
306                     
this.CaseSensitive = table.CaseSensitive;
307                 }
308                 
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
309                     
this.Locale = table.Locale;
310                 }
311                 
if ((table.Namespace != table.DataSet.Namespace)) {
312                     
this.Namespace = table.Namespace;
313                 }
314                 
this.Prefix = table.Prefix;
315                 
this.MinimumCapacity = table.MinimumCapacity;
316             }
317             
318             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
319             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
320             
protected equipmentDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
321                     
base(info, context) {
322                 
this.InitVars();
323             }
324             
325             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
326             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
327             
public global::System.Data.DataColumn eqp_idColumn {
328                 
get {
329                     
return this.columneqp_id;
330                 }
331             }
332             
333             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
334             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
335             
public global::System.Data.DataColumn nameColumn {
336                 
get {
337                     
return this.columnname;
338                 }
339             }
340             
341             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
342             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
343             
public global::System.Data.DataColumn descriptionColumn {
344                 
get {
345                     
return this.columndescription;
346                 }
347             }
348             
349             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
350             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
351             
public global::System.Data.DataColumn usedColumn {
352                 
get {
353                     
return this.columnused;
354                 }
355             }
356             
357             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
358             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
359             
public global::System.Data.DataColumn costColumn {
360                 
get {
361                     
return this.columncost;
362                 }
363             }
364             
365             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
366             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
367             
[global::System.ComponentModel.Browsable(false)]
368             
public int Count {
369                 
get {
370                     
return this.Rows.Count;
371                 }
372             }
373             
374             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
375             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
376             
public equipmentRow this[int index] {
377                 
get {
378                     
return ((equipmentRow)(this.Rows[index]));
379                 }
380             }
381             
382             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
383             
public event equipmentRowChangeEventHandler equipmentRowChanging;
384             
385             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
386             
public event equipmentRowChangeEventHandler equipmentRowChanged;
387             
388             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
389             
public event equipmentRowChangeEventHandler equipmentRowDeleting;
390             
391             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
392             
public event equipmentRowChangeEventHandler equipmentRowDeleted;
393             
394             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
395             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
396             
public void AddequipmentRow(equipmentRow row) {
397                 
this.Rows.Add(row);
398             }
399             
400             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
401             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
402             
public equipmentRow AddequipmentRow(string name, string description, string used, string cost) {
403                 equipmentRow rowequipmentRow = ((equipmentRow)(
this.NewRow()));
404                 
object[] columnValuesArray = new object[] {
405                         
null,
406                         name,
407                         description,
408                         used,
409                         cost};
410                 rowequipmentRow.ItemArray = columnValuesArray;
411                 
this.Rows.Add(rowequipmentRow);
412                 
return rowequipmentRow;
413             }
414             
415             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
416             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
417             
public override global::System.Data.DataTable Clone() {
418                 equipmentDataTable cln = ((equipmentDataTable)(
base.Clone()));
419                 cln.InitVars();
420                 
return cln;
421             }
422             
423             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
424             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
425             
protected override global::System.Data.DataTable CreateInstance() {
426                 
return new equipmentDataTable();
427             }
428             
429             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
430             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
431             
internal void InitVars() {
432                 
this.columneqp_id = base.Columns["eqp_id"];
433                 
this.columnname = base.Columns["name"];
434                 
this.columndescription = base.Columns["description"];
435                 
this.columnused = base.Columns["used"];
436                 
this.columncost = base.Columns["cost"];
437             }
438             
439             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
440             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
441             
private void InitClass() {
442                 
this.columneqp_id = new global::System.Data.DataColumn("eqp_id", typeof(int), null, global::System.Data.MappingType.Element);
443                 
base.Columns.Add(this.columneqp_id);
444                 
this.columnname = new global::System.Data.DataColumn("name", typeof(string), null, global::System.Data.MappingType.Element);
445                 
base.Columns.Add(this.columnname);
446                 
this.columndescription = new global::System.Data.DataColumn("description", typeof(string), null, global::System.Data.MappingType.Element);
447                 
base.Columns.Add(this.columndescription);
448                 
this.columnused = new global::System.Data.DataColumn("used", typeof(string), null, global::System.Data.MappingType.Element);
449                 
base.Columns.Add(this.columnused);
450                 
this.columncost = new global::System.Data.DataColumn("cost", typeof(string), null, global::System.Data.MappingType.Element);
451                 
base.Columns.Add(this.columncost);
452                 
this.columneqp_id.AutoIncrement = true;
453                 
this.columneqp_id.AutoIncrementSeed = -1;
454                 
this.columneqp_id.AutoIncrementStep = -1;
455                 
this.columneqp_id.AllowDBNull = false;
456                 
this.columneqp_id.ReadOnly = true;
457                 
this.columnname.MaxLength = 50;
458                 
this.columndescription.MaxLength = 50;
459                 
this.columnused.MaxLength = 50;
460                 
this.columncost.MaxLength = 50;
461             }
462             
463             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
464             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
465             
public equipmentRow NewequipmentRow() {
466                 
return ((equipmentRow)(this.NewRow()));
467             }
468             
469             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
470             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
471             
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
472                 
return new equipmentRow(builder);
473             }
474             
475             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
476             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
477             
protected override global::System.Type GetRowType() {
478                 
return typeof(equipmentRow);
479             }
480             
481             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
482             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
483             
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
484                 
base.OnRowChanged(e);
485                 
if ((this.equipmentRowChanged != null)) {
486                     
this.equipmentRowChanged(this, new equipmentRowChangeEvent(((equipmentRow)(e.Row)), e.Action));
487                 }
488             }
489             
490             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
491             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
492             
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
493                 
base.OnRowChanging(e);
494                 
if ((this.equipmentRowChanging != null)) {
495                     
this.equipmentRowChanging(this, new equipmentRowChangeEvent(((equipmentRow)(e.Row)), e.Action));
496                 }
497             }
498             
499             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
500             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
501             
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
502                 
base.OnRowDeleted(e);
503                 
if ((this.equipmentRowDeleted != null)) {
504                     
this.equipmentRowDeleted(this, new equipmentRowChangeEvent(((equipmentRow)(e.Row)), e.Action));
505                 }
506             }
507             
508             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
509             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
510             
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
511                 
base.OnRowDeleting(e);
512                 
if ((this.equipmentRowDeleting != null)) {
513                     
this.equipmentRowDeleting(this, new equipmentRowChangeEvent(((equipmentRow)(e.Row)), e.Action));
514                 }
515             }
516             
517             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
518             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
519             
public void RemoveequipmentRow(equipmentRow row) {
520                 
this.Rows.Remove(row);
521             }
522             
523             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
524             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
525             
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
526                 
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
527                 
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
528                 GymDataSet2 ds =
new GymDataSet2();
529                 
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
530                 any1.Namespace =
"http://www.w3.org/2001/XMLSchema";
531                 any1.MinOccurs =
new decimal(0);
532                 any1.MaxOccurs =
decimal.MaxValue;
533                 any1.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
534                 sequence.Items.Add(any1);
535                 
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
536                 any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1";
537                 any2.MinOccurs =
new decimal(1);
538                 any2.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
539                 sequence.Items.Add(any2);
540                 
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
541                 attribute1.Name =
"namespace";
542                 attribute1.FixedValue = ds.Namespace;
543                 type.Attributes.Add(attribute1);
544                 
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
545                 attribute2.Name =
"tableTypeName";
546                 attribute2.FixedValue =
"equipmentDataTable";
547                 type.Attributes.Add(attribute2);
548                 type.Particle = sequence;
549                 
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
550                 
if (xs.Contains(dsSchema.TargetNamespace)) {
551                     
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
552                     
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
553                     
try {
554                         
global::System.Xml.Schema.XmlSchema schema = null;
555                         dsSchema.Write(s1);
556                         
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
557                             schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
558                             s2.SetLength(
0);
559                             schema.Write(s2);
560                             
if ((s1.Length == s2.Length)) {
561                                 s1.Position =
0;
562                                 s2.Position =
0;
563                                 
for (; ((s1.Position != s1.Length)
564                                             && (s1.ReadByte() == s2.ReadByte())); ) {
565                                     ;
566                                 }
567                                 
if ((s1.Position == s1.Length)) {
568                                     
return type;
569                                 }
570                             }
571                         }
572                     }
573                     
finally {
574                         
if ((s1 != null)) {
575                             s1.Close();
576                         }
577                         
if ((s2 != null)) {
578                             s2.Close();
579                         }
580                     }
581                 }
582                 xs.Add(dsSchema);
583                 
return type;
584             }
585         }

586         
587         ///
<summary>
588         ///
Represents strongly named DataRow class.
589         ///</summary>

590         
public partial class equipmentRow : global::System.Data.DataRow {
591             
592             
private equipmentDataTable tableequipment;
593             
594             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
595             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
596             
internal equipmentRow(global::System.Data.DataRowBuilder rb) :
597                     
base(rb) {
598                 
this.tableequipment = ((equipmentDataTable)(this.Table));
599             }
600             
601             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
602             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
603             
public int eqp_id {
604                 
get {
605                     
return ((int)(this[this.tableequipment.eqp_idColumn]));
606                 }
607                 
set {
608                     
this[this.tableequipment.eqp_idColumn] = value;
609                 }
610             }
611             
612             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
613             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
614             
public string name {
615                 
get {
616                     
try {
617                         
return ((string)(this[this.tableequipment.nameColumn]));
618                     }
619                     
catch (global::System.InvalidCastException e) {
620                         
throw new global::System.Data.StrongTypingException("The value for column \'name\' in table \'equipment\' is DBNull.", e);
621                     }
622                 }
623                 
set {
624                     
this[this.tableequipment.nameColumn] = value;
625                 }
626             }
627             
628             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
629             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
630             
public string description {
631                 
get {
632                     
try {
633                         
return ((string)(this[this.tableequipment.descriptionColumn]));
634                     }
635                     
catch (global::System.InvalidCastException e) {
636                         
throw new global::System.Data.StrongTypingException("The value for column \'description\' in table \'equipment\' is DBNull.", e);
637                     }
638                 }
639                 
set {
640                     
this[this.tableequipment.descriptionColumn] = value;
641                 }
642             }
643             
644             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
645             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
646             
public string used {
647                 
get {
648                     
try {
649                         
return ((string)(this[this.tableequipment.usedColumn]));
650                     }
651                     
catch (global::System.InvalidCastException e) {
652                         
throw new global::System.Data.StrongTypingException("The value for column \'used\' in table \'equipment\' is DBNull.", e);
653                     }
654                 }
655                 
set {
656                     
this[this.tableequipment.usedColumn] = value;
657                 }
658             }
659             
660             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
661             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
662             
public string cost {
663                 
get {
664                     
try {
665                         
return ((string)(this[this.tableequipment.costColumn]));
666                     }
667                     
catch (global::System.InvalidCastException e) {
668                         
throw new global::System.Data.StrongTypingException("The value for column \'cost\' in table \'equipment\' is DBNull.", e);
669                     }
670                 }
671                 
set {
672                     
this[this.tableequipment.costColumn] = value;
673                 }
674             }
675             
676             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
677             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
678             
public bool IsnameNull() {
679                 
return this.IsNull(this.tableequipment.nameColumn);
680             }
681             
682             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
683             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
684             
public void SetnameNull() {
685                 
this[this.tableequipment.nameColumn] = global::System.Convert.DBNull;
686             }
687             
688             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
689             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
690             
public bool IsdescriptionNull() {
691                 
return this.IsNull(this.tableequipment.descriptionColumn);
692             }
693             
694             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
695             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
696             
public void SetdescriptionNull() {
697                 
this[this.tableequipment.descriptionColumn] = global::System.Convert.DBNull;
698             }
699             
700             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
701             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
702             
public bool IsusedNull() {
703                 
return this.IsNull(this.tableequipment.usedColumn);
704             }
705             
706             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
707             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
708             
public void SetusedNull() {
709                 
this[this.tableequipment.usedColumn] = global::System.Convert.DBNull;
710             }
711             
712             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
713             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
714             
public bool IscostNull() {
715                 
return this.IsNull(this.tableequipment.costColumn);
716             }
717             
718             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
719             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
720             
public void SetcostNull() {
721                 
this[this.tableequipment.costColumn] = global::System.Convert.DBNull;
722             }
723         }

724         
725         ///
<summary>
726         ///
Row event argument class
727         ///</summary>

728         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
729         
public class equipmentRowChangeEvent : global::System.EventArgs {
730             
731             
private equipmentRow eventRow;
732             
733             
private global::System.Data.DataRowAction eventAction;
734             
735             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
736             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
737             
public equipmentRowChangeEvent(equipmentRow row, global::System.Data.DataRowAction action) {
738                 
this.eventRow = row;
739                 
this.eventAction = action;
740             }
741             
742             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
743             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
744             
public equipmentRow Row {
745                 
get {
746                     
return this.eventRow;
747                 }
748             }
749             
750             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
751             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
752             
public global::System.Data.DataRowAction Action {
753                 
get {
754                     
return this.eventAction;
755                 }
756             }
757         }
758     }
759 }

760 namespace
GymManagementSystem.GymDataSet2TableAdapters {
761     
762     
763     ///
<summary>
764     ///
Represents the connection and commands used to retrieve and save data.
765     ///</summary>

766     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
767     
[global::System.ComponentModel.ToolboxItem(true)]
768     
[global::System.ComponentModel.DataObjectAttribute(true)]
769     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
770         
", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
771     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
772     
public partial class equipmentTableAdapter : global::System.ComponentModel.Component {
773         
774         
private global::System.Data.SqlClient.SqlDataAdapter _adapter;
775         
776         
private global::System.Data.SqlClient.SqlConnection _connection;
777         
778         
private global::System.Data.SqlClient.SqlTransaction _transaction;
779         
780         
private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
781         
782         
private bool _clearBeforeFill;
783         
784         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
785         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
786         
public equipmentTableAdapter() {
787             
this.ClearBeforeFill = true;
788         }
789         
790         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
791         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
792         
protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
793             
get {
794                 
if ((this._adapter == null)) {
795                     
this.InitAdapter();
796                 }
797                 
return this._adapter;
798             }
799         }
800         
801         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
802         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
803         
internal global::System.Data.SqlClient.SqlConnection Connection {
804             
get {
805                 
if ((this._connection == null)) {
806                     
this.InitConnection();
807                 }
808                 
return this._connection;
809             }
810             
set {
811                 
this._connection = value;
812                 
if ((this.Adapter.InsertCommand != null)) {
813                     
this.Adapter.InsertCommand.Connection = value;
814                 }
815                 
if ((this.Adapter.DeleteCommand != null)) {
816                     
this.Adapter.DeleteCommand.Connection = value;
817                 }
818                 
if ((this.Adapter.UpdateCommand != null)) {
819                     
this.Adapter.UpdateCommand.Connection = value;
820                 }
821                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
822                     
if ((this.CommandCollection[i] != null)) {
823                         ((
global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
824                     }
825                 }
826             }
827         }
828         
829         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
830         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
831         
internal global::System.Data.SqlClient.SqlTransaction Transaction {
832             
get {
833                 
return this._transaction;
834             }
835             
set {
836                 
this._transaction = value;
837                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
838                     
this.CommandCollection[i].Transaction = this._transaction;
839                 }
840                 
if (((this.Adapter != null)
841                             && (
this.Adapter.DeleteCommand != null))) {
842                     
this.Adapter.DeleteCommand.Transaction = this._transaction;
843                 }
844                 
if (((this.Adapter != null)
845                             && (
this.Adapter.InsertCommand != null))) {
846                     
this.Adapter.InsertCommand.Transaction = this._transaction;
847                 }
848                 
if (((this.Adapter != null)
849                             && (
this.Adapter.UpdateCommand != null))) {
850                     
this.Adapter.UpdateCommand.Transaction = this._transaction;
851                 }
852             }
853         }
854         
855         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
856         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
857         
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
858             
get {
859                 
if ((this._commandCollection == null)) {
860                     
this.InitCommandCollection();
861                 }
862                 
return this._commandCollection;
863             }
864         }
865         
866         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
867         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
868         
public bool ClearBeforeFill {
869             
get {
870                 
return this._clearBeforeFill;
871             }
872             
set {
873                 
this._clearBeforeFill = value;
874             }
875         }
876         
877         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
878         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
879         
private void InitAdapter() {
880             
this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
881             
global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
882             tableMapping.SourceTable =
"Table";
883             tableMapping.DataSetTable =
"equipment";
884             tableMapping.ColumnMappings.Add(
"eqp_id", "eqp_id");
885             tableMapping.ColumnMappings.Add(
"name", "name");
886             tableMapping.ColumnMappings.Add(
"description", "description");
887             tableMapping.ColumnMappings.Add(
"used", "used");
888             tableMapping.ColumnMappings.Add(
"cost", "cost");
889             
this._adapter.TableMappings.Add(tableMapping);
890             
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
891             
this._adapter.InsertCommand.Connection = this.Connection;
892             
this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[equipment] ([name], [description], [used], [cost]) VALUES (@na" +
893                 
"me, @description, @used, @cost)";
894             
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
895             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@name", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
896             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@description", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "description", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
897             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@used", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "used", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
898             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@cost", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "cost", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
899         }
900         
901         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
902         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
903         
private void InitConnection() {
904             
this._connection = new global::System.Data.SqlClient.SqlConnection();
905             
this._connection.ConnectionString = global::GymManagementSystem.Properties.Settings.Default.GymConnectionString;
906         }
907         
908         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
909         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
910         
private void InitCommandCollection() {
911             
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
912             
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
913             
this._commandCollection[0].Connection = this.Connection;
914             
this._commandCollection[0].CommandText = "SELECT eqp_id, name, description, used, cost FROM dbo.equipment";
915             
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
916         }
917         
918         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
919         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
920         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
921         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
922         
public virtual int Fill(GymDataSet2.equipmentDataTable dataTable) {
923             
this.Adapter.SelectCommand = this.CommandCollection[0];
924             
if ((this.ClearBeforeFill == true)) {
925                 dataTable.Clear();
926             }
927             
int returnValue = this.Adapter.Fill(dataTable);
928             
return returnValue;
929         }
930         
931         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
932         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
933         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
934         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
935         
public virtual GymDataSet2.equipmentDataTable GetData() {
936             
this.Adapter.SelectCommand = this.CommandCollection[0];
937             GymDataSet2.equipmentDataTable dataTable =
new GymDataSet2.equipmentDataTable();
938             
this.Adapter.Fill(dataTable);
939             
return dataTable;
940         }
941         
942         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
943         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
944         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
945         
public virtual int Update(GymDataSet2.equipmentDataTable dataTable) {
946             
return this.Adapter.Update(dataTable);
947         }
948         
949         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
950         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
951         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
952         
public virtual int Update(GymDataSet2 dataSet) {
953             
return this.Adapter.Update(dataSet, "equipment");
954         }
955         
956         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
957         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
958         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
959         
public virtual int Update(global::System.Data.DataRow dataRow) {
960             
return this.Adapter.Update(new global::System.Data.DataRow[] {
961                         dataRow});
962         }
963         
964         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
965         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
966         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
967         
public virtual int Update(global::System.Data.DataRow[] dataRows) {
968             
return this.Adapter.Update(dataRows);
969         }
970         
971         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
972         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
973         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
974         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
975         
public virtual int Insert(string name, string description, string used, string cost) {
976             
if ((name == null)) {
977                 
this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
978             }
979             
else {
980                 
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(name));
981             }
982             
if ((description == null)) {
983                 
this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
984             }
985             
else {
986                 
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(description));
987             }
988             
if ((used == null)) {
989                 
this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
990             }
991             
else {
992                 
this.Adapter.InsertCommand.Parameters[2].Value = ((string)(used));
993             }
994             
if ((cost == null)) {
995                 
this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
996             }
997             
else {
998                 
this.Adapter.InsertCommand.Parameters[3].Value = ((string)(cost));
999             }
1000             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
1001             
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
1002                         !=
global::System.Data.ConnectionState.Open)) {
1003                 
this.Adapter.InsertCommand.Connection.Open();
1004             }
1005             
try {
1006                 
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
1007                 
return returnValue;
1008             }
1009             
finally {
1010                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1011                     
this.Adapter.InsertCommand.Connection.Close();
1012                 }
1013             }
1014         }
1015     }

1016     
1017     ///
<summary>
1018     ///
TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1019     ///</summary>

1020     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
1021     
[global::System.ComponentModel.ToolboxItem(true)]
1022     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1023         
"esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1024     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1025     
public partial class TableAdapterManager : global::System.ComponentModel.Component {
1026         
1027         
private UpdateOrderOption _updateOrder;
1028         
1029         
private equipmentTableAdapter _equipmentTableAdapter;
1030         
1031         
private bool _backupDataSetBeforeUpdate;
1032         
1033         
private global::System.Data.IDbConnection _connection;
1034         
1035         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1036         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1037         
public UpdateOrderOption UpdateOrder {
1038             
get {
1039                 
return this._updateOrder;
1040             }
1041             
set {
1042                 
this._updateOrder = value;
1043             }
1044         }
1045         
1046         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1047         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1048         [
global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1049             
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
1050             
"a", "System.Drawing.Design.UITypeEditor")]
1051         
public equipmentTableAdapter equipmentTableAdapter {
1052             
get {
1053                 
return this._equipmentTableAdapter;
1054             }
1055             
set {
1056                 
this._equipmentTableAdapter = value;
1057             }
1058         }
1059         
1060         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1061         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1062         
public bool BackupDataSetBeforeUpdate {
1063             
get {
1064                 
return this._backupDataSetBeforeUpdate;
1065             }
1066             
set {
1067                 
this._backupDataSetBeforeUpdate = value;
1068             }
1069         }
1070         
1071         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1072         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1073         
[global::System.ComponentModel.Browsable(false)]
1074         
public global::System.Data.IDbConnection Connection {
1075             
get {
1076                 
if ((this._connection != null)) {
1077                     
return this._connection;
1078                 }
1079                 
if (((this._equipmentTableAdapter != null)
1080                             && (
this._equipmentTableAdapter.Connection != null))) {
1081                     
return this._equipmentTableAdapter.Connection;
1082                 }
1083                 
return null;
1084             }
1085             
set {
1086                 
this._connection = value;
1087             }
1088         }
1089         
1090         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1091         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1092         
[global::System.ComponentModel.Browsable(false)]
1093         
public int TableAdapterInstanceCount {
1094             
get {
1095                 
int count = 0;
1096                 
if ((this._equipmentTableAdapter != null)) {
1097                     count = (count +
1);
1098                 }
1099                 
return count;
1100             }
1101         }

1102         
1103         ///
<summary>
1104         ///
Update rows in top-down order.
1105         ///</summary>

1106         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1107         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1108         
private int UpdateUpdatedRows(GymDataSet2 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1109             
int result = 0;
1110             
if ((this._equipmentTableAdapter != null)) {
1111                 
global::System.Data.DataRow[] updatedRows = dataSet.equipment.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1112                 updatedRows =
this.GetRealUpdatedRows(updatedRows, allAddedRows);
1113                 
if (((updatedRows != null)
1114                             && (
0 < updatedRows.Length))) {
1115                     result = (result +
this._equipmentTableAdapter.Update(updatedRows));
1116                     allChangedRows.AddRange(updatedRows);
1117                 }
1118             }
1119             
return result;
1120         }

1121         
1122         ///
<summary>
1123         ///
Insert rows in top-down order.
1124         ///</summary>

1125         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1126         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1127         
private int UpdateInsertedRows(GymDataSet2 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1128             
int result = 0;
1129             
if ((this._equipmentTableAdapter != null)) {
1130                 
global::System.Data.DataRow[] addedRows = dataSet.equipment.Select(null, null, global::System.Data.DataViewRowState.Added);
1131                 
if (((addedRows != null)
1132                             && (
0 < addedRows.Length))) {
1133                     result = (result +
this._equipmentTableAdapter.Update(addedRows));
1134                     allAddedRows.AddRange(addedRows);
1135                 }
1136             }
1137             
return result;
1138         }

1139         
1140         ///
<summary>
1141         ///
Delete rows in bottom-up order.
1142         ///</summary>

1143         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1144         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1145         
private int UpdateDeletedRows(GymDataSet2 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1146             
int result = 0;
1147             
if ((this._equipmentTableAdapter != null)) {
1148                 
global::System.Data.DataRow[] deletedRows = dataSet.equipment.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1149                 
if (((deletedRows != null)
1150                             && (
0 < deletedRows.Length))) {
1151                     result = (result +
this._equipmentTableAdapter.Update(deletedRows));
1152                     allChangedRows.AddRange(deletedRows);
1153                 }
1154             }
1155             
return result;
1156         }

1157         
1158         ///
<summary>
1159         ///
Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1160         ///</summary>

1161         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1162         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1163         
private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1164             
if (((updatedRows == null)
1165                         || (updatedRows.Length <
1))) {
1166                 
return updatedRows;
1167             }
1168             
if (((allAddedRows == null)
1169                         || (allAddedRows.Count <
1))) {
1170                 
return updatedRows;
1171             }
1172             
global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1173             
for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1174                 
global::System.Data.DataRow row = updatedRows[i];
1175                 
if ((allAddedRows.Contains(row) == false)) {
1176                     realUpdatedRows.Add(row);
1177                 }
1178             }
1179             
return realUpdatedRows.ToArray();
1180         }

1181         
1182         ///
<summary>
1183         ///
Update all changes to the dataset.
1184         ///</summary>

1185         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1186         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1187         
public virtual int UpdateAll(GymDataSet2 dataSet) {
1188             
if ((dataSet == null)) {
1189                 
throw new global::System.ArgumentNullException("dataSet");
1190             }
1191             
if ((dataSet.HasChanges() == false)) {
1192                 
return 0;
1193             }
1194             
if (((this._equipmentTableAdapter != null)
1195                         && (
this.MatchTableAdapterConnection(this._equipmentTableAdapter.Connection) == false))) {
1196                 
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1197                         
"tring.");
1198             }
1199             
global::System.Data.IDbConnection workConnection = this.Connection;
1200             
if ((workConnection == null)) {
1201                 
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1202                         
"ger TableAdapter property to a valid TableAdapter instance.");
1203             }
1204             
bool workConnOpened = false;
1205             
if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1206                         ==
global::System.Data.ConnectionState.Broken)) {
1207                 workConnection.Close();
1208             }
1209             
if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1210                 workConnection.Open();
1211                 workConnOpened =
true;
1212             }
1213             
global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1214             
if ((workTransaction == null)) {
1215                 
throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1216                         
"ctions or the current state is not allowing the transaction to begin.");
1217             }
1218             
global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1219             
global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1220             
global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1221             
global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1222             
int result = 0;
1223             
global::System.Data.DataSet backupDataSet = null;
1224             
if (this.BackupDataSetBeforeUpdate) {
1225                 backupDataSet =
new global::System.Data.DataSet();
1226                 backupDataSet.Merge(dataSet);
1227             }
1228             
try {
1229                 
// ---- Prepare for update -----------
1230                 
//
1231                 
if ((this._equipmentTableAdapter != null)) {
1232                     revertConnections.Add(
this._equipmentTableAdapter, this._equipmentTableAdapter.Connection);
1233                     
this._equipmentTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1234                     
this._equipmentTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1235                     
if (this._equipmentTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1236                         
this._equipmentTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1237                         adaptersWithAcceptChangesDuringUpdate.Add(
this._equipmentTableAdapter.Adapter);
1238                     }
1239                 }
1240                 
//
1241                 
//---- Perform updates -----------
1242                 
//
1243                 
if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1244                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1245                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1246                 }
1247                 
else {
1248                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1249                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1250                 }
1251                 result = (result +
this.UpdateDeletedRows(dataSet, allChangedRows));
1252                 
//
1253                 
//---- Commit updates -----------
1254                 
//
1255                 workTransaction.Commit();
1256                 
if ((0 < allAddedRows.Count)) {
1257                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1258                     allAddedRows.CopyTo(rows);
1259                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1260                         
global::System.Data.DataRow row = rows[i];
1261                         row.AcceptChanges();
1262                     }
1263                 }
1264                 
if ((0 < allChangedRows.Count)) {
1265                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1266                     allChangedRows.CopyTo(rows);
1267                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1268                         
global::System.Data.DataRow row = rows[i];
1269                         row.AcceptChanges();
1270                     }
1271                 }
1272             }
1273             
catch (global::System.Exception ex) {
1274                 workTransaction.Rollback();
1275                 
// ---- Restore the dataset -----------
1276                 
if (this.BackupDataSetBeforeUpdate) {
1277                     
global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1278                     dataSet.Clear();
1279                     dataSet.Merge(backupDataSet);
1280                 }
1281                 
else {
1282                     
if ((0 < allAddedRows.Count)) {
1283                         
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1284                         allAddedRows.CopyTo(rows);
1285                         
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1286                             
global::System.Data.DataRow row = rows[i];
1287                             row.AcceptChanges();
1288                             row.SetAdded();
1289                         }
1290                     }
1291                 }
1292                 
throw ex;
1293             }
1294             
finally {
1295                 
if (workConnOpened) {
1296                     workConnection.Close();
1297                 }
1298                 
if ((this._equipmentTableAdapter != null)) {
1299                     
this._equipmentTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._equipmentTableAdapter]));
1300                     
this._equipmentTableAdapter.Transaction = null;
1301                 }
1302                 
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1303                     
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1304                     adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1305                     
for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1306                         
global::System.Data.Common.DataAdapter adapter = adapters[i];
1307                         adapter.AcceptChangesDuringUpdate =
true;
1308                     }
1309                 }
1310             }
1311             
return result;
1312         }
1313         
1314         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1315         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1316         
protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1317             
global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1318         }
1319         
1320         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1321         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1322         
protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1323             
if ((this._connection != null)) {
1324                 
return true;
1325             }
1326             
if (((this.Connection == null)
1327                         || (inputConnection ==
null))) {
1328                 
return true;
1329             }
1330             
if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1331                 
return true;
1332             }
1333             
return false;
1334         }

1335         
1336         ///
<summary>
1337         ///
Update Order Option
1338         ///</summary>

1339         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1340         
public enum UpdateOrderOption {
1341             
1342             InsertUpdateDelete =
0,
1343             
1344             UpdateInsertDelete =
1,
1345         }

1346         
1347         ///
<summary>
1348         ///
Used to sort self-referenced table's rows
1349         ///</summary>

1350         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1351         
private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1352             
1353             
private global::System.Data.DataRelation _relation;
1354             
1355             
private int _childFirst;
1356             
1357             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1358             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1359             
internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1360                 
this._relation = relation;
1361                 
if (childFirst) {
1362                     
this._childFirst = -1;
1363                 }
1364                 
else {
1365                     
this._childFirst = 1;
1366                 }
1367             }
1368             
1369             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1370             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1371             
private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
1372                 
global::System.Diagnostics.Debug.Assert((row != null));
1373                 
global::System.Data.DataRow root = row;
1374                 distance =
0;
1375
1376                 
global::System.Collections.Generic.IDictionary<global::System.Data.DataRow, global::System.Data.DataRow> traversedRows = new global::System.Collections.Generic.Dictionary<global::System.Data.DataRow, global::System.Data.DataRow>();
1377                 traversedRows[row] = row;
1378
1379                 
global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1380                 
for (
1381                 ; ((parent !=
null)
1382                             && (traversedRows.ContainsKey(parent) ==
false));
1383                 ) {
1384                     distance = (distance +
1);
1385                     root = parent;
1386                     traversedRows[parent] = parent;
1387                     parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Default);
1388                 }
1389
1390                 
if ((distance == 0)) {
1391                     traversedRows.Clear();
1392                     traversedRows[row] = row;
1393                     parent = row.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1394                     
for (
1395                     ; ((parent !=
null)
1396                                 && (traversedRows.ContainsKey(parent) ==
false));
1397                     ) {
1398                         distance = (distance +
1);
1399                         root = parent;
1400                         traversedRows[parent] = parent;
1401                         parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1402                     }
1403                 }
1404
1405                 
return root;
1406             }
1407             
1408             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1409             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1410             
public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1411                 
if (object.ReferenceEquals(row1, row2)) {
1412                     
return 0;
1413                 }
1414                 
if ((row1 == null)) {
1415                     
return -1;
1416                 }
1417                 
if ((row2 == null)) {
1418                     
return 1;
1419                 }
1420
1421                 
int distance1 = 0;
1422                 
global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
1423
1424                 
int distance2 = 0;
1425                 
global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
1426
1427                 
if (object.ReferenceEquals(root1, root2)) {
1428                     
return (this._childFirst * distance1.CompareTo(distance2));
1429                 }
1430                 
else {
1431                     
global::System.Diagnostics.Debug.Assert(((root1.Table != null)
1432                                     && (root2.Table !=
null)));
1433                     
if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
1434                         
return -1;
1435                     }
1436                     
else {
1437                         
return 1;
1438                     }
1439                 }
1440             }
1441         }
1442     }
1443 }
1444
1445 #pragma warning restore
1591


Gõ tìm kiếm nhanh...