Quản lý điểm khoa công nghệ thông tin C#
- CNPM_1DataSet11.Designer.cs
- QuanLyDiem /
- QuanLyDiem /
- project /
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated by a tool.
4 // Runtime Version:2.0.50727.4927
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 QuanLyDiem {
14
15
16 /// <summary>
17 ///Represents a strongly typed in-memory cache of data.
18 ///</summary>
19 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
20 [global::System.Serializable()]
21 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
22 [global::System.ComponentModel.ToolboxItem(true)]
23 [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
24 [global::System.Xml.Serialization.XmlRootAttribute("CNPM_1DataSet11")]
25 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
26 public partial class CNPM_1DataSet11 : global::System.Data.DataSet {
27
28 private GiangVienDataTable tableGiangVien;
29
30 private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
31
32 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
33 public CNPM_1DataSet11() {
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 protected CNPM_1DataSet11(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
44 base(info, context, false) {
45 if ((this.IsBinarySerialized(info, context) == true)) {
46 this.InitVars(false);
47 global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
48 this.Tables.CollectionChanged += schemaChangedHandler1;
49 this.Relations.CollectionChanged += schemaChangedHandler1;
50 return;
51 }
52 string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
53 if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
54 global::System.Data.DataSet ds = new global::System.Data.DataSet();
55 ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
56 if ((ds.Tables["GiangVien"] != null)) {
57 base.Tables.Add(new GiangVienDataTable(ds.Tables["GiangVien"]));
58 }
59 this.DataSetName = ds.DataSetName;
60 this.Prefix = ds.Prefix;
61 this.Namespace = ds.Namespace;
62 this.Locale = ds.Locale;
63 this.CaseSensitive = ds.CaseSensitive;
64 this.EnforceConstraints = ds.EnforceConstraints;
65 this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
66 this.InitVars();
67 }
68 else {
69 this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
70 }
71 this.GetSerializationData(info, context);
72 global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
73 base.Tables.CollectionChanged += schemaChangedHandler;
74 this.Relations.CollectionChanged += schemaChangedHandler;
75 }
76
77 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
78 [global::System.ComponentModel.Browsable(false)]
79 [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
80 public GiangVienDataTable GiangVien {
81 get {
82 return this.tableGiangVien;
83 }
84 }
85
86 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
87 [global::System.ComponentModel.BrowsableAttribute(true)]
88 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
89 public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
90 get {
91 return this._schemaSerializationMode;
92 }
93 set {
94 this._schemaSerializationMode = value;
95 }
96 }
97
98 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
99 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
100 public new global::System.Data.DataTableCollection Tables {
101 get {
102 return base.Tables;
103 }
104 }
105
106 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
107 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
108 public new global::System.Data.DataRelationCollection Relations {
109 get {
110 return base.Relations;
111 }
112 }
113
114 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
115 protected override void InitializeDerivedDataSet() {
116 this.BeginInit();
117 this.InitClass();
118 this.EndInit();
119 }
120
121 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
122 public override global::System.Data.DataSet Clone() {
123 CNPM_1DataSet11 cln = ((CNPM_1DataSet11)(base.Clone()));
124 cln.InitVars();
125 cln.SchemaSerializationMode = this.SchemaSerializationMode;
126 return cln;
127 }
128
129 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
130 protected override bool ShouldSerializeTables() {
131 return false;
132 }
133
134 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
135 protected override bool ShouldSerializeRelations() {
136 return false;
137 }
138
139 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
140 protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
141 if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
142 this.Reset();
143 global::System.Data.DataSet ds = new global::System.Data.DataSet();
144 ds.ReadXml(reader);
145 if ((ds.Tables["GiangVien"] != null)) {
146 base.Tables.Add(new GiangVienDataTable(ds.Tables["GiangVien"]));
147 }
148 this.DataSetName = ds.DataSetName;
149 this.Prefix = ds.Prefix;
150 this.Namespace = ds.Namespace;
151 this.Locale = ds.Locale;
152 this.CaseSensitive = ds.CaseSensitive;
153 this.EnforceConstraints = ds.EnforceConstraints;
154 this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
155 this.InitVars();
156 }
157 else {
158 this.ReadXml(reader);
159 this.InitVars();
160 }
161 }
162
163 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
164 protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
165 global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
166 this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
167 stream.Position = 0;
168 return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
169 }
170
171 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 internal void InitVars() {
173 this.InitVars(true);
174 }
175
176 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
177 internal void InitVars(bool initTable) {
178 this.tableGiangVien = ((GiangVienDataTable)(base.Tables["GiangVien"]));
179 if ((initTable == true)) {
180 if ((this.tableGiangVien != null)) {
181 this.tableGiangVien.InitVars();
182 }
183 }
184 }
185
186 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
187 private void InitClass() {
188 this.DataSetName = "CNPM_1DataSet11";
189 this.Prefix = "";
190 this.Namespace = "http://tempuri.org/CNPM_1DataSet11.xsd";
191 this.EnforceConstraints = true;
192 this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
193 this.tableGiangVien = new GiangVienDataTable();
194 base.Tables.Add(this.tableGiangVien);
195 }
196
197 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
198 private bool ShouldSerializeGiangVien() {
199 return false;
200 }
201
202 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
203 private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
204 if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
205 this.InitVars();
206 }
207 }
208
209 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
210 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
211 CNPM_1DataSet11 ds = new CNPM_1DataSet11();
212 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
213 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
214 global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
215 any.Namespace = ds.Namespace;
216 sequence.Items.Add(any);
217 type.Particle = sequence;
218 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
219 if (xs.Contains(dsSchema.TargetNamespace)) {
220 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
221 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
222 try {
223 global::System.Xml.Schema.XmlSchema schema = null;
224 dsSchema.Write(s1);
225 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
226 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
227 s2.SetLength(0);
228 schema.Write(s2);
229 if ((s1.Length == s2.Length)) {
230 s1.Position = 0;
231 s2.Position = 0;
232 for (; ((s1.Position != s1.Length)
233 && (s1.ReadByte() == s2.ReadByte())); ) {
234 ;
235 }
236 if ((s1.Position == s1.Length)) {
237 return type;
238 }
239 }
240 }
241 }
242 finally {
243 if ((s1 != null)) {
244 s1.Close();
245 }
246 if ((s2 != null)) {
247 s2.Close();
248 }
249 }
250 }
251 xs.Add(dsSchema);
252 return type;
253 }
254
255 public delegate void GiangVienRowChangeEventHandler(object sender, GiangVienRowChangeEvent e);
256
257 /// <summary>
258 ///Represents the strongly named DataTable class.
259 ///</summary>
260 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
261 [global::System.Serializable()]
262 [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
263 public partial class GiangVienDataTable : global::System.Data.TypedTableBase<GiangVienRow> {
264
265 private global::System.Data.DataColumn columnMaGV;
266
267 private global::System.Data.DataColumn columnTenGV;
268
269 private global::System.Data.DataColumn columnNgaySinh;
270
271 private global::System.Data.DataColumn columnDiaChi;
272
273 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
274 public GiangVienDataTable() {
275 this.TableName = "GiangVien";
276 this.BeginInit();
277 this.InitClass();
278 this.EndInit();
279 }
280
281 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
282 internal GiangVienDataTable(global::System.Data.DataTable table) {
283 this.TableName = table.TableName;
284 if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
285 this.CaseSensitive = table.CaseSensitive;
286 }
287 if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
288 this.Locale = table.Locale;
289 }
290 if ((table.Namespace != table.DataSet.Namespace)) {
291 this.Namespace = table.Namespace;
292 }
293 this.Prefix = table.Prefix;
294 this.MinimumCapacity = table.MinimumCapacity;
295 }
296
297 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
298 protected GiangVienDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
299 base(info, context) {
300 this.InitVars();
301 }
302
303 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
304 public global::System.Data.DataColumn MaGVColumn {
305 get {
306 return this.columnMaGV;
307 }
308 }
309
310 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
311 public global::System.Data.DataColumn TenGVColumn {
312 get {
313 return this.columnTenGV;
314 }
315 }
316
317 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
318 public global::System.Data.DataColumn NgaySinhColumn {
319 get {
320 return this.columnNgaySinh;
321 }
322 }
323
324 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
325 public global::System.Data.DataColumn DiaChiColumn {
326 get {
327 return this.columnDiaChi;
328 }
329 }
330
331 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
332 [global::System.ComponentModel.Browsable(false)]
333 public int Count {
334 get {
335 return this.Rows.Count;
336 }
337 }
338
339 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
340 public GiangVienRow this[int index] {
341 get {
342 return ((GiangVienRow)(this.Rows[index]));
343 }
344 }
345
346 public event GiangVienRowChangeEventHandler GiangVienRowChanging;
347
348 public event GiangVienRowChangeEventHandler GiangVienRowChanged;
349
350 public event GiangVienRowChangeEventHandler GiangVienRowDeleting;
351
352 public event GiangVienRowChangeEventHandler GiangVienRowDeleted;
353
354 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
355 public void AddGiangVienRow(GiangVienRow row) {
356 this.Rows.Add(row);
357 }
358
359 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
360 public GiangVienRow AddGiangVienRow(string MaGV, string TenGV, string NgaySinh, string DiaChi) {
361 GiangVienRow rowGiangVienRow = ((GiangVienRow)(this.NewRow()));
362 object[] columnValuesArray = new object[] {
363 MaGV,
364 TenGV,
365 NgaySinh,
366 DiaChi};
367 rowGiangVienRow.ItemArray = columnValuesArray;
368 this.Rows.Add(rowGiangVienRow);
369 return rowGiangVienRow;
370 }
371
372 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
373 public GiangVienRow FindByMaGV(string MaGV) {
374 return ((GiangVienRow)(this.Rows.Find(new object[] {
375 MaGV})));
376 }
377
378 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
379 public override global::System.Data.DataTable Clone() {
380 GiangVienDataTable cln = ((GiangVienDataTable)(base.Clone()));
381 cln.InitVars();
382 return cln;
383 }
384
385 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
386 protected override global::System.Data.DataTable CreateInstance() {
387 return new GiangVienDataTable();
388 }
389
390 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
391 internal void InitVars() {
392 this.columnMaGV = base.Columns["MaGV"];
393 this.columnTenGV = base.Columns["TenGV"];
394 this.columnNgaySinh = base.Columns["NgaySinh"];
395 this.columnDiaChi = base.Columns["DiaChi"];
396 }
397
398 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
399 private void InitClass() {
400 this.columnMaGV = new global::System.Data.DataColumn("MaGV", typeof(string), null, global::System.Data.MappingType.Element);
401 base.Columns.Add(this.columnMaGV);
402 this.columnTenGV = new global::System.Data.DataColumn("TenGV", typeof(string), null, global::System.Data.MappingType.Element);
403 base.Columns.Add(this.columnTenGV);
404 this.columnNgaySinh = new global::System.Data.DataColumn("NgaySinh", typeof(string), null, global::System.Data.MappingType.Element);
405 base.Columns.Add(this.columnNgaySinh);
406 this.columnDiaChi = new global::System.Data.DataColumn("DiaChi", typeof(string), null, global::System.Data.MappingType.Element);
407 base.Columns.Add(this.columnDiaChi);
408 this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
409 this.columnMaGV}, true));
410 this.columnMaGV.AllowDBNull = false;
411 this.columnMaGV.Unique = true;
412 this.columnMaGV.MaxLength = 10;
413 this.columnTenGV.MaxLength = 30;
414 this.columnNgaySinh.MaxLength = 10;
415 this.columnDiaChi.MaxLength = 50;
416 }
417
418 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
419 public GiangVienRow NewGiangVienRow() {
420 return ((GiangVienRow)(this.NewRow()));
421 }
422
423 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
424 protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
425 return new GiangVienRow(builder);
426 }
427
428 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
429 protected override global::System.Type GetRowType() {
430 return typeof(GiangVienRow);
431 }
432
433 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
434 protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
435 base.OnRowChanged(e);
436 if ((this.GiangVienRowChanged != null)) {
437 this.GiangVienRowChanged(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
438 }
439 }
440
441 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
442 protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
443 base.OnRowChanging(e);
444 if ((this.GiangVienRowChanging != null)) {
445 this.GiangVienRowChanging(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
446 }
447 }
448
449 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
450 protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
451 base.OnRowDeleted(e);
452 if ((this.GiangVienRowDeleted != null)) {
453 this.GiangVienRowDeleted(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
454 }
455 }
456
457 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
458 protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
459 base.OnRowDeleting(e);
460 if ((this.GiangVienRowDeleting != null)) {
461 this.GiangVienRowDeleting(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
462 }
463 }
464
465 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
466 public void RemoveGiangVienRow(GiangVienRow row) {
467 this.Rows.Remove(row);
468 }
469
470 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
471 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
472 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
473 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
474 CNPM_1DataSet11 ds = new CNPM_1DataSet11();
475 global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
476 any1.Namespace = "http://www.w3.org/2001/XMLSchema";
477 any1.MinOccurs = new decimal(0);
478 any1.MaxOccurs = decimal.MaxValue;
479 any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
480 sequence.Items.Add(any1);
481 global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
482 any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
483 any2.MinOccurs = new decimal(1);
484 any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
485 sequence.Items.Add(any2);
486 global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
487 attribute1.Name = "namespace";
488 attribute1.FixedValue = ds.Namespace;
489 type.Attributes.Add(attribute1);
490 global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
491 attribute2.Name = "tableTypeName";
492 attribute2.FixedValue = "GiangVienDataTable";
493 type.Attributes.Add(attribute2);
494 type.Particle = sequence;
495 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
496 if (xs.Contains(dsSchema.TargetNamespace)) {
497 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
498 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
499 try {
500 global::System.Xml.Schema.XmlSchema schema = null;
501 dsSchema.Write(s1);
502 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
503 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
504 s2.SetLength(0);
505 schema.Write(s2);
506 if ((s1.Length == s2.Length)) {
507 s1.Position = 0;
508 s2.Position = 0;
509 for (; ((s1.Position != s1.Length)
510 && (s1.ReadByte() == s2.ReadByte())); ) {
511 ;
512 }
513 if ((s1.Position == s1.Length)) {
514 return type;
515 }
516 }
517 }
518 }
519 finally {
520 if ((s1 != null)) {
521 s1.Close();
522 }
523 if ((s2 != null)) {
524 s2.Close();
525 }
526 }
527 }
528 xs.Add(dsSchema);
529 return type;
530 }
531 }
532
533 /// <summary>
534 ///Represents strongly named DataRow class.
535 ///</summary>
536 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
537 public partial class GiangVienRow : global::System.Data.DataRow {
538
539 private GiangVienDataTable tableGiangVien;
540
541 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
542 internal GiangVienRow(global::System.Data.DataRowBuilder rb) :
543 base(rb) {
544 this.tableGiangVien = ((GiangVienDataTable)(this.Table));
545 }
546
547 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
548 public string MaGV {
549 get {
550 return ((string)(this[this.tableGiangVien.MaGVColumn]));
551 }
552 set {
553 this[this.tableGiangVien.MaGVColumn] = value;
554 }
555 }
556
557 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
558 public string TenGV {
559 get {
560 try {
561 return ((string)(this[this.tableGiangVien.TenGVColumn]));
562 }
563 catch (global::System.InvalidCastException e) {
564 throw new global::System.Data.StrongTypingException("The value for column \'TenGV\' in table \'GiangVien\' is DBNull.", e);
565 }
566 }
567 set {
568 this[this.tableGiangVien.TenGVColumn] = value;
569 }
570 }
571
572 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
573 public string NgaySinh {
574 get {
575 try {
576 return ((string)(this[this.tableGiangVien.NgaySinhColumn]));
577 }
578 catch (global::System.InvalidCastException e) {
579 throw new global::System.Data.StrongTypingException("The value for column \'NgaySinh\' in table \'GiangVien\' is DBNull.", e);
580 }
581 }
582 set {
583 this[this.tableGiangVien.NgaySinhColumn] = value;
584 }
585 }
586
587 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
588 public string DiaChi {
589 get {
590 try {
591 return ((string)(this[this.tableGiangVien.DiaChiColumn]));
592 }
593 catch (global::System.InvalidCastException e) {
594 throw new global::System.Data.StrongTypingException("The value for column \'DiaChi\' in table \'GiangVien\' is DBNull.", e);
595 }
596 }
597 set {
598 this[this.tableGiangVien.DiaChiColumn] = value;
599 }
600 }
601
602 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
603 public bool IsTenGVNull() {
604 return this.IsNull(this.tableGiangVien.TenGVColumn);
605 }
606
607 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
608 public void SetTenGVNull() {
609 this[this.tableGiangVien.TenGVColumn] = global::System.Convert.DBNull;
610 }
611
612 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
613 public bool IsNgaySinhNull() {
614 return this.IsNull(this.tableGiangVien.NgaySinhColumn);
615 }
616
617 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
618 public void SetNgaySinhNull() {
619 this[this.tableGiangVien.NgaySinhColumn] = global::System.Convert.DBNull;
620 }
621
622 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
623 public bool IsDiaChiNull() {
624 return this.IsNull(this.tableGiangVien.DiaChiColumn);
625 }
626
627 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
628 public void SetDiaChiNull() {
629 this[this.tableGiangVien.DiaChiColumn] = global::System.Convert.DBNull;
630 }
631 }
632
633 /// <summary>
634 ///Row event argument class
635 ///</summary>
636 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
637 public class GiangVienRowChangeEvent : global::System.EventArgs {
638
639 private GiangVienRow eventRow;
640
641 private global::System.Data.DataRowAction eventAction;
642
643 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
644 public GiangVienRowChangeEvent(GiangVienRow row, global::System.Data.DataRowAction action) {
645 this.eventRow = row;
646 this.eventAction = action;
647 }
648
649 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
650 public GiangVienRow Row {
651 get {
652 return this.eventRow;
653 }
654 }
655
656 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
657 public global::System.Data.DataRowAction Action {
658 get {
659 return this.eventAction;
660 }
661 }
662 }
663 }
664 }
665 namespace QuanLyDiem.CNPM_1DataSet11TableAdapters {
666
667
668 /// <summary>
669 ///Represents the connection and commands used to retrieve and save data.
670 ///</summary>
671 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
672 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
673 [global::System.ComponentModel.ToolboxItem(true)]
674 [global::System.ComponentModel.DataObjectAttribute(true)]
675 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
676 ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
677 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
678 public partial class GiangVienTableAdapter : global::System.ComponentModel.Component {
679
680 private global::System.Data.SqlClient.SqlDataAdapter _adapter;
681
682 private global::System.Data.SqlClient.SqlConnection _connection;
683
684 private global::System.Data.SqlClient.SqlTransaction _transaction;
685
686 private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
687
688 private bool _clearBeforeFill;
689
690 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
691 public GiangVienTableAdapter() {
692 this.ClearBeforeFill = true;
693 }
694
695 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
696 protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
697 get {
698 if ((this._adapter == null)) {
699 this.InitAdapter();
700 }
701 return this._adapter;
702 }
703 }
704
705 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
706 internal global::System.Data.SqlClient.SqlConnection Connection {
707 get {
708 if ((this._connection == null)) {
709 this.InitConnection();
710 }
711 return this._connection;
712 }
713 set {
714 this._connection = value;
715 if ((this.Adapter.InsertCommand != null)) {
716 this.Adapter.InsertCommand.Connection = value;
717 }
718 if ((this.Adapter.DeleteCommand != null)) {
719 this.Adapter.DeleteCommand.Connection = value;
720 }
721 if ((this.Adapter.UpdateCommand != null)) {
722 this.Adapter.UpdateCommand.Connection = value;
723 }
724 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
725 if ((this.CommandCollection[i] != null)) {
726 ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
727 }
728 }
729 }
730 }
731
732 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
733 internal global::System.Data.SqlClient.SqlTransaction Transaction {
734 get {
735 return this._transaction;
736 }
737 set {
738 this._transaction = value;
739 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
740 this.CommandCollection[i].Transaction = this._transaction;
741 }
742 if (((this.Adapter != null)
743 && (this.Adapter.DeleteCommand != null))) {
744 this.Adapter.DeleteCommand.Transaction = this._transaction;
745 }
746 if (((this.Adapter != null)
747 && (this.Adapter.InsertCommand != null))) {
748 this.Adapter.InsertCommand.Transaction = this._transaction;
749 }
750 if (((this.Adapter != null)
751 && (this.Adapter.UpdateCommand != null))) {
752 this.Adapter.UpdateCommand.Transaction = this._transaction;
753 }
754 }
755 }
756
757 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
758 protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
759 get {
760 if ((this._commandCollection == null)) {
761 this.InitCommandCollection();
762 }
763 return this._commandCollection;
764 }
765 }
766
767 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
768 public bool ClearBeforeFill {
769 get {
770 return this._clearBeforeFill;
771 }
772 set {
773 this._clearBeforeFill = value;
774 }
775 }
776
777 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
778 private void InitAdapter() {
779 this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
780 global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
781 tableMapping.SourceTable = "Table";
782 tableMapping.DataSetTable = "GiangVien";
783 tableMapping.ColumnMappings.Add("MaGV", "MaGV");
784 tableMapping.ColumnMappings.Add("TenGV", "TenGV");
785 tableMapping.ColumnMappings.Add("NgaySinh", "NgaySinh");
786 tableMapping.ColumnMappings.Add("DiaChi", "DiaChi");
787 this._adapter.TableMappings.Add(tableMapping);
788 this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
789 this._adapter.DeleteCommand.Connection = this.Connection;
790 this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[GiangVien] WHERE (([MaGV] = @Original_MaGV) AND ((@IsNull_TenGV = 1 AND [TenGV] IS NULL) OR ([TenGV] = @Original_TenGV)) AND ((@IsNull_NgaySinh = 1 AND [NgaySinh] IS NULL) OR ([NgaySinh] = @Original_NgaySinh)) AND ((@IsNull_DiaChi = 1 AND [DiaChi] IS NULL) OR ([DiaChi] = @Original_DiaChi)))";
791 this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
792 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
793 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
794 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
795 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_NgaySinh", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
796 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
797 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DiaChi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
798 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
799 this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
800 this._adapter.InsertCommand.Connection = this.Connection;
801 this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[GiangVien] ([MaGV], [TenGV], [NgaySinh], [DiaChi]) VALUES (@Ma" +
802 "GV, @TenGV, @NgaySinh, @DiaChi);\r\nSELECT MaGV, TenGV, NgaySinh, DiaChi FROM Gian" +
803 "gVien WHERE (MaGV = @MaGV)";
804 this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
805 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
806 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
807 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
808 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
809 this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
810 this._adapter.UpdateCommand.Connection = this.Connection;
811 this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[GiangVien] SET [MaGV] = @MaGV, [TenGV] = @TenGV, [NgaySinh] = @NgaySinh, [DiaChi] = @DiaChi WHERE (([MaGV] = @Original_MaGV) AND ((@IsNull_TenGV = 1 AND [TenGV] IS NULL) OR ([TenGV] = @Original_TenGV)) AND ((@IsNull_NgaySinh = 1 AND [NgaySinh] IS NULL) OR ([NgaySinh] = @Original_NgaySinh)) AND ((@IsNull_DiaChi = 1 AND [DiaChi] IS NULL) OR ([DiaChi] = @Original_DiaChi)));
812 SELECT MaGV, TenGV, NgaySinh, DiaChi FROM GiangVien WHERE (MaGV = @MaGV)";
813 this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
814 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
815 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
816 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
817 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
818 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
819 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
820 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
821 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_NgaySinh", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
822 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
823 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DiaChi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
824 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
825 }
826
827 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
828 private void InitConnection() {
829 this._connection = new global::System.Data.SqlClient.SqlConnection();
830 this._connection.ConnectionString = global::QuanLyDiem.Properties.Settings.Default.CNPM_1ConnectionString;
831 }
832
833 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
834 private void InitCommandCollection() {
835 this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
836 this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
837 this._commandCollection[0].Connection = this.Connection;
838 this._commandCollection[0].CommandText = "SELECT MaGV, TenGV, NgaySinh, DiaChi FROM dbo.GiangVien";
839 this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
840 }
841
842 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
843 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
844 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
845 public virtual int Fill(CNPM_1DataSet11.GiangVienDataTable dataTable) {
846 this.Adapter.SelectCommand = this.CommandCollection[0];
847 if ((this.ClearBeforeFill == true)) {
848 dataTable.Clear();
849 }
850 int returnValue = this.Adapter.Fill(dataTable);
851 return returnValue;
852 }
853
854 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
855 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
856 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
857 public virtual CNPM_1DataSet11.GiangVienDataTable GetData() {
858 this.Adapter.SelectCommand = this.CommandCollection[0];
859 CNPM_1DataSet11.GiangVienDataTable dataTable = new CNPM_1DataSet11.GiangVienDataTable();
860 this.Adapter.Fill(dataTable);
861 return dataTable;
862 }
863
864 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
865 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
866 public virtual int Update(CNPM_1DataSet11.GiangVienDataTable dataTable) {
867 return this.Adapter.Update(dataTable);
868 }
869
870 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
871 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
872 public virtual int Update(CNPM_1DataSet11 dataSet) {
873 return this.Adapter.Update(dataSet, "GiangVien");
874 }
875
876 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
877 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
878 public virtual int Update(global::System.Data.DataRow dataRow) {
879 return this.Adapter.Update(new global::System.Data.DataRow[] {
880 dataRow});
881 }
882
883 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
884 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
885 public virtual int Update(global::System.Data.DataRow[] dataRows) {
886 return this.Adapter.Update(dataRows);
887 }
888
889 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
890 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
891 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
892 public virtual int Delete(string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
893 if ((Original_MaGV == null)) {
894 throw new global::System.ArgumentNullException("Original_MaGV");
895 }
896 else {
897 this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_MaGV));
898 }
899 if ((Original_TenGV == null)) {
900 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
901 this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
902 }
903 else {
904 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
905 this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_TenGV));
906 }
907 if ((Original_NgaySinh == null)) {
908 this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
909 this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
910 }
911 else {
912 this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
913 this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_NgaySinh));
914 }
915 if ((Original_DiaChi == null)) {
916 this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
917 this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
918 }
919 else {
920 this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
921 this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_DiaChi));
922 }
923 global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
924 if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
925 != global::System.Data.ConnectionState.Open)) {
926 this.Adapter.DeleteCommand.Connection.Open();
927 }
928 try {
929 int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
930 return returnValue;
931 }
932 finally {
933 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
934 this.Adapter.DeleteCommand.Connection.Close();
935 }
936 }
937 }
938
939 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
940 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
941 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
942 public virtual int Insert(string MaGV, string TenGV, string NgaySinh, string DiaChi) {
943 if ((MaGV == null)) {
944 throw new global::System.ArgumentNullException("MaGV");
945 }
946 else {
947 this.Adapter.InsertCommand.Parameters[0].Value = ((string)(MaGV));
948 }
949 if ((TenGV == null)) {
950 this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
951 }
952 else {
953 this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TenGV));
954 }
955 if ((NgaySinh == null)) {
956 this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
957 }
958 else {
959 this.Adapter.InsertCommand.Parameters[2].Value = ((string)(NgaySinh));
960 }
961 if ((DiaChi == null)) {
962 this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
963 }
964 else {
965 this.Adapter.InsertCommand.Parameters[3].Value = ((string)(DiaChi));
966 }
967 global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
968 if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
969 != global::System.Data.ConnectionState.Open)) {
970 this.Adapter.InsertCommand.Connection.Open();
971 }
972 try {
973 int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
974 return returnValue;
975 }
976 finally {
977 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
978 this.Adapter.InsertCommand.Connection.Close();
979 }
980 }
981 }
982
983 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
984 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
985 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
986 public virtual int Update(string MaGV, string TenGV, string NgaySinh, string DiaChi, string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
987 if ((MaGV == null)) {
988 throw new global::System.ArgumentNullException("MaGV");
989 }
990 else {
991 this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(MaGV));
992 }
993 if ((TenGV == null)) {
994 this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
995 }
996 else {
997 this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TenGV));
998 }
999 if ((NgaySinh == null)) {
1000 this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
1001 }
1002 else {
1003 this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(NgaySinh));
1004 }
1005 if ((DiaChi == null)) {
1006 this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
1007 }
1008 else {
1009 this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(DiaChi));
1010 }
1011 if ((Original_MaGV == null)) {
1012 throw new global::System.ArgumentNullException("Original_MaGV");
1013 }
1014 else {
1015 this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_MaGV));
1016 }
1017 if ((Original_TenGV == null)) {
1018 this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(1));
1019 this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value;
1020 }
1021 else {
1022 this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(0));
1023 this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_TenGV));
1024 }
1025 if ((Original_NgaySinh == null)) {
1026 this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
1027 this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
1028 }
1029 else {
1030 this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
1031 this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_NgaySinh));
1032 }
1033 if ((Original_DiaChi == null)) {
1034 this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1));
1035 this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
1036 }
1037 else {
1038 this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0));
1039 this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_DiaChi));
1040 }
1041 global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
1042 if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
1043 != global::System.Data.ConnectionState.Open)) {
1044 this.Adapter.UpdateCommand.Connection.Open();
1045 }
1046 try {
1047 int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
1048 return returnValue;
1049 }
1050 finally {
1051 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1052 this.Adapter.UpdateCommand.Connection.Close();
1053 }
1054 }
1055 }
1056
1057 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1058 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1059 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1060 public virtual int Update(string TenGV, string NgaySinh, string DiaChi, string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
1061 return this.Update(Original_MaGV, TenGV, NgaySinh, DiaChi, Original_MaGV, Original_TenGV, Original_NgaySinh, Original_DiaChi);
1062 }
1063 }
1064
1065 /// <summary>
1066 ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1067 ///</summary>
1068 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1069 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
1070 [global::System.ComponentModel.ToolboxItem(true)]
1071 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1072 "esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1073 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1074 public partial class TableAdapterManager : global::System.ComponentModel.Component {
1075
1076 private UpdateOrderOption _updateOrder;
1077
1078 private GiangVienTableAdapter _giangVienTableAdapter;
1079
1080 private bool _backupDataSetBeforeUpdate;
1081
1082 private global::System.Data.IDbConnection _connection;
1083
1084 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1085 public UpdateOrderOption UpdateOrder {
1086 get {
1087 return this._updateOrder;
1088 }
1089 set {
1090 this._updateOrder = value;
1091 }
1092 }
1093
1094 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1095 [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1096 "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
1097 "", "System.Drawing.Design.UITypeEditor")]
1098 public GiangVienTableAdapter GiangVienTableAdapter {
1099 get {
1100 return this._giangVienTableAdapter;
1101 }
1102 set {
1103 this._giangVienTableAdapter = value;
1104 }
1105 }
1106
1107 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1108 public bool BackupDataSetBeforeUpdate {
1109 get {
1110 return this._backupDataSetBeforeUpdate;
1111 }
1112 set {
1113 this._backupDataSetBeforeUpdate = value;
1114 }
1115 }
1116
1117 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1118 [global::System.ComponentModel.Browsable(false)]
1119 public global::System.Data.IDbConnection Connection {
1120 get {
1121 if ((this._connection != null)) {
1122 return this._connection;
1123 }
1124 if (((this._giangVienTableAdapter != null)
1125 && (this._giangVienTableAdapter.Connection != null))) {
1126 return this._giangVienTableAdapter.Connection;
1127 }
1128 return null;
1129 }
1130 set {
1131 this._connection = value;
1132 }
1133 }
1134
1135 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1136 [global::System.ComponentModel.Browsable(false)]
1137 public int TableAdapterInstanceCount {
1138 get {
1139 int count = 0;
1140 if ((this._giangVienTableAdapter != null)) {
1141 count = (count + 1);
1142 }
1143 return count;
1144 }
1145 }
1146
1147 /// <summary>
1148 ///Update rows in top-down order.
1149 ///</summary>
1150 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1151 private int UpdateUpdatedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1152 int result = 0;
1153 if ((this._giangVienTableAdapter != null)) {
1154 global::System.Data.DataRow[] updatedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1155 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
1156 if (((updatedRows != null)
1157 && (0 < updatedRows.Length))) {
1158 result = (result + this._giangVienTableAdapter.Update(updatedRows));
1159 allChangedRows.AddRange(updatedRows);
1160 }
1161 }
1162 return result;
1163 }
1164
1165 /// <summary>
1166 ///Insert rows in top-down order.
1167 ///</summary>
1168 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1169 private int UpdateInsertedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1170 int result = 0;
1171 if ((this._giangVienTableAdapter != null)) {
1172 global::System.Data.DataRow[] addedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.Added);
1173 if (((addedRows != null)
1174 && (0 < addedRows.Length))) {
1175 result = (result + this._giangVienTableAdapter.Update(addedRows));
1176 allAddedRows.AddRange(addedRows);
1177 }
1178 }
1179 return result;
1180 }
1181
1182 /// <summary>
1183 ///Delete rows in bottom-up order.
1184 ///</summary>
1185 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1186 private int UpdateDeletedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1187 int result = 0;
1188 if ((this._giangVienTableAdapter != null)) {
1189 global::System.Data.DataRow[] deletedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1190 if (((deletedRows != null)
1191 && (0 < deletedRows.Length))) {
1192 result = (result + this._giangVienTableAdapter.Update(deletedRows));
1193 allChangedRows.AddRange(deletedRows);
1194 }
1195 }
1196 return result;
1197 }
1198
1199 /// <summary>
1200 ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1201 ///</summary>
1202 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1203 private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1204 if (((updatedRows == null)
1205 || (updatedRows.Length < 1))) {
1206 return updatedRows;
1207 }
1208 if (((allAddedRows == null)
1209 || (allAddedRows.Count < 1))) {
1210 return updatedRows;
1211 }
1212 global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1213 for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1214 global::System.Data.DataRow row = updatedRows[i];
1215 if ((allAddedRows.Contains(row) == false)) {
1216 realUpdatedRows.Add(row);
1217 }
1218 }
1219 return realUpdatedRows.ToArray();
1220 }
1221
1222 /// <summary>
1223 ///Update all changes to the dataset.
1224 ///</summary>
1225 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1226 public virtual int UpdateAll(CNPM_1DataSet11 dataSet) {
1227 if ((dataSet == null)) {
1228 throw new global::System.ArgumentNullException("dataSet");
1229 }
1230 if ((dataSet.HasChanges() == false)) {
1231 return 0;
1232 }
1233 if (((this._giangVienTableAdapter != null)
1234 && (this.MatchTableAdapterConnection(this._giangVienTableAdapter.Connection) == false))) {
1235 throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1236 "tring.");
1237 }
1238 global::System.Data.IDbConnection workConnection = this.Connection;
1239 if ((workConnection == null)) {
1240 throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1241 "ger TableAdapter property to a valid TableAdapter instance.");
1242 }
1243 bool workConnOpened = false;
1244 if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1245 == global::System.Data.ConnectionState.Broken)) {
1246 workConnection.Close();
1247 }
1248 if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1249 workConnection.Open();
1250 workConnOpened = true;
1251 }
1252 global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1253 if ((workTransaction == null)) {
1254 throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1255 "ctions or the current state is not allowing the transaction to begin.");
1256 }
1257 global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1258 global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1259 global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1260 global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1261 int result = 0;
1262 global::System.Data.DataSet backupDataSet = null;
1263 if (this.BackupDataSetBeforeUpdate) {
1264 backupDataSet = new global::System.Data.DataSet();
1265 backupDataSet.Merge(dataSet);
1266 }
1267 try {
1268 // ---- Prepare for update -----------
1269 //
1270 if ((this._giangVienTableAdapter != null)) {
1271 revertConnections.Add(this._giangVienTableAdapter, this._giangVienTableAdapter.Connection);
1272 this._giangVienTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1273 this._giangVienTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1274 if (this._giangVienTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1275 this._giangVienTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1276 adaptersWithAcceptChangesDuringUpdate.Add(this._giangVienTableAdapter.Adapter);
1277 }
1278 }
1279 //
1280 //---- Perform updates -----------
1281 //
1282 if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1283 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1284 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1285 }
1286 else {
1287 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1288 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1289 }
1290 result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
1291 //
1292 //---- Commit updates -----------
1293 //
1294 workTransaction.Commit();
1295 if ((0 < allAddedRows.Count)) {
1296 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1297 allAddedRows.CopyTo(rows);
1298 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1299 global::System.Data.DataRow row = rows[i];
1300 row.AcceptChanges();
1301 }
1302 }
1303 if ((0 < allChangedRows.Count)) {
1304 global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1305 allChangedRows.CopyTo(rows);
1306 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1307 global::System.Data.DataRow row = rows[i];
1308 row.AcceptChanges();
1309 }
1310 }
1311 }
1312 catch (global::System.Exception ex) {
1313 workTransaction.Rollback();
1314 // ---- Restore the dataset -----------
1315 if (this.BackupDataSetBeforeUpdate) {
1316 global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1317 dataSet.Clear();
1318 dataSet.Merge(backupDataSet);
1319 }
1320 else {
1321 if ((0 < allAddedRows.Count)) {
1322 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1323 allAddedRows.CopyTo(rows);
1324 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1325 global::System.Data.DataRow row = rows[i];
1326 row.AcceptChanges();
1327 row.SetAdded();
1328 }
1329 }
1330 }
1331 throw ex;
1332 }
1333 finally {
1334 if (workConnOpened) {
1335 workConnection.Close();
1336 }
1337 if ((this._giangVienTableAdapter != null)) {
1338 this._giangVienTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._giangVienTableAdapter]));
1339 this._giangVienTableAdapter.Transaction = null;
1340 }
1341 if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1342 global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1343 adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1344 for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1345 global::System.Data.Common.DataAdapter adapter = adapters[i];
1346 adapter.AcceptChangesDuringUpdate = true;
1347 }
1348 }
1349 }
1350 return result;
1351 }
1352
1353 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1354 protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1355 global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1356 }
1357
1358 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1359 protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1360 if ((this._connection != null)) {
1361 return true;
1362 }
1363 if (((this.Connection == null)
1364 || (inputConnection == null))) {
1365 return true;
1366 }
1367 if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1368 return true;
1369 }
1370 return false;
1371 }
1372
1373 /// <summary>
1374 ///Update Order Option
1375 ///</summary>
1376 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1377 public enum UpdateOrderOption {
1378
1379 InsertUpdateDelete = 0,
1380
1381 UpdateInsertDelete = 1,
1382 }
1383
1384 /// <summary>
1385 ///Used to sort self-referenced table's rows
1386 ///</summary>
1387 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1388 private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1389
1390 private global::System.Data.DataRelation _relation;
1391
1392 private int _childFirst;
1393
1394 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1395 internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1396 this._relation = relation;
1397 if (childFirst) {
1398 this._childFirst = -1;
1399 }
1400 else {
1401 this._childFirst = 1;
1402 }
1403 }
1404
1405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1406 private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
1407 global::System.Diagnostics.Debug.Assert((child != null));
1408 global::System.Diagnostics.Debug.Assert((parent != null));
1409 global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1410 for (
1411 ; ((newParent != null)
1412 && ((object.ReferenceEquals(newParent, child) == false)
1413 && (object.ReferenceEquals(newParent, parent) == false)));
1414 ) {
1415 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1416 }
1417 if ((newParent == null)) {
1418 for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null)
1419 && ((object.ReferenceEquals(newParent, child) == false)
1420 && (object.ReferenceEquals(newParent, parent) == false)));
1421 ) {
1422 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
1423 }
1424 }
1425 if (object.ReferenceEquals(newParent, parent)) {
1426 return true;
1427 }
1428 return false;
1429 }
1430
1431 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1432 public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1433 if (object.ReferenceEquals(row1, row2)) {
1434 return 0;
1435 }
1436 if ((row1 == null)) {
1437 return -1;
1438 }
1439 if ((row2 == null)) {
1440 return 1;
1441 }
1442
1443 // Is row1 the child or grandchild of row2
1444 if (this.IsChildAndParent(row1, row2)) {
1445 return this._childFirst;
1446 }
1447
1448 // Is row2 the child or grandchild of row1
1449 if (this.IsChildAndParent(row2, row1)) {
1450 return (-1 * this._childFirst);
1451 }
1452 return 0;
1453 }
1454 }
1455 }
1456 }
1457
1458 #pragma warning restore 1591
2 // <auto-generated>
3 // This code was generated by a tool.
4 // Runtime Version:2.0.50727.4927
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 QuanLyDiem {
14
15
16 /// <summary>
17 ///Represents a strongly typed in-memory cache of data.
18 ///</summary>
19 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
20 [global::System.Serializable()]
21 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
22 [global::System.ComponentModel.ToolboxItem(true)]
23 [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
24 [global::System.Xml.Serialization.XmlRootAttribute("CNPM_1DataSet11")]
25 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
26 public partial class CNPM_1DataSet11 : global::System.Data.DataSet {
27
28 private GiangVienDataTable tableGiangVien;
29
30 private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
31
32 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
33 public CNPM_1DataSet11() {
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 protected CNPM_1DataSet11(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
44 base(info, context, false) {
45 if ((this.IsBinarySerialized(info, context) == true)) {
46 this.InitVars(false);
47 global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
48 this.Tables.CollectionChanged += schemaChangedHandler1;
49 this.Relations.CollectionChanged += schemaChangedHandler1;
50 return;
51 }
52 string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
53 if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
54 global::System.Data.DataSet ds = new global::System.Data.DataSet();
55 ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
56 if ((ds.Tables["GiangVien"] != null)) {
57 base.Tables.Add(new GiangVienDataTable(ds.Tables["GiangVien"]));
58 }
59 this.DataSetName = ds.DataSetName;
60 this.Prefix = ds.Prefix;
61 this.Namespace = ds.Namespace;
62 this.Locale = ds.Locale;
63 this.CaseSensitive = ds.CaseSensitive;
64 this.EnforceConstraints = ds.EnforceConstraints;
65 this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
66 this.InitVars();
67 }
68 else {
69 this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
70 }
71 this.GetSerializationData(info, context);
72 global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
73 base.Tables.CollectionChanged += schemaChangedHandler;
74 this.Relations.CollectionChanged += schemaChangedHandler;
75 }
76
77 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
78 [global::System.ComponentModel.Browsable(false)]
79 [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
80 public GiangVienDataTable GiangVien {
81 get {
82 return this.tableGiangVien;
83 }
84 }
85
86 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
87 [global::System.ComponentModel.BrowsableAttribute(true)]
88 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
89 public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
90 get {
91 return this._schemaSerializationMode;
92 }
93 set {
94 this._schemaSerializationMode = value;
95 }
96 }
97
98 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
99 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
100 public new global::System.Data.DataTableCollection Tables {
101 get {
102 return base.Tables;
103 }
104 }
105
106 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
107 [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
108 public new global::System.Data.DataRelationCollection Relations {
109 get {
110 return base.Relations;
111 }
112 }
113
114 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
115 protected override void InitializeDerivedDataSet() {
116 this.BeginInit();
117 this.InitClass();
118 this.EndInit();
119 }
120
121 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
122 public override global::System.Data.DataSet Clone() {
123 CNPM_1DataSet11 cln = ((CNPM_1DataSet11)(base.Clone()));
124 cln.InitVars();
125 cln.SchemaSerializationMode = this.SchemaSerializationMode;
126 return cln;
127 }
128
129 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
130 protected override bool ShouldSerializeTables() {
131 return false;
132 }
133
134 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
135 protected override bool ShouldSerializeRelations() {
136 return false;
137 }
138
139 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
140 protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
141 if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
142 this.Reset();
143 global::System.Data.DataSet ds = new global::System.Data.DataSet();
144 ds.ReadXml(reader);
145 if ((ds.Tables["GiangVien"] != null)) {
146 base.Tables.Add(new GiangVienDataTable(ds.Tables["GiangVien"]));
147 }
148 this.DataSetName = ds.DataSetName;
149 this.Prefix = ds.Prefix;
150 this.Namespace = ds.Namespace;
151 this.Locale = ds.Locale;
152 this.CaseSensitive = ds.CaseSensitive;
153 this.EnforceConstraints = ds.EnforceConstraints;
154 this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
155 this.InitVars();
156 }
157 else {
158 this.ReadXml(reader);
159 this.InitVars();
160 }
161 }
162
163 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
164 protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
165 global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
166 this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
167 stream.Position = 0;
168 return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
169 }
170
171 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 internal void InitVars() {
173 this.InitVars(true);
174 }
175
176 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
177 internal void InitVars(bool initTable) {
178 this.tableGiangVien = ((GiangVienDataTable)(base.Tables["GiangVien"]));
179 if ((initTable == true)) {
180 if ((this.tableGiangVien != null)) {
181 this.tableGiangVien.InitVars();
182 }
183 }
184 }
185
186 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
187 private void InitClass() {
188 this.DataSetName = "CNPM_1DataSet11";
189 this.Prefix = "";
190 this.Namespace = "http://tempuri.org/CNPM_1DataSet11.xsd";
191 this.EnforceConstraints = true;
192 this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
193 this.tableGiangVien = new GiangVienDataTable();
194 base.Tables.Add(this.tableGiangVien);
195 }
196
197 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
198 private bool ShouldSerializeGiangVien() {
199 return false;
200 }
201
202 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
203 private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
204 if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
205 this.InitVars();
206 }
207 }
208
209 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
210 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
211 CNPM_1DataSet11 ds = new CNPM_1DataSet11();
212 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
213 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
214 global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
215 any.Namespace = ds.Namespace;
216 sequence.Items.Add(any);
217 type.Particle = sequence;
218 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
219 if (xs.Contains(dsSchema.TargetNamespace)) {
220 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
221 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
222 try {
223 global::System.Xml.Schema.XmlSchema schema = null;
224 dsSchema.Write(s1);
225 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
226 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
227 s2.SetLength(0);
228 schema.Write(s2);
229 if ((s1.Length == s2.Length)) {
230 s1.Position = 0;
231 s2.Position = 0;
232 for (; ((s1.Position != s1.Length)
233 && (s1.ReadByte() == s2.ReadByte())); ) {
234 ;
235 }
236 if ((s1.Position == s1.Length)) {
237 return type;
238 }
239 }
240 }
241 }
242 finally {
243 if ((s1 != null)) {
244 s1.Close();
245 }
246 if ((s2 != null)) {
247 s2.Close();
248 }
249 }
250 }
251 xs.Add(dsSchema);
252 return type;
253 }
254
255 public delegate void GiangVienRowChangeEventHandler(object sender, GiangVienRowChangeEvent e);
256
257 /// <summary>
258 ///Represents the strongly named DataTable class.
259 ///</summary>
260 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
261 [global::System.Serializable()]
262 [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
263 public partial class GiangVienDataTable : global::System.Data.TypedTableBase<GiangVienRow> {
264
265 private global::System.Data.DataColumn columnMaGV;
266
267 private global::System.Data.DataColumn columnTenGV;
268
269 private global::System.Data.DataColumn columnNgaySinh;
270
271 private global::System.Data.DataColumn columnDiaChi;
272
273 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
274 public GiangVienDataTable() {
275 this.TableName = "GiangVien";
276 this.BeginInit();
277 this.InitClass();
278 this.EndInit();
279 }
280
281 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
282 internal GiangVienDataTable(global::System.Data.DataTable table) {
283 this.TableName = table.TableName;
284 if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
285 this.CaseSensitive = table.CaseSensitive;
286 }
287 if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
288 this.Locale = table.Locale;
289 }
290 if ((table.Namespace != table.DataSet.Namespace)) {
291 this.Namespace = table.Namespace;
292 }
293 this.Prefix = table.Prefix;
294 this.MinimumCapacity = table.MinimumCapacity;
295 }
296
297 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
298 protected GiangVienDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
299 base(info, context) {
300 this.InitVars();
301 }
302
303 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
304 public global::System.Data.DataColumn MaGVColumn {
305 get {
306 return this.columnMaGV;
307 }
308 }
309
310 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
311 public global::System.Data.DataColumn TenGVColumn {
312 get {
313 return this.columnTenGV;
314 }
315 }
316
317 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
318 public global::System.Data.DataColumn NgaySinhColumn {
319 get {
320 return this.columnNgaySinh;
321 }
322 }
323
324 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
325 public global::System.Data.DataColumn DiaChiColumn {
326 get {
327 return this.columnDiaChi;
328 }
329 }
330
331 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
332 [global::System.ComponentModel.Browsable(false)]
333 public int Count {
334 get {
335 return this.Rows.Count;
336 }
337 }
338
339 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
340 public GiangVienRow this[int index] {
341 get {
342 return ((GiangVienRow)(this.Rows[index]));
343 }
344 }
345
346 public event GiangVienRowChangeEventHandler GiangVienRowChanging;
347
348 public event GiangVienRowChangeEventHandler GiangVienRowChanged;
349
350 public event GiangVienRowChangeEventHandler GiangVienRowDeleting;
351
352 public event GiangVienRowChangeEventHandler GiangVienRowDeleted;
353
354 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
355 public void AddGiangVienRow(GiangVienRow row) {
356 this.Rows.Add(row);
357 }
358
359 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
360 public GiangVienRow AddGiangVienRow(string MaGV, string TenGV, string NgaySinh, string DiaChi) {
361 GiangVienRow rowGiangVienRow = ((GiangVienRow)(this.NewRow()));
362 object[] columnValuesArray = new object[] {
363 MaGV,
364 TenGV,
365 NgaySinh,
366 DiaChi};
367 rowGiangVienRow.ItemArray = columnValuesArray;
368 this.Rows.Add(rowGiangVienRow);
369 return rowGiangVienRow;
370 }
371
372 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
373 public GiangVienRow FindByMaGV(string MaGV) {
374 return ((GiangVienRow)(this.Rows.Find(new object[] {
375 MaGV})));
376 }
377
378 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
379 public override global::System.Data.DataTable Clone() {
380 GiangVienDataTable cln = ((GiangVienDataTable)(base.Clone()));
381 cln.InitVars();
382 return cln;
383 }
384
385 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
386 protected override global::System.Data.DataTable CreateInstance() {
387 return new GiangVienDataTable();
388 }
389
390 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
391 internal void InitVars() {
392 this.columnMaGV = base.Columns["MaGV"];
393 this.columnTenGV = base.Columns["TenGV"];
394 this.columnNgaySinh = base.Columns["NgaySinh"];
395 this.columnDiaChi = base.Columns["DiaChi"];
396 }
397
398 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
399 private void InitClass() {
400 this.columnMaGV = new global::System.Data.DataColumn("MaGV", typeof(string), null, global::System.Data.MappingType.Element);
401 base.Columns.Add(this.columnMaGV);
402 this.columnTenGV = new global::System.Data.DataColumn("TenGV", typeof(string), null, global::System.Data.MappingType.Element);
403 base.Columns.Add(this.columnTenGV);
404 this.columnNgaySinh = new global::System.Data.DataColumn("NgaySinh", typeof(string), null, global::System.Data.MappingType.Element);
405 base.Columns.Add(this.columnNgaySinh);
406 this.columnDiaChi = new global::System.Data.DataColumn("DiaChi", typeof(string), null, global::System.Data.MappingType.Element);
407 base.Columns.Add(this.columnDiaChi);
408 this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
409 this.columnMaGV}, true));
410 this.columnMaGV.AllowDBNull = false;
411 this.columnMaGV.Unique = true;
412 this.columnMaGV.MaxLength = 10;
413 this.columnTenGV.MaxLength = 30;
414 this.columnNgaySinh.MaxLength = 10;
415 this.columnDiaChi.MaxLength = 50;
416 }
417
418 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
419 public GiangVienRow NewGiangVienRow() {
420 return ((GiangVienRow)(this.NewRow()));
421 }
422
423 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
424 protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
425 return new GiangVienRow(builder);
426 }
427
428 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
429 protected override global::System.Type GetRowType() {
430 return typeof(GiangVienRow);
431 }
432
433 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
434 protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
435 base.OnRowChanged(e);
436 if ((this.GiangVienRowChanged != null)) {
437 this.GiangVienRowChanged(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
438 }
439 }
440
441 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
442 protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
443 base.OnRowChanging(e);
444 if ((this.GiangVienRowChanging != null)) {
445 this.GiangVienRowChanging(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
446 }
447 }
448
449 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
450 protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
451 base.OnRowDeleted(e);
452 if ((this.GiangVienRowDeleted != null)) {
453 this.GiangVienRowDeleted(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
454 }
455 }
456
457 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
458 protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
459 base.OnRowDeleting(e);
460 if ((this.GiangVienRowDeleting != null)) {
461 this.GiangVienRowDeleting(this, new GiangVienRowChangeEvent(((GiangVienRow)(e.Row)), e.Action));
462 }
463 }
464
465 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
466 public void RemoveGiangVienRow(GiangVienRow row) {
467 this.Rows.Remove(row);
468 }
469
470 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
471 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
472 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
473 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
474 CNPM_1DataSet11 ds = new CNPM_1DataSet11();
475 global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
476 any1.Namespace = "http://www.w3.org/2001/XMLSchema";
477 any1.MinOccurs = new decimal(0);
478 any1.MaxOccurs = decimal.MaxValue;
479 any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
480 sequence.Items.Add(any1);
481 global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
482 any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
483 any2.MinOccurs = new decimal(1);
484 any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
485 sequence.Items.Add(any2);
486 global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
487 attribute1.Name = "namespace";
488 attribute1.FixedValue = ds.Namespace;
489 type.Attributes.Add(attribute1);
490 global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
491 attribute2.Name = "tableTypeName";
492 attribute2.FixedValue = "GiangVienDataTable";
493 type.Attributes.Add(attribute2);
494 type.Particle = sequence;
495 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
496 if (xs.Contains(dsSchema.TargetNamespace)) {
497 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
498 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
499 try {
500 global::System.Xml.Schema.XmlSchema schema = null;
501 dsSchema.Write(s1);
502 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
503 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
504 s2.SetLength(0);
505 schema.Write(s2);
506 if ((s1.Length == s2.Length)) {
507 s1.Position = 0;
508 s2.Position = 0;
509 for (; ((s1.Position != s1.Length)
510 && (s1.ReadByte() == s2.ReadByte())); ) {
511 ;
512 }
513 if ((s1.Position == s1.Length)) {
514 return type;
515 }
516 }
517 }
518 }
519 finally {
520 if ((s1 != null)) {
521 s1.Close();
522 }
523 if ((s2 != null)) {
524 s2.Close();
525 }
526 }
527 }
528 xs.Add(dsSchema);
529 return type;
530 }
531 }
532
533 /// <summary>
534 ///Represents strongly named DataRow class.
535 ///</summary>
536 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
537 public partial class GiangVienRow : global::System.Data.DataRow {
538
539 private GiangVienDataTable tableGiangVien;
540
541 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
542 internal GiangVienRow(global::System.Data.DataRowBuilder rb) :
543 base(rb) {
544 this.tableGiangVien = ((GiangVienDataTable)(this.Table));
545 }
546
547 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
548 public string MaGV {
549 get {
550 return ((string)(this[this.tableGiangVien.MaGVColumn]));
551 }
552 set {
553 this[this.tableGiangVien.MaGVColumn] = value;
554 }
555 }
556
557 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
558 public string TenGV {
559 get {
560 try {
561 return ((string)(this[this.tableGiangVien.TenGVColumn]));
562 }
563 catch (global::System.InvalidCastException e) {
564 throw new global::System.Data.StrongTypingException("The value for column \'TenGV\' in table \'GiangVien\' is DBNull.", e);
565 }
566 }
567 set {
568 this[this.tableGiangVien.TenGVColumn] = value;
569 }
570 }
571
572 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
573 public string NgaySinh {
574 get {
575 try {
576 return ((string)(this[this.tableGiangVien.NgaySinhColumn]));
577 }
578 catch (global::System.InvalidCastException e) {
579 throw new global::System.Data.StrongTypingException("The value for column \'NgaySinh\' in table \'GiangVien\' is DBNull.", e);
580 }
581 }
582 set {
583 this[this.tableGiangVien.NgaySinhColumn] = value;
584 }
585 }
586
587 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
588 public string DiaChi {
589 get {
590 try {
591 return ((string)(this[this.tableGiangVien.DiaChiColumn]));
592 }
593 catch (global::System.InvalidCastException e) {
594 throw new global::System.Data.StrongTypingException("The value for column \'DiaChi\' in table \'GiangVien\' is DBNull.", e);
595 }
596 }
597 set {
598 this[this.tableGiangVien.DiaChiColumn] = value;
599 }
600 }
601
602 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
603 public bool IsTenGVNull() {
604 return this.IsNull(this.tableGiangVien.TenGVColumn);
605 }
606
607 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
608 public void SetTenGVNull() {
609 this[this.tableGiangVien.TenGVColumn] = global::System.Convert.DBNull;
610 }
611
612 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
613 public bool IsNgaySinhNull() {
614 return this.IsNull(this.tableGiangVien.NgaySinhColumn);
615 }
616
617 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
618 public void SetNgaySinhNull() {
619 this[this.tableGiangVien.NgaySinhColumn] = global::System.Convert.DBNull;
620 }
621
622 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
623 public bool IsDiaChiNull() {
624 return this.IsNull(this.tableGiangVien.DiaChiColumn);
625 }
626
627 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
628 public void SetDiaChiNull() {
629 this[this.tableGiangVien.DiaChiColumn] = global::System.Convert.DBNull;
630 }
631 }
632
633 /// <summary>
634 ///Row event argument class
635 ///</summary>
636 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
637 public class GiangVienRowChangeEvent : global::System.EventArgs {
638
639 private GiangVienRow eventRow;
640
641 private global::System.Data.DataRowAction eventAction;
642
643 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
644 public GiangVienRowChangeEvent(GiangVienRow row, global::System.Data.DataRowAction action) {
645 this.eventRow = row;
646 this.eventAction = action;
647 }
648
649 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
650 public GiangVienRow Row {
651 get {
652 return this.eventRow;
653 }
654 }
655
656 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
657 public global::System.Data.DataRowAction Action {
658 get {
659 return this.eventAction;
660 }
661 }
662 }
663 }
664 }
665 namespace QuanLyDiem.CNPM_1DataSet11TableAdapters {
666
667
668 /// <summary>
669 ///Represents the connection and commands used to retrieve and save data.
670 ///</summary>
671 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
672 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
673 [global::System.ComponentModel.ToolboxItem(true)]
674 [global::System.ComponentModel.DataObjectAttribute(true)]
675 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
676 ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
677 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
678 public partial class GiangVienTableAdapter : global::System.ComponentModel.Component {
679
680 private global::System.Data.SqlClient.SqlDataAdapter _adapter;
681
682 private global::System.Data.SqlClient.SqlConnection _connection;
683
684 private global::System.Data.SqlClient.SqlTransaction _transaction;
685
686 private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
687
688 private bool _clearBeforeFill;
689
690 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
691 public GiangVienTableAdapter() {
692 this.ClearBeforeFill = true;
693 }
694
695 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
696 protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
697 get {
698 if ((this._adapter == null)) {
699 this.InitAdapter();
700 }
701 return this._adapter;
702 }
703 }
704
705 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
706 internal global::System.Data.SqlClient.SqlConnection Connection {
707 get {
708 if ((this._connection == null)) {
709 this.InitConnection();
710 }
711 return this._connection;
712 }
713 set {
714 this._connection = value;
715 if ((this.Adapter.InsertCommand != null)) {
716 this.Adapter.InsertCommand.Connection = value;
717 }
718 if ((this.Adapter.DeleteCommand != null)) {
719 this.Adapter.DeleteCommand.Connection = value;
720 }
721 if ((this.Adapter.UpdateCommand != null)) {
722 this.Adapter.UpdateCommand.Connection = value;
723 }
724 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
725 if ((this.CommandCollection[i] != null)) {
726 ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
727 }
728 }
729 }
730 }
731
732 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
733 internal global::System.Data.SqlClient.SqlTransaction Transaction {
734 get {
735 return this._transaction;
736 }
737 set {
738 this._transaction = value;
739 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
740 this.CommandCollection[i].Transaction = this._transaction;
741 }
742 if (((this.Adapter != null)
743 && (this.Adapter.DeleteCommand != null))) {
744 this.Adapter.DeleteCommand.Transaction = this._transaction;
745 }
746 if (((this.Adapter != null)
747 && (this.Adapter.InsertCommand != null))) {
748 this.Adapter.InsertCommand.Transaction = this._transaction;
749 }
750 if (((this.Adapter != null)
751 && (this.Adapter.UpdateCommand != null))) {
752 this.Adapter.UpdateCommand.Transaction = this._transaction;
753 }
754 }
755 }
756
757 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
758 protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
759 get {
760 if ((this._commandCollection == null)) {
761 this.InitCommandCollection();
762 }
763 return this._commandCollection;
764 }
765 }
766
767 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
768 public bool ClearBeforeFill {
769 get {
770 return this._clearBeforeFill;
771 }
772 set {
773 this._clearBeforeFill = value;
774 }
775 }
776
777 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
778 private void InitAdapter() {
779 this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
780 global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
781 tableMapping.SourceTable = "Table";
782 tableMapping.DataSetTable = "GiangVien";
783 tableMapping.ColumnMappings.Add("MaGV", "MaGV");
784 tableMapping.ColumnMappings.Add("TenGV", "TenGV");
785 tableMapping.ColumnMappings.Add("NgaySinh", "NgaySinh");
786 tableMapping.ColumnMappings.Add("DiaChi", "DiaChi");
787 this._adapter.TableMappings.Add(tableMapping);
788 this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
789 this._adapter.DeleteCommand.Connection = this.Connection;
790 this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[GiangVien] WHERE (([MaGV] = @Original_MaGV) AND ((@IsNull_TenGV = 1 AND [TenGV] IS NULL) OR ([TenGV] = @Original_TenGV)) AND ((@IsNull_NgaySinh = 1 AND [NgaySinh] IS NULL) OR ([NgaySinh] = @Original_NgaySinh)) AND ((@IsNull_DiaChi = 1 AND [DiaChi] IS NULL) OR ([DiaChi] = @Original_DiaChi)))";
791 this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
792 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
793 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
794 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
795 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_NgaySinh", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
796 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
797 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DiaChi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
798 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
799 this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
800 this._adapter.InsertCommand.Connection = this.Connection;
801 this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[GiangVien] ([MaGV], [TenGV], [NgaySinh], [DiaChi]) VALUES (@Ma" +
802 "GV, @TenGV, @NgaySinh, @DiaChi);\r\nSELECT MaGV, TenGV, NgaySinh, DiaChi FROM Gian" +
803 "gVien WHERE (MaGV = @MaGV)";
804 this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
805 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
806 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
807 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
808 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
809 this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
810 this._adapter.UpdateCommand.Connection = this.Connection;
811 this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[GiangVien] SET [MaGV] = @MaGV, [TenGV] = @TenGV, [NgaySinh] = @NgaySinh, [DiaChi] = @DiaChi WHERE (([MaGV] = @Original_MaGV) AND ((@IsNull_TenGV = 1 AND [TenGV] IS NULL) OR ([TenGV] = @Original_TenGV)) AND ((@IsNull_NgaySinh = 1 AND [NgaySinh] IS NULL) OR ([NgaySinh] = @Original_NgaySinh)) AND ((@IsNull_DiaChi = 1 AND [DiaChi] IS NULL) OR ([DiaChi] = @Original_DiaChi)));
812 SELECT MaGV, TenGV, NgaySinh, DiaChi FROM GiangVien WHERE (MaGV = @MaGV)";
813 this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
814 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
815 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
816 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
817 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
818 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
819 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
820 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenGV", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
821 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_NgaySinh", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
822 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NgaySinh", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NgaySinh", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
823 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DiaChi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
824 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DiaChi", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DiaChi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
825 }
826
827 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
828 private void InitConnection() {
829 this._connection = new global::System.Data.SqlClient.SqlConnection();
830 this._connection.ConnectionString = global::QuanLyDiem.Properties.Settings.Default.CNPM_1ConnectionString;
831 }
832
833 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
834 private void InitCommandCollection() {
835 this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
836 this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
837 this._commandCollection[0].Connection = this.Connection;
838 this._commandCollection[0].CommandText = "SELECT MaGV, TenGV, NgaySinh, DiaChi FROM dbo.GiangVien";
839 this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
840 }
841
842 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
843 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
844 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
845 public virtual int Fill(CNPM_1DataSet11.GiangVienDataTable dataTable) {
846 this.Adapter.SelectCommand = this.CommandCollection[0];
847 if ((this.ClearBeforeFill == true)) {
848 dataTable.Clear();
849 }
850 int returnValue = this.Adapter.Fill(dataTable);
851 return returnValue;
852 }
853
854 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
855 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
856 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
857 public virtual CNPM_1DataSet11.GiangVienDataTable GetData() {
858 this.Adapter.SelectCommand = this.CommandCollection[0];
859 CNPM_1DataSet11.GiangVienDataTable dataTable = new CNPM_1DataSet11.GiangVienDataTable();
860 this.Adapter.Fill(dataTable);
861 return dataTable;
862 }
863
864 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
865 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
866 public virtual int Update(CNPM_1DataSet11.GiangVienDataTable dataTable) {
867 return this.Adapter.Update(dataTable);
868 }
869
870 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
871 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
872 public virtual int Update(CNPM_1DataSet11 dataSet) {
873 return this.Adapter.Update(dataSet, "GiangVien");
874 }
875
876 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
877 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
878 public virtual int Update(global::System.Data.DataRow dataRow) {
879 return this.Adapter.Update(new global::System.Data.DataRow[] {
880 dataRow});
881 }
882
883 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
884 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
885 public virtual int Update(global::System.Data.DataRow[] dataRows) {
886 return this.Adapter.Update(dataRows);
887 }
888
889 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
890 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
891 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
892 public virtual int Delete(string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
893 if ((Original_MaGV == null)) {
894 throw new global::System.ArgumentNullException("Original_MaGV");
895 }
896 else {
897 this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_MaGV));
898 }
899 if ((Original_TenGV == null)) {
900 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
901 this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
902 }
903 else {
904 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
905 this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_TenGV));
906 }
907 if ((Original_NgaySinh == null)) {
908 this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
909 this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
910 }
911 else {
912 this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
913 this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_NgaySinh));
914 }
915 if ((Original_DiaChi == null)) {
916 this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
917 this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
918 }
919 else {
920 this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
921 this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_DiaChi));
922 }
923 global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
924 if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
925 != global::System.Data.ConnectionState.Open)) {
926 this.Adapter.DeleteCommand.Connection.Open();
927 }
928 try {
929 int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
930 return returnValue;
931 }
932 finally {
933 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
934 this.Adapter.DeleteCommand.Connection.Close();
935 }
936 }
937 }
938
939 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
940 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
941 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
942 public virtual int Insert(string MaGV, string TenGV, string NgaySinh, string DiaChi) {
943 if ((MaGV == null)) {
944 throw new global::System.ArgumentNullException("MaGV");
945 }
946 else {
947 this.Adapter.InsertCommand.Parameters[0].Value = ((string)(MaGV));
948 }
949 if ((TenGV == null)) {
950 this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
951 }
952 else {
953 this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TenGV));
954 }
955 if ((NgaySinh == null)) {
956 this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
957 }
958 else {
959 this.Adapter.InsertCommand.Parameters[2].Value = ((string)(NgaySinh));
960 }
961 if ((DiaChi == null)) {
962 this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
963 }
964 else {
965 this.Adapter.InsertCommand.Parameters[3].Value = ((string)(DiaChi));
966 }
967 global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
968 if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
969 != global::System.Data.ConnectionState.Open)) {
970 this.Adapter.InsertCommand.Connection.Open();
971 }
972 try {
973 int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
974 return returnValue;
975 }
976 finally {
977 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
978 this.Adapter.InsertCommand.Connection.Close();
979 }
980 }
981 }
982
983 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
984 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
985 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
986 public virtual int Update(string MaGV, string TenGV, string NgaySinh, string DiaChi, string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
987 if ((MaGV == null)) {
988 throw new global::System.ArgumentNullException("MaGV");
989 }
990 else {
991 this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(MaGV));
992 }
993 if ((TenGV == null)) {
994 this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
995 }
996 else {
997 this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TenGV));
998 }
999 if ((NgaySinh == null)) {
1000 this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
1001 }
1002 else {
1003 this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(NgaySinh));
1004 }
1005 if ((DiaChi == null)) {
1006 this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
1007 }
1008 else {
1009 this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(DiaChi));
1010 }
1011 if ((Original_MaGV == null)) {
1012 throw new global::System.ArgumentNullException("Original_MaGV");
1013 }
1014 else {
1015 this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_MaGV));
1016 }
1017 if ((Original_TenGV == null)) {
1018 this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(1));
1019 this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value;
1020 }
1021 else {
1022 this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(0));
1023 this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_TenGV));
1024 }
1025 if ((Original_NgaySinh == null)) {
1026 this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
1027 this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
1028 }
1029 else {
1030 this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
1031 this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_NgaySinh));
1032 }
1033 if ((Original_DiaChi == null)) {
1034 this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1));
1035 this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
1036 }
1037 else {
1038 this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0));
1039 this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_DiaChi));
1040 }
1041 global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
1042 if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
1043 != global::System.Data.ConnectionState.Open)) {
1044 this.Adapter.UpdateCommand.Connection.Open();
1045 }
1046 try {
1047 int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
1048 return returnValue;
1049 }
1050 finally {
1051 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1052 this.Adapter.UpdateCommand.Connection.Close();
1053 }
1054 }
1055 }
1056
1057 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1058 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1059 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1060 public virtual int Update(string TenGV, string NgaySinh, string DiaChi, string Original_MaGV, string Original_TenGV, string Original_NgaySinh, string Original_DiaChi) {
1061 return this.Update(Original_MaGV, TenGV, NgaySinh, DiaChi, Original_MaGV, Original_TenGV, Original_NgaySinh, Original_DiaChi);
1062 }
1063 }
1064
1065 /// <summary>
1066 ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1067 ///</summary>
1068 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1069 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
1070 [global::System.ComponentModel.ToolboxItem(true)]
1071 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1072 "esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1073 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1074 public partial class TableAdapterManager : global::System.ComponentModel.Component {
1075
1076 private UpdateOrderOption _updateOrder;
1077
1078 private GiangVienTableAdapter _giangVienTableAdapter;
1079
1080 private bool _backupDataSetBeforeUpdate;
1081
1082 private global::System.Data.IDbConnection _connection;
1083
1084 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1085 public UpdateOrderOption UpdateOrder {
1086 get {
1087 return this._updateOrder;
1088 }
1089 set {
1090 this._updateOrder = value;
1091 }
1092 }
1093
1094 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1095 [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1096 "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
1097 "", "System.Drawing.Design.UITypeEditor")]
1098 public GiangVienTableAdapter GiangVienTableAdapter {
1099 get {
1100 return this._giangVienTableAdapter;
1101 }
1102 set {
1103 this._giangVienTableAdapter = value;
1104 }
1105 }
1106
1107 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1108 public bool BackupDataSetBeforeUpdate {
1109 get {
1110 return this._backupDataSetBeforeUpdate;
1111 }
1112 set {
1113 this._backupDataSetBeforeUpdate = value;
1114 }
1115 }
1116
1117 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1118 [global::System.ComponentModel.Browsable(false)]
1119 public global::System.Data.IDbConnection Connection {
1120 get {
1121 if ((this._connection != null)) {
1122 return this._connection;
1123 }
1124 if (((this._giangVienTableAdapter != null)
1125 && (this._giangVienTableAdapter.Connection != null))) {
1126 return this._giangVienTableAdapter.Connection;
1127 }
1128 return null;
1129 }
1130 set {
1131 this._connection = value;
1132 }
1133 }
1134
1135 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1136 [global::System.ComponentModel.Browsable(false)]
1137 public int TableAdapterInstanceCount {
1138 get {
1139 int count = 0;
1140 if ((this._giangVienTableAdapter != null)) {
1141 count = (count + 1);
1142 }
1143 return count;
1144 }
1145 }
1146
1147 /// <summary>
1148 ///Update rows in top-down order.
1149 ///</summary>
1150 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1151 private int UpdateUpdatedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1152 int result = 0;
1153 if ((this._giangVienTableAdapter != null)) {
1154 global::System.Data.DataRow[] updatedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1155 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
1156 if (((updatedRows != null)
1157 && (0 < updatedRows.Length))) {
1158 result = (result + this._giangVienTableAdapter.Update(updatedRows));
1159 allChangedRows.AddRange(updatedRows);
1160 }
1161 }
1162 return result;
1163 }
1164
1165 /// <summary>
1166 ///Insert rows in top-down order.
1167 ///</summary>
1168 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1169 private int UpdateInsertedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1170 int result = 0;
1171 if ((this._giangVienTableAdapter != null)) {
1172 global::System.Data.DataRow[] addedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.Added);
1173 if (((addedRows != null)
1174 && (0 < addedRows.Length))) {
1175 result = (result + this._giangVienTableAdapter.Update(addedRows));
1176 allAddedRows.AddRange(addedRows);
1177 }
1178 }
1179 return result;
1180 }
1181
1182 /// <summary>
1183 ///Delete rows in bottom-up order.
1184 ///</summary>
1185 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1186 private int UpdateDeletedRows(CNPM_1DataSet11 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1187 int result = 0;
1188 if ((this._giangVienTableAdapter != null)) {
1189 global::System.Data.DataRow[] deletedRows = dataSet.GiangVien.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1190 if (((deletedRows != null)
1191 && (0 < deletedRows.Length))) {
1192 result = (result + this._giangVienTableAdapter.Update(deletedRows));
1193 allChangedRows.AddRange(deletedRows);
1194 }
1195 }
1196 return result;
1197 }
1198
1199 /// <summary>
1200 ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1201 ///</summary>
1202 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1203 private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1204 if (((updatedRows == null)
1205 || (updatedRows.Length < 1))) {
1206 return updatedRows;
1207 }
1208 if (((allAddedRows == null)
1209 || (allAddedRows.Count < 1))) {
1210 return updatedRows;
1211 }
1212 global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1213 for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1214 global::System.Data.DataRow row = updatedRows[i];
1215 if ((allAddedRows.Contains(row) == false)) {
1216 realUpdatedRows.Add(row);
1217 }
1218 }
1219 return realUpdatedRows.ToArray();
1220 }
1221
1222 /// <summary>
1223 ///Update all changes to the dataset.
1224 ///</summary>
1225 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1226 public virtual int UpdateAll(CNPM_1DataSet11 dataSet) {
1227 if ((dataSet == null)) {
1228 throw new global::System.ArgumentNullException("dataSet");
1229 }
1230 if ((dataSet.HasChanges() == false)) {
1231 return 0;
1232 }
1233 if (((this._giangVienTableAdapter != null)
1234 && (this.MatchTableAdapterConnection(this._giangVienTableAdapter.Connection) == false))) {
1235 throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1236 "tring.");
1237 }
1238 global::System.Data.IDbConnection workConnection = this.Connection;
1239 if ((workConnection == null)) {
1240 throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1241 "ger TableAdapter property to a valid TableAdapter instance.");
1242 }
1243 bool workConnOpened = false;
1244 if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1245 == global::System.Data.ConnectionState.Broken)) {
1246 workConnection.Close();
1247 }
1248 if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1249 workConnection.Open();
1250 workConnOpened = true;
1251 }
1252 global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1253 if ((workTransaction == null)) {
1254 throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1255 "ctions or the current state is not allowing the transaction to begin.");
1256 }
1257 global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1258 global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1259 global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1260 global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1261 int result = 0;
1262 global::System.Data.DataSet backupDataSet = null;
1263 if (this.BackupDataSetBeforeUpdate) {
1264 backupDataSet = new global::System.Data.DataSet();
1265 backupDataSet.Merge(dataSet);
1266 }
1267 try {
1268 // ---- Prepare for update -----------
1269 //
1270 if ((this._giangVienTableAdapter != null)) {
1271 revertConnections.Add(this._giangVienTableAdapter, this._giangVienTableAdapter.Connection);
1272 this._giangVienTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1273 this._giangVienTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1274 if (this._giangVienTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1275 this._giangVienTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1276 adaptersWithAcceptChangesDuringUpdate.Add(this._giangVienTableAdapter.Adapter);
1277 }
1278 }
1279 //
1280 //---- Perform updates -----------
1281 //
1282 if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1283 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1284 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1285 }
1286 else {
1287 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1288 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1289 }
1290 result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
1291 //
1292 //---- Commit updates -----------
1293 //
1294 workTransaction.Commit();
1295 if ((0 < allAddedRows.Count)) {
1296 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1297 allAddedRows.CopyTo(rows);
1298 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1299 global::System.Data.DataRow row = rows[i];
1300 row.AcceptChanges();
1301 }
1302 }
1303 if ((0 < allChangedRows.Count)) {
1304 global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1305 allChangedRows.CopyTo(rows);
1306 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1307 global::System.Data.DataRow row = rows[i];
1308 row.AcceptChanges();
1309 }
1310 }
1311 }
1312 catch (global::System.Exception ex) {
1313 workTransaction.Rollback();
1314 // ---- Restore the dataset -----------
1315 if (this.BackupDataSetBeforeUpdate) {
1316 global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1317 dataSet.Clear();
1318 dataSet.Merge(backupDataSet);
1319 }
1320 else {
1321 if ((0 < allAddedRows.Count)) {
1322 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1323 allAddedRows.CopyTo(rows);
1324 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1325 global::System.Data.DataRow row = rows[i];
1326 row.AcceptChanges();
1327 row.SetAdded();
1328 }
1329 }
1330 }
1331 throw ex;
1332 }
1333 finally {
1334 if (workConnOpened) {
1335 workConnection.Close();
1336 }
1337 if ((this._giangVienTableAdapter != null)) {
1338 this._giangVienTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._giangVienTableAdapter]));
1339 this._giangVienTableAdapter.Transaction = null;
1340 }
1341 if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1342 global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1343 adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1344 for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1345 global::System.Data.Common.DataAdapter adapter = adapters[i];
1346 adapter.AcceptChangesDuringUpdate = true;
1347 }
1348 }
1349 }
1350 return result;
1351 }
1352
1353 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1354 protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1355 global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1356 }
1357
1358 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1359 protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1360 if ((this._connection != null)) {
1361 return true;
1362 }
1363 if (((this.Connection == null)
1364 || (inputConnection == null))) {
1365 return true;
1366 }
1367 if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1368 return true;
1369 }
1370 return false;
1371 }
1372
1373 /// <summary>
1374 ///Update Order Option
1375 ///</summary>
1376 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1377 public enum UpdateOrderOption {
1378
1379 InsertUpdateDelete = 0,
1380
1381 UpdateInsertDelete = 1,
1382 }
1383
1384 /// <summary>
1385 ///Used to sort self-referenced table's rows
1386 ///</summary>
1387 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1388 private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1389
1390 private global::System.Data.DataRelation _relation;
1391
1392 private int _childFirst;
1393
1394 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1395 internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1396 this._relation = relation;
1397 if (childFirst) {
1398 this._childFirst = -1;
1399 }
1400 else {
1401 this._childFirst = 1;
1402 }
1403 }
1404
1405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1406 private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
1407 global::System.Diagnostics.Debug.Assert((child != null));
1408 global::System.Diagnostics.Debug.Assert((parent != null));
1409 global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1410 for (
1411 ; ((newParent != null)
1412 && ((object.ReferenceEquals(newParent, child) == false)
1413 && (object.ReferenceEquals(newParent, parent) == false)));
1414 ) {
1415 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1416 }
1417 if ((newParent == null)) {
1418 for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null)
1419 && ((object.ReferenceEquals(newParent, child) == false)
1420 && (object.ReferenceEquals(newParent, parent) == false)));
1421 ) {
1422 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
1423 }
1424 }
1425 if (object.ReferenceEquals(newParent, parent)) {
1426 return true;
1427 }
1428 return false;
1429 }
1430
1431 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1432 public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1433 if (object.ReferenceEquals(row1, row2)) {
1434 return 0;
1435 }
1436 if ((row1 == null)) {
1437 return -1;
1438 }
1439 if ((row2 == null)) {
1440 return 1;
1441 }
1442
1443 // Is row1 the child or grandchild of row2
1444 if (this.IsChildAndParent(row1, row2)) {
1445 return this._childFirst;
1446 }
1447
1448 // Is row2 the child or grandchild of row1
1449 if (this.IsChildAndParent(row2, row1)) {
1450 return (-1 * this._childFirst);
1451 }
1452 return 0;
1453 }
1454 }
1455 }
1456 }
1457
1458 #pragma warning restore 1591