Quản lý điểm sinh viên CNTT
177.566 lượt xem;
- QuanlydiemDataSet34.Designer.cs
- Quản lý điểm sinh vien CNTT /
- 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 Quản_lý_điểm_sinh_vien_CNTT {
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("QuanlydiemDataSet34")]
25 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
26 public partial class QuanlydiemDataSet34 : global::System.Data.DataSet {
27
28 private tblKHOADataTable tabletblKHOA;
29
30 private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
31
32 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
33 public QuanlydiemDataSet34() {
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 QuanlydiemDataSet34(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["tblKHOA"] != null)) {
57 base.Tables.Add(new tblKHOADataTable(ds.Tables["tblKHOA"]));
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 tblKHOADataTable tblKHOA {
81 get {
82 return this.tabletblKHOA;
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 QuanlydiemDataSet34 cln = ((QuanlydiemDataSet34)(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["tblKHOA"] != null)) {
146 base.Tables.Add(new tblKHOADataTable(ds.Tables["tblKHOA"]));
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.tabletblKHOA = ((tblKHOADataTable)(base.Tables["tblKHOA"]));
179 if ((initTable == true)) {
180 if ((this.tabletblKHOA != null)) {
181 this.tabletblKHOA.InitVars();
182 }
183 }
184 }
185
186 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
187 private void InitClass() {
188 this.DataSetName = "QuanlydiemDataSet34";
189 this.Prefix = "";
190 this.Namespace = "http://tempuri.org/QuanlydiemDataSet34.xsd";
191 this.EnforceConstraints = true;
192 this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
193 this.tabletblKHOA = new tblKHOADataTable();
194 base.Tables.Add(this.tabletblKHOA);
195 }
196
197 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
198 private bool ShouldSerializetblKHOA() {
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 QuanlydiemDataSet34 ds = new QuanlydiemDataSet34();
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 tblKHOARowChangeEventHandler(object sender, tblKHOARowChangeEvent 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 tblKHOADataTable : global::System.Data.TypedTableBase<tblKHOARow> {
264
265 private global::System.Data.DataColumn columnMaKhoa;
266
267 private global::System.Data.DataColumn columnTenKhoa;
268
269 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
270 public tblKHOADataTable() {
271 this.TableName = "tblKHOA";
272 this.BeginInit();
273 this.InitClass();
274 this.EndInit();
275 }
276
277 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
278 internal tblKHOADataTable(global::System.Data.DataTable table) {
279 this.TableName = table.TableName;
280 if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
281 this.CaseSensitive = table.CaseSensitive;
282 }
283 if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
284 this.Locale = table.Locale;
285 }
286 if ((table.Namespace != table.DataSet.Namespace)) {
287 this.Namespace = table.Namespace;
288 }
289 this.Prefix = table.Prefix;
290 this.MinimumCapacity = table.MinimumCapacity;
291 }
292
293 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
294 protected tblKHOADataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
295 base(info, context) {
296 this.InitVars();
297 }
298
299 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
300 public global::System.Data.DataColumn MaKhoaColumn {
301 get {
302 return this.columnMaKhoa;
303 }
304 }
305
306 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
307 public global::System.Data.DataColumn TenKhoaColumn {
308 get {
309 return this.columnTenKhoa;
310 }
311 }
312
313 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
314 [global::System.ComponentModel.Browsable(false)]
315 public int Count {
316 get {
317 return this.Rows.Count;
318 }
319 }
320
321 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
322 public tblKHOARow this[int index] {
323 get {
324 return ((tblKHOARow)(this.Rows[index]));
325 }
326 }
327
328 public event tblKHOARowChangeEventHandler tblKHOARowChanging;
329
330 public event tblKHOARowChangeEventHandler tblKHOARowChanged;
331
332 public event tblKHOARowChangeEventHandler tblKHOARowDeleting;
333
334 public event tblKHOARowChangeEventHandler tblKHOARowDeleted;
335
336 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
337 public void AddtblKHOARow(tblKHOARow row) {
338 this.Rows.Add(row);
339 }
340
341 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
342 public tblKHOARow AddtblKHOARow(string MaKhoa, string TenKhoa) {
343 tblKHOARow rowtblKHOARow = ((tblKHOARow)(this.NewRow()));
344 object[] columnValuesArray = new object[] {
345 MaKhoa,
346 TenKhoa};
347 rowtblKHOARow.ItemArray = columnValuesArray;
348 this.Rows.Add(rowtblKHOARow);
349 return rowtblKHOARow;
350 }
351
352 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
353 public tblKHOARow FindByMaKhoa(string MaKhoa) {
354 return ((tblKHOARow)(this.Rows.Find(new object[] {
355 MaKhoa})));
356 }
357
358 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
359 public override global::System.Data.DataTable Clone() {
360 tblKHOADataTable cln = ((tblKHOADataTable)(base.Clone()));
361 cln.InitVars();
362 return cln;
363 }
364
365 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
366 protected override global::System.Data.DataTable CreateInstance() {
367 return new tblKHOADataTable();
368 }
369
370 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
371 internal void InitVars() {
372 this.columnMaKhoa = base.Columns["MaKhoa"];
373 this.columnTenKhoa = base.Columns["TenKhoa"];
374 }
375
376 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
377 private void InitClass() {
378 this.columnMaKhoa = new global::System.Data.DataColumn("MaKhoa", typeof(string), null, global::System.Data.MappingType.Element);
379 base.Columns.Add(this.columnMaKhoa);
380 this.columnTenKhoa = new global::System.Data.DataColumn("TenKhoa", typeof(string), null, global::System.Data.MappingType.Element);
381 base.Columns.Add(this.columnTenKhoa);
382 this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
383 this.columnMaKhoa}, true));
384 this.columnMaKhoa.AllowDBNull = false;
385 this.columnMaKhoa.Unique = true;
386 this.columnMaKhoa.MaxLength = 10;
387 this.columnTenKhoa.MaxLength = 30;
388 }
389
390 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
391 public tblKHOARow NewtblKHOARow() {
392 return ((tblKHOARow)(this.NewRow()));
393 }
394
395 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
396 protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
397 return new tblKHOARow(builder);
398 }
399
400 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
401 protected override global::System.Type GetRowType() {
402 return typeof(tblKHOARow);
403 }
404
405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
406 protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
407 base.OnRowChanged(e);
408 if ((this.tblKHOARowChanged != null)) {
409 this.tblKHOARowChanged(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
410 }
411 }
412
413 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
414 protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
415 base.OnRowChanging(e);
416 if ((this.tblKHOARowChanging != null)) {
417 this.tblKHOARowChanging(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
418 }
419 }
420
421 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
422 protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
423 base.OnRowDeleted(e);
424 if ((this.tblKHOARowDeleted != null)) {
425 this.tblKHOARowDeleted(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
426 }
427 }
428
429 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
430 protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
431 base.OnRowDeleting(e);
432 if ((this.tblKHOARowDeleting != null)) {
433 this.tblKHOARowDeleting(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
434 }
435 }
436
437 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
438 public void RemovetblKHOARow(tblKHOARow row) {
439 this.Rows.Remove(row);
440 }
441
442 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
443 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
444 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
445 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
446 QuanlydiemDataSet34 ds = new QuanlydiemDataSet34();
447 global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
448 any1.Namespace = "http://www.w3.org/2001/XMLSchema";
449 any1.MinOccurs = new decimal(0);
450 any1.MaxOccurs = decimal.MaxValue;
451 any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
452 sequence.Items.Add(any1);
453 global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
454 any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
455 any2.MinOccurs = new decimal(1);
456 any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
457 sequence.Items.Add(any2);
458 global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
459 attribute1.Name = "namespace";
460 attribute1.FixedValue = ds.Namespace;
461 type.Attributes.Add(attribute1);
462 global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
463 attribute2.Name = "tableTypeName";
464 attribute2.FixedValue = "tblKHOADataTable";
465 type.Attributes.Add(attribute2);
466 type.Particle = sequence;
467 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
468 if (xs.Contains(dsSchema.TargetNamespace)) {
469 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
470 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
471 try {
472 global::System.Xml.Schema.XmlSchema schema = null;
473 dsSchema.Write(s1);
474 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
475 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
476 s2.SetLength(0);
477 schema.Write(s2);
478 if ((s1.Length == s2.Length)) {
479 s1.Position = 0;
480 s2.Position = 0;
481 for (; ((s1.Position != s1.Length)
482 && (s1.ReadByte() == s2.ReadByte())); ) {
483 ;
484 }
485 if ((s1.Position == s1.Length)) {
486 return type;
487 }
488 }
489 }
490 }
491 finally {
492 if ((s1 != null)) {
493 s1.Close();
494 }
495 if ((s2 != null)) {
496 s2.Close();
497 }
498 }
499 }
500 xs.Add(dsSchema);
501 return type;
502 }
503 }
504
505 /// <summary>
506 ///Represents strongly named DataRow class.
507 ///</summary>
508 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
509 public partial class tblKHOARow : global::System.Data.DataRow {
510
511 private tblKHOADataTable tabletblKHOA;
512
513 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
514 internal tblKHOARow(global::System.Data.DataRowBuilder rb) :
515 base(rb) {
516 this.tabletblKHOA = ((tblKHOADataTable)(this.Table));
517 }
518
519 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
520 public string MaKhoa {
521 get {
522 return ((string)(this[this.tabletblKHOA.MaKhoaColumn]));
523 }
524 set {
525 this[this.tabletblKHOA.MaKhoaColumn] = value;
526 }
527 }
528
529 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
530 public string TenKhoa {
531 get {
532 try {
533 return ((string)(this[this.tabletblKHOA.TenKhoaColumn]));
534 }
535 catch (global::System.InvalidCastException e) {
536 throw new global::System.Data.StrongTypingException("The value for column \'TenKhoa\' in table \'tblKHOA\' is DBNull.", e);
537 }
538 }
539 set {
540 this[this.tabletblKHOA.TenKhoaColumn] = value;
541 }
542 }
543
544 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
545 public bool IsTenKhoaNull() {
546 return this.IsNull(this.tabletblKHOA.TenKhoaColumn);
547 }
548
549 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
550 public void SetTenKhoaNull() {
551 this[this.tabletblKHOA.TenKhoaColumn] = global::System.Convert.DBNull;
552 }
553 }
554
555 /// <summary>
556 ///Row event argument class
557 ///</summary>
558 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
559 public class tblKHOARowChangeEvent : global::System.EventArgs {
560
561 private tblKHOARow eventRow;
562
563 private global::System.Data.DataRowAction eventAction;
564
565 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
566 public tblKHOARowChangeEvent(tblKHOARow row, global::System.Data.DataRowAction action) {
567 this.eventRow = row;
568 this.eventAction = action;
569 }
570
571 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
572 public tblKHOARow Row {
573 get {
574 return this.eventRow;
575 }
576 }
577
578 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
579 public global::System.Data.DataRowAction Action {
580 get {
581 return this.eventAction;
582 }
583 }
584 }
585 }
586 }
587 namespace Quản_lý_điểm_sinh_vien_CNTT.QuanlydiemDataSet34TableAdapters {
588
589
590 /// <summary>
591 ///Represents the connection and commands used to retrieve and save data.
592 ///</summary>
593 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
594 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
595 [global::System.ComponentModel.ToolboxItem(true)]
596 [global::System.ComponentModel.DataObjectAttribute(true)]
597 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
598 ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
599 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
600 public partial class tblKHOATableAdapter : global::System.ComponentModel.Component {
601
602 private global::System.Data.SqlClient.SqlDataAdapter _adapter;
603
604 private global::System.Data.SqlClient.SqlConnection _connection;
605
606 private global::System.Data.SqlClient.SqlTransaction _transaction;
607
608 private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
609
610 private bool _clearBeforeFill;
611
612 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
613 public tblKHOATableAdapter() {
614 this.ClearBeforeFill = true;
615 }
616
617 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
618 protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
619 get {
620 if ((this._adapter == null)) {
621 this.InitAdapter();
622 }
623 return this._adapter;
624 }
625 }
626
627 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
628 internal global::System.Data.SqlClient.SqlConnection Connection {
629 get {
630 if ((this._connection == null)) {
631 this.InitConnection();
632 }
633 return this._connection;
634 }
635 set {
636 this._connection = value;
637 if ((this.Adapter.InsertCommand != null)) {
638 this.Adapter.InsertCommand.Connection = value;
639 }
640 if ((this.Adapter.DeleteCommand != null)) {
641 this.Adapter.DeleteCommand.Connection = value;
642 }
643 if ((this.Adapter.UpdateCommand != null)) {
644 this.Adapter.UpdateCommand.Connection = value;
645 }
646 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
647 if ((this.CommandCollection[i] != null)) {
648 ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
649 }
650 }
651 }
652 }
653
654 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
655 internal global::System.Data.SqlClient.SqlTransaction Transaction {
656 get {
657 return this._transaction;
658 }
659 set {
660 this._transaction = value;
661 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
662 this.CommandCollection[i].Transaction = this._transaction;
663 }
664 if (((this.Adapter != null)
665 && (this.Adapter.DeleteCommand != null))) {
666 this.Adapter.DeleteCommand.Transaction = this._transaction;
667 }
668 if (((this.Adapter != null)
669 && (this.Adapter.InsertCommand != null))) {
670 this.Adapter.InsertCommand.Transaction = this._transaction;
671 }
672 if (((this.Adapter != null)
673 && (this.Adapter.UpdateCommand != null))) {
674 this.Adapter.UpdateCommand.Transaction = this._transaction;
675 }
676 }
677 }
678
679 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
680 protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
681 get {
682 if ((this._commandCollection == null)) {
683 this.InitCommandCollection();
684 }
685 return this._commandCollection;
686 }
687 }
688
689 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
690 public bool ClearBeforeFill {
691 get {
692 return this._clearBeforeFill;
693 }
694 set {
695 this._clearBeforeFill = value;
696 }
697 }
698
699 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
700 private void InitAdapter() {
701 this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
702 global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
703 tableMapping.SourceTable = "Table";
704 tableMapping.DataSetTable = "tblKHOA";
705 tableMapping.ColumnMappings.Add("MaKhoa", "MaKhoa");
706 tableMapping.ColumnMappings.Add("TenKhoa", "TenKhoa");
707 this._adapter.TableMappings.Add(tableMapping);
708 this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
709 this._adapter.DeleteCommand.Connection = this.Connection;
710 this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[tblKHOA] WHERE (([MaKhoa] = @Original_MaKhoa) AND ((@IsNull_Te" +
711 "nKhoa = 1 AND [TenKhoa] IS NULL) OR ([TenKhoa] = @Original_TenKhoa)))";
712 this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
713 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
714 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenKhoa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
715 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
716 this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
717 this._adapter.InsertCommand.Connection = this.Connection;
718 this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[tblKHOA] ([MaKhoa], [TenKhoa]) VALUES (@MaKhoa, @TenKhoa);\r\nSE" +
719 "LECT MaKhoa, TenKhoa FROM tblKHOA WHERE (MaKhoa = @MaKhoa)";
720 this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
721 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
722 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
723 this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
724 this._adapter.UpdateCommand.Connection = this.Connection;
725 this._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[tblKHOA] SET [MaKhoa] = @MaKhoa, [TenKhoa] = @TenKhoa WHERE (([MaKh" +
726 "oa] = @Original_MaKhoa) AND ((@IsNull_TenKhoa = 1 AND [TenKhoa] IS NULL) OR ([Te" +
727 "nKhoa] = @Original_TenKhoa)));\r\nSELECT MaKhoa, TenKhoa FROM tblKHOA WHERE (MaKho" +
728 "a = @MaKhoa)";
729 this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
730 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
731 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
732 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
733 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenKhoa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
734 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
735 }
736
737 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
738 private void InitConnection() {
739 this._connection = new global::System.Data.SqlClient.SqlConnection();
740 this._connection.ConnectionString = global::Quản_lý_điểm_sinh_vien_CNTT.Properties.Settings.Default.QuanlydiemConnectionString2;
741 }
742
743 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
744 private void InitCommandCollection() {
745 this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
746 this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
747 this._commandCollection[0].Connection = this.Connection;
748 this._commandCollection[0].CommandText = "SELECT MaKhoa, TenKhoa FROM dbo.tblKHOA";
749 this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
750 }
751
752 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
753 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
754 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
755 public virtual int Fill(QuanlydiemDataSet34.tblKHOADataTable dataTable) {
756 this.Adapter.SelectCommand = this.CommandCollection[0];
757 if ((this.ClearBeforeFill == true)) {
758 dataTable.Clear();
759 }
760 int returnValue = this.Adapter.Fill(dataTable);
761 return returnValue;
762 }
763
764 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
765 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
766 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
767 public virtual QuanlydiemDataSet34.tblKHOADataTable GetData() {
768 this.Adapter.SelectCommand = this.CommandCollection[0];
769 QuanlydiemDataSet34.tblKHOADataTable dataTable = new QuanlydiemDataSet34.tblKHOADataTable();
770 this.Adapter.Fill(dataTable);
771 return dataTable;
772 }
773
774 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
775 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
776 public virtual int Update(QuanlydiemDataSet34.tblKHOADataTable dataTable) {
777 return this.Adapter.Update(dataTable);
778 }
779
780 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
781 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
782 public virtual int Update(QuanlydiemDataSet34 dataSet) {
783 return this.Adapter.Update(dataSet, "tblKHOA");
784 }
785
786 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
787 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
788 public virtual int Update(global::System.Data.DataRow dataRow) {
789 return this.Adapter.Update(new global::System.Data.DataRow[] {
790 dataRow});
791 }
792
793 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
794 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
795 public virtual int Update(global::System.Data.DataRow[] dataRows) {
796 return this.Adapter.Update(dataRows);
797 }
798
799 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
800 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
801 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
802 public virtual int Delete(string Original_MaKhoa, string Original_TenKhoa) {
803 if ((Original_MaKhoa == null)) {
804 throw new global::System.ArgumentNullException("Original_MaKhoa");
805 }
806 else {
807 this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_MaKhoa));
808 }
809 if ((Original_TenKhoa == null)) {
810 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
811 this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
812 }
813 else {
814 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
815 this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_TenKhoa));
816 }
817 global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
818 if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
819 != global::System.Data.ConnectionState.Open)) {
820 this.Adapter.DeleteCommand.Connection.Open();
821 }
822 try {
823 int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
824 return returnValue;
825 }
826 finally {
827 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
828 this.Adapter.DeleteCommand.Connection.Close();
829 }
830 }
831 }
832
833 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
834 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
835 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
836 public virtual int Insert(string MaKhoa, string TenKhoa) {
837 if ((MaKhoa == null)) {
838 throw new global::System.ArgumentNullException("MaKhoa");
839 }
840 else {
841 this.Adapter.InsertCommand.Parameters[0].Value = ((string)(MaKhoa));
842 }
843 if ((TenKhoa == null)) {
844 this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
845 }
846 else {
847 this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TenKhoa));
848 }
849 global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
850 if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
851 != global::System.Data.ConnectionState.Open)) {
852 this.Adapter.InsertCommand.Connection.Open();
853 }
854 try {
855 int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
856 return returnValue;
857 }
858 finally {
859 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
860 this.Adapter.InsertCommand.Connection.Close();
861 }
862 }
863 }
864
865 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
866 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
867 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
868 public virtual int Update(string MaKhoa, string TenKhoa, string Original_MaKhoa, string Original_TenKhoa) {
869 if ((MaKhoa == null)) {
870 throw new global::System.ArgumentNullException("MaKhoa");
871 }
872 else {
873 this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(MaKhoa));
874 }
875 if ((TenKhoa == null)) {
876 this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
877 }
878 else {
879 this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TenKhoa));
880 }
881 if ((Original_MaKhoa == null)) {
882 throw new global::System.ArgumentNullException("Original_MaKhoa");
883 }
884 else {
885 this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Original_MaKhoa));
886 }
887 if ((Original_TenKhoa == null)) {
888 this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(1));
889 this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
890 }
891 else {
892 this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0));
893 this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_TenKhoa));
894 }
895 global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
896 if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
897 != global::System.Data.ConnectionState.Open)) {
898 this.Adapter.UpdateCommand.Connection.Open();
899 }
900 try {
901 int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
902 return returnValue;
903 }
904 finally {
905 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
906 this.Adapter.UpdateCommand.Connection.Close();
907 }
908 }
909 }
910
911 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
912 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
913 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
914 public virtual int Update(string TenKhoa, string Original_MaKhoa, string Original_TenKhoa) {
915 return this.Update(Original_MaKhoa, TenKhoa, Original_MaKhoa, Original_TenKhoa);
916 }
917 }
918
919 /// <summary>
920 ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
921 ///</summary>
922 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
923 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
924 [global::System.ComponentModel.ToolboxItem(true)]
925 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
926 "esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
927 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
928 public partial class TableAdapterManager : global::System.ComponentModel.Component {
929
930 private UpdateOrderOption _updateOrder;
931
932 private tblKHOATableAdapter _tblKHOATableAdapter;
933
934 private bool _backupDataSetBeforeUpdate;
935
936 private global::System.Data.IDbConnection _connection;
937
938 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
939 public UpdateOrderOption UpdateOrder {
940 get {
941 return this._updateOrder;
942 }
943 set {
944 this._updateOrder = value;
945 }
946 }
947
948 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
949 [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
950 "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
951 "", "System.Drawing.Design.UITypeEditor")]
952 public tblKHOATableAdapter tblKHOATableAdapter {
953 get {
954 return this._tblKHOATableAdapter;
955 }
956 set {
957 this._tblKHOATableAdapter = value;
958 }
959 }
960
961 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
962 public bool BackupDataSetBeforeUpdate {
963 get {
964 return this._backupDataSetBeforeUpdate;
965 }
966 set {
967 this._backupDataSetBeforeUpdate = value;
968 }
969 }
970
971 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
972 [global::System.ComponentModel.Browsable(false)]
973 public global::System.Data.IDbConnection Connection {
974 get {
975 if ((this._connection != null)) {
976 return this._connection;
977 }
978 if (((this._tblKHOATableAdapter != null)
979 && (this._tblKHOATableAdapter.Connection != null))) {
980 return this._tblKHOATableAdapter.Connection;
981 }
982 return null;
983 }
984 set {
985 this._connection = value;
986 }
987 }
988
989 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
990 [global::System.ComponentModel.Browsable(false)]
991 public int TableAdapterInstanceCount {
992 get {
993 int count = 0;
994 if ((this._tblKHOATableAdapter != null)) {
995 count = (count + 1);
996 }
997 return count;
998 }
999 }
1000
1001 /// <summary>
1002 ///Update rows in top-down order.
1003 ///</summary>
1004 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1005 private int UpdateUpdatedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1006 int result = 0;
1007 if ((this._tblKHOATableAdapter != null)) {
1008 global::System.Data.DataRow[] updatedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1009 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
1010 if (((updatedRows != null)
1011 && (0 < updatedRows.Length))) {
1012 result = (result + this._tblKHOATableAdapter.Update(updatedRows));
1013 allChangedRows.AddRange(updatedRows);
1014 }
1015 }
1016 return result;
1017 }
1018
1019 /// <summary>
1020 ///Insert rows in top-down order.
1021 ///</summary>
1022 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1023 private int UpdateInsertedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1024 int result = 0;
1025 if ((this._tblKHOATableAdapter != null)) {
1026 global::System.Data.DataRow[] addedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.Added);
1027 if (((addedRows != null)
1028 && (0 < addedRows.Length))) {
1029 result = (result + this._tblKHOATableAdapter.Update(addedRows));
1030 allAddedRows.AddRange(addedRows);
1031 }
1032 }
1033 return result;
1034 }
1035
1036 /// <summary>
1037 ///Delete rows in bottom-up order.
1038 ///</summary>
1039 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1040 private int UpdateDeletedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1041 int result = 0;
1042 if ((this._tblKHOATableAdapter != null)) {
1043 global::System.Data.DataRow[] deletedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1044 if (((deletedRows != null)
1045 && (0 < deletedRows.Length))) {
1046 result = (result + this._tblKHOATableAdapter.Update(deletedRows));
1047 allChangedRows.AddRange(deletedRows);
1048 }
1049 }
1050 return result;
1051 }
1052
1053 /// <summary>
1054 ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1055 ///</summary>
1056 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1057 private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1058 if (((updatedRows == null)
1059 || (updatedRows.Length < 1))) {
1060 return updatedRows;
1061 }
1062 if (((allAddedRows == null)
1063 || (allAddedRows.Count < 1))) {
1064 return updatedRows;
1065 }
1066 global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1067 for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1068 global::System.Data.DataRow row = updatedRows[i];
1069 if ((allAddedRows.Contains(row) == false)) {
1070 realUpdatedRows.Add(row);
1071 }
1072 }
1073 return realUpdatedRows.ToArray();
1074 }
1075
1076 /// <summary>
1077 ///Update all changes to the dataset.
1078 ///</summary>
1079 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1080 public virtual int UpdateAll(QuanlydiemDataSet34 dataSet) {
1081 if ((dataSet == null)) {
1082 throw new global::System.ArgumentNullException("dataSet");
1083 }
1084 if ((dataSet.HasChanges() == false)) {
1085 return 0;
1086 }
1087 if (((this._tblKHOATableAdapter != null)
1088 && (this.MatchTableAdapterConnection(this._tblKHOATableAdapter.Connection) == false))) {
1089 throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1090 "tring.");
1091 }
1092 global::System.Data.IDbConnection workConnection = this.Connection;
1093 if ((workConnection == null)) {
1094 throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1095 "ger TableAdapter property to a valid TableAdapter instance.");
1096 }
1097 bool workConnOpened = false;
1098 if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1099 == global::System.Data.ConnectionState.Broken)) {
1100 workConnection.Close();
1101 }
1102 if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1103 workConnection.Open();
1104 workConnOpened = true;
1105 }
1106 global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1107 if ((workTransaction == null)) {
1108 throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1109 "ctions or the current state is not allowing the transaction to begin.");
1110 }
1111 global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1112 global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1113 global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1114 global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1115 int result = 0;
1116 global::System.Data.DataSet backupDataSet = null;
1117 if (this.BackupDataSetBeforeUpdate) {
1118 backupDataSet = new global::System.Data.DataSet();
1119 backupDataSet.Merge(dataSet);
1120 }
1121 try {
1122 // ---- Prepare for update -----------
1123 //
1124 if ((this._tblKHOATableAdapter != null)) {
1125 revertConnections.Add(this._tblKHOATableAdapter, this._tblKHOATableAdapter.Connection);
1126 this._tblKHOATableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1127 this._tblKHOATableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1128 if (this._tblKHOATableAdapter.Adapter.AcceptChangesDuringUpdate) {
1129 this._tblKHOATableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1130 adaptersWithAcceptChangesDuringUpdate.Add(this._tblKHOATableAdapter.Adapter);
1131 }
1132 }
1133 //
1134 //---- Perform updates -----------
1135 //
1136 if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1137 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1138 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1139 }
1140 else {
1141 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1142 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1143 }
1144 result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
1145 //
1146 //---- Commit updates -----------
1147 //
1148 workTransaction.Commit();
1149 if ((0 < allAddedRows.Count)) {
1150 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1151 allAddedRows.CopyTo(rows);
1152 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1153 global::System.Data.DataRow row = rows[i];
1154 row.AcceptChanges();
1155 }
1156 }
1157 if ((0 < allChangedRows.Count)) {
1158 global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1159 allChangedRows.CopyTo(rows);
1160 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1161 global::System.Data.DataRow row = rows[i];
1162 row.AcceptChanges();
1163 }
1164 }
1165 }
1166 catch (global::System.Exception ex) {
1167 workTransaction.Rollback();
1168 // ---- Restore the dataset -----------
1169 if (this.BackupDataSetBeforeUpdate) {
1170 global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1171 dataSet.Clear();
1172 dataSet.Merge(backupDataSet);
1173 }
1174 else {
1175 if ((0 < allAddedRows.Count)) {
1176 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1177 allAddedRows.CopyTo(rows);
1178 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1179 global::System.Data.DataRow row = rows[i];
1180 row.AcceptChanges();
1181 row.SetAdded();
1182 }
1183 }
1184 }
1185 throw ex;
1186 }
1187 finally {
1188 if (workConnOpened) {
1189 workConnection.Close();
1190 }
1191 if ((this._tblKHOATableAdapter != null)) {
1192 this._tblKHOATableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._tblKHOATableAdapter]));
1193 this._tblKHOATableAdapter.Transaction = null;
1194 }
1195 if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1196 global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1197 adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1198 for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1199 global::System.Data.Common.DataAdapter adapter = adapters[i];
1200 adapter.AcceptChangesDuringUpdate = true;
1201 }
1202 }
1203 }
1204 return result;
1205 }
1206
1207 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1208 protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1209 global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1210 }
1211
1212 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1213 protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1214 if ((this._connection != null)) {
1215 return true;
1216 }
1217 if (((this.Connection == null)
1218 || (inputConnection == null))) {
1219 return true;
1220 }
1221 if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1222 return true;
1223 }
1224 return false;
1225 }
1226
1227 /// <summary>
1228 ///Update Order Option
1229 ///</summary>
1230 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1231 public enum UpdateOrderOption {
1232
1233 InsertUpdateDelete = 0,
1234
1235 UpdateInsertDelete = 1,
1236 }
1237
1238 /// <summary>
1239 ///Used to sort self-referenced table's rows
1240 ///</summary>
1241 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1242 private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1243
1244 private global::System.Data.DataRelation _relation;
1245
1246 private int _childFirst;
1247
1248 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1249 internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1250 this._relation = relation;
1251 if (childFirst) {
1252 this._childFirst = -1;
1253 }
1254 else {
1255 this._childFirst = 1;
1256 }
1257 }
1258
1259 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1260 private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
1261 global::System.Diagnostics.Debug.Assert((child != null));
1262 global::System.Diagnostics.Debug.Assert((parent != null));
1263 global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1264 for (
1265 ; ((newParent != null)
1266 && ((object.ReferenceEquals(newParent, child) == false)
1267 && (object.ReferenceEquals(newParent, parent) == false)));
1268 ) {
1269 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1270 }
1271 if ((newParent == null)) {
1272 for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null)
1273 && ((object.ReferenceEquals(newParent, child) == false)
1274 && (object.ReferenceEquals(newParent, parent) == false)));
1275 ) {
1276 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
1277 }
1278 }
1279 if (object.ReferenceEquals(newParent, parent)) {
1280 return true;
1281 }
1282 return false;
1283 }
1284
1285 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1286 public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1287 if (object.ReferenceEquals(row1, row2)) {
1288 return 0;
1289 }
1290 if ((row1 == null)) {
1291 return -1;
1292 }
1293 if ((row2 == null)) {
1294 return 1;
1295 }
1296
1297 // Is row1 the child or grandchild of row2
1298 if (this.IsChildAndParent(row1, row2)) {
1299 return this._childFirst;
1300 }
1301
1302 // Is row2 the child or grandchild of row1
1303 if (this.IsChildAndParent(row2, row1)) {
1304 return (-1 * this._childFirst);
1305 }
1306 return 0;
1307 }
1308 }
1309 }
1310 }
1311
1312 #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 Quản_lý_điểm_sinh_vien_CNTT {
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("QuanlydiemDataSet34")]
25 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
26 public partial class QuanlydiemDataSet34 : global::System.Data.DataSet {
27
28 private tblKHOADataTable tabletblKHOA;
29
30 private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
31
32 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
33 public QuanlydiemDataSet34() {
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 QuanlydiemDataSet34(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["tblKHOA"] != null)) {
57 base.Tables.Add(new tblKHOADataTable(ds.Tables["tblKHOA"]));
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 tblKHOADataTable tblKHOA {
81 get {
82 return this.tabletblKHOA;
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 QuanlydiemDataSet34 cln = ((QuanlydiemDataSet34)(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["tblKHOA"] != null)) {
146 base.Tables.Add(new tblKHOADataTable(ds.Tables["tblKHOA"]));
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.tabletblKHOA = ((tblKHOADataTable)(base.Tables["tblKHOA"]));
179 if ((initTable == true)) {
180 if ((this.tabletblKHOA != null)) {
181 this.tabletblKHOA.InitVars();
182 }
183 }
184 }
185
186 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
187 private void InitClass() {
188 this.DataSetName = "QuanlydiemDataSet34";
189 this.Prefix = "";
190 this.Namespace = "http://tempuri.org/QuanlydiemDataSet34.xsd";
191 this.EnforceConstraints = true;
192 this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
193 this.tabletblKHOA = new tblKHOADataTable();
194 base.Tables.Add(this.tabletblKHOA);
195 }
196
197 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
198 private bool ShouldSerializetblKHOA() {
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 QuanlydiemDataSet34 ds = new QuanlydiemDataSet34();
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 tblKHOARowChangeEventHandler(object sender, tblKHOARowChangeEvent 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 tblKHOADataTable : global::System.Data.TypedTableBase<tblKHOARow> {
264
265 private global::System.Data.DataColumn columnMaKhoa;
266
267 private global::System.Data.DataColumn columnTenKhoa;
268
269 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
270 public tblKHOADataTable() {
271 this.TableName = "tblKHOA";
272 this.BeginInit();
273 this.InitClass();
274 this.EndInit();
275 }
276
277 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
278 internal tblKHOADataTable(global::System.Data.DataTable table) {
279 this.TableName = table.TableName;
280 if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
281 this.CaseSensitive = table.CaseSensitive;
282 }
283 if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
284 this.Locale = table.Locale;
285 }
286 if ((table.Namespace != table.DataSet.Namespace)) {
287 this.Namespace = table.Namespace;
288 }
289 this.Prefix = table.Prefix;
290 this.MinimumCapacity = table.MinimumCapacity;
291 }
292
293 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
294 protected tblKHOADataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
295 base(info, context) {
296 this.InitVars();
297 }
298
299 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
300 public global::System.Data.DataColumn MaKhoaColumn {
301 get {
302 return this.columnMaKhoa;
303 }
304 }
305
306 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
307 public global::System.Data.DataColumn TenKhoaColumn {
308 get {
309 return this.columnTenKhoa;
310 }
311 }
312
313 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
314 [global::System.ComponentModel.Browsable(false)]
315 public int Count {
316 get {
317 return this.Rows.Count;
318 }
319 }
320
321 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
322 public tblKHOARow this[int index] {
323 get {
324 return ((tblKHOARow)(this.Rows[index]));
325 }
326 }
327
328 public event tblKHOARowChangeEventHandler tblKHOARowChanging;
329
330 public event tblKHOARowChangeEventHandler tblKHOARowChanged;
331
332 public event tblKHOARowChangeEventHandler tblKHOARowDeleting;
333
334 public event tblKHOARowChangeEventHandler tblKHOARowDeleted;
335
336 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
337 public void AddtblKHOARow(tblKHOARow row) {
338 this.Rows.Add(row);
339 }
340
341 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
342 public tblKHOARow AddtblKHOARow(string MaKhoa, string TenKhoa) {
343 tblKHOARow rowtblKHOARow = ((tblKHOARow)(this.NewRow()));
344 object[] columnValuesArray = new object[] {
345 MaKhoa,
346 TenKhoa};
347 rowtblKHOARow.ItemArray = columnValuesArray;
348 this.Rows.Add(rowtblKHOARow);
349 return rowtblKHOARow;
350 }
351
352 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
353 public tblKHOARow FindByMaKhoa(string MaKhoa) {
354 return ((tblKHOARow)(this.Rows.Find(new object[] {
355 MaKhoa})));
356 }
357
358 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
359 public override global::System.Data.DataTable Clone() {
360 tblKHOADataTable cln = ((tblKHOADataTable)(base.Clone()));
361 cln.InitVars();
362 return cln;
363 }
364
365 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
366 protected override global::System.Data.DataTable CreateInstance() {
367 return new tblKHOADataTable();
368 }
369
370 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
371 internal void InitVars() {
372 this.columnMaKhoa = base.Columns["MaKhoa"];
373 this.columnTenKhoa = base.Columns["TenKhoa"];
374 }
375
376 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
377 private void InitClass() {
378 this.columnMaKhoa = new global::System.Data.DataColumn("MaKhoa", typeof(string), null, global::System.Data.MappingType.Element);
379 base.Columns.Add(this.columnMaKhoa);
380 this.columnTenKhoa = new global::System.Data.DataColumn("TenKhoa", typeof(string), null, global::System.Data.MappingType.Element);
381 base.Columns.Add(this.columnTenKhoa);
382 this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
383 this.columnMaKhoa}, true));
384 this.columnMaKhoa.AllowDBNull = false;
385 this.columnMaKhoa.Unique = true;
386 this.columnMaKhoa.MaxLength = 10;
387 this.columnTenKhoa.MaxLength = 30;
388 }
389
390 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
391 public tblKHOARow NewtblKHOARow() {
392 return ((tblKHOARow)(this.NewRow()));
393 }
394
395 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
396 protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
397 return new tblKHOARow(builder);
398 }
399
400 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
401 protected override global::System.Type GetRowType() {
402 return typeof(tblKHOARow);
403 }
404
405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
406 protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
407 base.OnRowChanged(e);
408 if ((this.tblKHOARowChanged != null)) {
409 this.tblKHOARowChanged(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
410 }
411 }
412
413 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
414 protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
415 base.OnRowChanging(e);
416 if ((this.tblKHOARowChanging != null)) {
417 this.tblKHOARowChanging(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
418 }
419 }
420
421 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
422 protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
423 base.OnRowDeleted(e);
424 if ((this.tblKHOARowDeleted != null)) {
425 this.tblKHOARowDeleted(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
426 }
427 }
428
429 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
430 protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
431 base.OnRowDeleting(e);
432 if ((this.tblKHOARowDeleting != null)) {
433 this.tblKHOARowDeleting(this, new tblKHOARowChangeEvent(((tblKHOARow)(e.Row)), e.Action));
434 }
435 }
436
437 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
438 public void RemovetblKHOARow(tblKHOARow row) {
439 this.Rows.Remove(row);
440 }
441
442 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
443 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
444 global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
445 global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
446 QuanlydiemDataSet34 ds = new QuanlydiemDataSet34();
447 global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
448 any1.Namespace = "http://www.w3.org/2001/XMLSchema";
449 any1.MinOccurs = new decimal(0);
450 any1.MaxOccurs = decimal.MaxValue;
451 any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
452 sequence.Items.Add(any1);
453 global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
454 any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
455 any2.MinOccurs = new decimal(1);
456 any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
457 sequence.Items.Add(any2);
458 global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
459 attribute1.Name = "namespace";
460 attribute1.FixedValue = ds.Namespace;
461 type.Attributes.Add(attribute1);
462 global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
463 attribute2.Name = "tableTypeName";
464 attribute2.FixedValue = "tblKHOADataTable";
465 type.Attributes.Add(attribute2);
466 type.Particle = sequence;
467 global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
468 if (xs.Contains(dsSchema.TargetNamespace)) {
469 global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
470 global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
471 try {
472 global::System.Xml.Schema.XmlSchema schema = null;
473 dsSchema.Write(s1);
474 for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
475 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
476 s2.SetLength(0);
477 schema.Write(s2);
478 if ((s1.Length == s2.Length)) {
479 s1.Position = 0;
480 s2.Position = 0;
481 for (; ((s1.Position != s1.Length)
482 && (s1.ReadByte() == s2.ReadByte())); ) {
483 ;
484 }
485 if ((s1.Position == s1.Length)) {
486 return type;
487 }
488 }
489 }
490 }
491 finally {
492 if ((s1 != null)) {
493 s1.Close();
494 }
495 if ((s2 != null)) {
496 s2.Close();
497 }
498 }
499 }
500 xs.Add(dsSchema);
501 return type;
502 }
503 }
504
505 /// <summary>
506 ///Represents strongly named DataRow class.
507 ///</summary>
508 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
509 public partial class tblKHOARow : global::System.Data.DataRow {
510
511 private tblKHOADataTable tabletblKHOA;
512
513 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
514 internal tblKHOARow(global::System.Data.DataRowBuilder rb) :
515 base(rb) {
516 this.tabletblKHOA = ((tblKHOADataTable)(this.Table));
517 }
518
519 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
520 public string MaKhoa {
521 get {
522 return ((string)(this[this.tabletblKHOA.MaKhoaColumn]));
523 }
524 set {
525 this[this.tabletblKHOA.MaKhoaColumn] = value;
526 }
527 }
528
529 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
530 public string TenKhoa {
531 get {
532 try {
533 return ((string)(this[this.tabletblKHOA.TenKhoaColumn]));
534 }
535 catch (global::System.InvalidCastException e) {
536 throw new global::System.Data.StrongTypingException("The value for column \'TenKhoa\' in table \'tblKHOA\' is DBNull.", e);
537 }
538 }
539 set {
540 this[this.tabletblKHOA.TenKhoaColumn] = value;
541 }
542 }
543
544 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
545 public bool IsTenKhoaNull() {
546 return this.IsNull(this.tabletblKHOA.TenKhoaColumn);
547 }
548
549 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
550 public void SetTenKhoaNull() {
551 this[this.tabletblKHOA.TenKhoaColumn] = global::System.Convert.DBNull;
552 }
553 }
554
555 /// <summary>
556 ///Row event argument class
557 ///</summary>
558 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
559 public class tblKHOARowChangeEvent : global::System.EventArgs {
560
561 private tblKHOARow eventRow;
562
563 private global::System.Data.DataRowAction eventAction;
564
565 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
566 public tblKHOARowChangeEvent(tblKHOARow row, global::System.Data.DataRowAction action) {
567 this.eventRow = row;
568 this.eventAction = action;
569 }
570
571 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
572 public tblKHOARow Row {
573 get {
574 return this.eventRow;
575 }
576 }
577
578 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
579 public global::System.Data.DataRowAction Action {
580 get {
581 return this.eventAction;
582 }
583 }
584 }
585 }
586 }
587 namespace Quản_lý_điểm_sinh_vien_CNTT.QuanlydiemDataSet34TableAdapters {
588
589
590 /// <summary>
591 ///Represents the connection and commands used to retrieve and save data.
592 ///</summary>
593 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
594 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
595 [global::System.ComponentModel.ToolboxItem(true)]
596 [global::System.ComponentModel.DataObjectAttribute(true)]
597 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
598 ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
599 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
600 public partial class tblKHOATableAdapter : global::System.ComponentModel.Component {
601
602 private global::System.Data.SqlClient.SqlDataAdapter _adapter;
603
604 private global::System.Data.SqlClient.SqlConnection _connection;
605
606 private global::System.Data.SqlClient.SqlTransaction _transaction;
607
608 private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
609
610 private bool _clearBeforeFill;
611
612 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
613 public tblKHOATableAdapter() {
614 this.ClearBeforeFill = true;
615 }
616
617 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
618 protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
619 get {
620 if ((this._adapter == null)) {
621 this.InitAdapter();
622 }
623 return this._adapter;
624 }
625 }
626
627 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
628 internal global::System.Data.SqlClient.SqlConnection Connection {
629 get {
630 if ((this._connection == null)) {
631 this.InitConnection();
632 }
633 return this._connection;
634 }
635 set {
636 this._connection = value;
637 if ((this.Adapter.InsertCommand != null)) {
638 this.Adapter.InsertCommand.Connection = value;
639 }
640 if ((this.Adapter.DeleteCommand != null)) {
641 this.Adapter.DeleteCommand.Connection = value;
642 }
643 if ((this.Adapter.UpdateCommand != null)) {
644 this.Adapter.UpdateCommand.Connection = value;
645 }
646 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
647 if ((this.CommandCollection[i] != null)) {
648 ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
649 }
650 }
651 }
652 }
653
654 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
655 internal global::System.Data.SqlClient.SqlTransaction Transaction {
656 get {
657 return this._transaction;
658 }
659 set {
660 this._transaction = value;
661 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
662 this.CommandCollection[i].Transaction = this._transaction;
663 }
664 if (((this.Adapter != null)
665 && (this.Adapter.DeleteCommand != null))) {
666 this.Adapter.DeleteCommand.Transaction = this._transaction;
667 }
668 if (((this.Adapter != null)
669 && (this.Adapter.InsertCommand != null))) {
670 this.Adapter.InsertCommand.Transaction = this._transaction;
671 }
672 if (((this.Adapter != null)
673 && (this.Adapter.UpdateCommand != null))) {
674 this.Adapter.UpdateCommand.Transaction = this._transaction;
675 }
676 }
677 }
678
679 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
680 protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
681 get {
682 if ((this._commandCollection == null)) {
683 this.InitCommandCollection();
684 }
685 return this._commandCollection;
686 }
687 }
688
689 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
690 public bool ClearBeforeFill {
691 get {
692 return this._clearBeforeFill;
693 }
694 set {
695 this._clearBeforeFill = value;
696 }
697 }
698
699 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
700 private void InitAdapter() {
701 this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
702 global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
703 tableMapping.SourceTable = "Table";
704 tableMapping.DataSetTable = "tblKHOA";
705 tableMapping.ColumnMappings.Add("MaKhoa", "MaKhoa");
706 tableMapping.ColumnMappings.Add("TenKhoa", "TenKhoa");
707 this._adapter.TableMappings.Add(tableMapping);
708 this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
709 this._adapter.DeleteCommand.Connection = this.Connection;
710 this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[tblKHOA] WHERE (([MaKhoa] = @Original_MaKhoa) AND ((@IsNull_Te" +
711 "nKhoa = 1 AND [TenKhoa] IS NULL) OR ([TenKhoa] = @Original_TenKhoa)))";
712 this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
713 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
714 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenKhoa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
715 this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
716 this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
717 this._adapter.InsertCommand.Connection = this.Connection;
718 this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[tblKHOA] ([MaKhoa], [TenKhoa]) VALUES (@MaKhoa, @TenKhoa);\r\nSE" +
719 "LECT MaKhoa, TenKhoa FROM tblKHOA WHERE (MaKhoa = @MaKhoa)";
720 this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
721 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
722 this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
723 this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
724 this._adapter.UpdateCommand.Connection = this.Connection;
725 this._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[tblKHOA] SET [MaKhoa] = @MaKhoa, [TenKhoa] = @TenKhoa WHERE (([MaKh" +
726 "oa] = @Original_MaKhoa) AND ((@IsNull_TenKhoa = 1 AND [TenKhoa] IS NULL) OR ([Te" +
727 "nKhoa] = @Original_TenKhoa)));\r\nSELECT MaKhoa, TenKhoa FROM tblKHOA WHERE (MaKho" +
728 "a = @MaKhoa)";
729 this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
730 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
731 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
732 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
733 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TenKhoa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
734 this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenKhoa", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenKhoa", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
735 }
736
737 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
738 private void InitConnection() {
739 this._connection = new global::System.Data.SqlClient.SqlConnection();
740 this._connection.ConnectionString = global::Quản_lý_điểm_sinh_vien_CNTT.Properties.Settings.Default.QuanlydiemConnectionString2;
741 }
742
743 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
744 private void InitCommandCollection() {
745 this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
746 this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
747 this._commandCollection[0].Connection = this.Connection;
748 this._commandCollection[0].CommandText = "SELECT MaKhoa, TenKhoa FROM dbo.tblKHOA";
749 this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
750 }
751
752 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
753 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
754 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
755 public virtual int Fill(QuanlydiemDataSet34.tblKHOADataTable dataTable) {
756 this.Adapter.SelectCommand = this.CommandCollection[0];
757 if ((this.ClearBeforeFill == true)) {
758 dataTable.Clear();
759 }
760 int returnValue = this.Adapter.Fill(dataTable);
761 return returnValue;
762 }
763
764 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
765 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
766 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
767 public virtual QuanlydiemDataSet34.tblKHOADataTable GetData() {
768 this.Adapter.SelectCommand = this.CommandCollection[0];
769 QuanlydiemDataSet34.tblKHOADataTable dataTable = new QuanlydiemDataSet34.tblKHOADataTable();
770 this.Adapter.Fill(dataTable);
771 return dataTable;
772 }
773
774 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
775 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
776 public virtual int Update(QuanlydiemDataSet34.tblKHOADataTable dataTable) {
777 return this.Adapter.Update(dataTable);
778 }
779
780 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
781 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
782 public virtual int Update(QuanlydiemDataSet34 dataSet) {
783 return this.Adapter.Update(dataSet, "tblKHOA");
784 }
785
786 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
787 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
788 public virtual int Update(global::System.Data.DataRow dataRow) {
789 return this.Adapter.Update(new global::System.Data.DataRow[] {
790 dataRow});
791 }
792
793 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
794 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
795 public virtual int Update(global::System.Data.DataRow[] dataRows) {
796 return this.Adapter.Update(dataRows);
797 }
798
799 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
800 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
801 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
802 public virtual int Delete(string Original_MaKhoa, string Original_TenKhoa) {
803 if ((Original_MaKhoa == null)) {
804 throw new global::System.ArgumentNullException("Original_MaKhoa");
805 }
806 else {
807 this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_MaKhoa));
808 }
809 if ((Original_TenKhoa == null)) {
810 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
811 this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
812 }
813 else {
814 this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
815 this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_TenKhoa));
816 }
817 global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
818 if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
819 != global::System.Data.ConnectionState.Open)) {
820 this.Adapter.DeleteCommand.Connection.Open();
821 }
822 try {
823 int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
824 return returnValue;
825 }
826 finally {
827 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
828 this.Adapter.DeleteCommand.Connection.Close();
829 }
830 }
831 }
832
833 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
834 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
835 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
836 public virtual int Insert(string MaKhoa, string TenKhoa) {
837 if ((MaKhoa == null)) {
838 throw new global::System.ArgumentNullException("MaKhoa");
839 }
840 else {
841 this.Adapter.InsertCommand.Parameters[0].Value = ((string)(MaKhoa));
842 }
843 if ((TenKhoa == null)) {
844 this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
845 }
846 else {
847 this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TenKhoa));
848 }
849 global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
850 if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
851 != global::System.Data.ConnectionState.Open)) {
852 this.Adapter.InsertCommand.Connection.Open();
853 }
854 try {
855 int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
856 return returnValue;
857 }
858 finally {
859 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
860 this.Adapter.InsertCommand.Connection.Close();
861 }
862 }
863 }
864
865 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
866 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
867 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
868 public virtual int Update(string MaKhoa, string TenKhoa, string Original_MaKhoa, string Original_TenKhoa) {
869 if ((MaKhoa == null)) {
870 throw new global::System.ArgumentNullException("MaKhoa");
871 }
872 else {
873 this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(MaKhoa));
874 }
875 if ((TenKhoa == null)) {
876 this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
877 }
878 else {
879 this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TenKhoa));
880 }
881 if ((Original_MaKhoa == null)) {
882 throw new global::System.ArgumentNullException("Original_MaKhoa");
883 }
884 else {
885 this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Original_MaKhoa));
886 }
887 if ((Original_TenKhoa == null)) {
888 this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(1));
889 this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
890 }
891 else {
892 this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0));
893 this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_TenKhoa));
894 }
895 global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
896 if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
897 != global::System.Data.ConnectionState.Open)) {
898 this.Adapter.UpdateCommand.Connection.Open();
899 }
900 try {
901 int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
902 return returnValue;
903 }
904 finally {
905 if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
906 this.Adapter.UpdateCommand.Connection.Close();
907 }
908 }
909 }
910
911 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
912 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
913 [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
914 public virtual int Update(string TenKhoa, string Original_MaKhoa, string Original_TenKhoa) {
915 return this.Update(Original_MaKhoa, TenKhoa, Original_MaKhoa, Original_TenKhoa);
916 }
917 }
918
919 /// <summary>
920 ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
921 ///</summary>
922 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
923 [global::System.ComponentModel.DesignerCategoryAttribute("code")]
924 [global::System.ComponentModel.ToolboxItem(true)]
925 [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
926 "esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
927 [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
928 public partial class TableAdapterManager : global::System.ComponentModel.Component {
929
930 private UpdateOrderOption _updateOrder;
931
932 private tblKHOATableAdapter _tblKHOATableAdapter;
933
934 private bool _backupDataSetBeforeUpdate;
935
936 private global::System.Data.IDbConnection _connection;
937
938 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
939 public UpdateOrderOption UpdateOrder {
940 get {
941 return this._updateOrder;
942 }
943 set {
944 this._updateOrder = value;
945 }
946 }
947
948 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
949 [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
950 "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
951 "", "System.Drawing.Design.UITypeEditor")]
952 public tblKHOATableAdapter tblKHOATableAdapter {
953 get {
954 return this._tblKHOATableAdapter;
955 }
956 set {
957 this._tblKHOATableAdapter = value;
958 }
959 }
960
961 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
962 public bool BackupDataSetBeforeUpdate {
963 get {
964 return this._backupDataSetBeforeUpdate;
965 }
966 set {
967 this._backupDataSetBeforeUpdate = value;
968 }
969 }
970
971 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
972 [global::System.ComponentModel.Browsable(false)]
973 public global::System.Data.IDbConnection Connection {
974 get {
975 if ((this._connection != null)) {
976 return this._connection;
977 }
978 if (((this._tblKHOATableAdapter != null)
979 && (this._tblKHOATableAdapter.Connection != null))) {
980 return this._tblKHOATableAdapter.Connection;
981 }
982 return null;
983 }
984 set {
985 this._connection = value;
986 }
987 }
988
989 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
990 [global::System.ComponentModel.Browsable(false)]
991 public int TableAdapterInstanceCount {
992 get {
993 int count = 0;
994 if ((this._tblKHOATableAdapter != null)) {
995 count = (count + 1);
996 }
997 return count;
998 }
999 }
1000
1001 /// <summary>
1002 ///Update rows in top-down order.
1003 ///</summary>
1004 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1005 private int UpdateUpdatedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1006 int result = 0;
1007 if ((this._tblKHOATableAdapter != null)) {
1008 global::System.Data.DataRow[] updatedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1009 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
1010 if (((updatedRows != null)
1011 && (0 < updatedRows.Length))) {
1012 result = (result + this._tblKHOATableAdapter.Update(updatedRows));
1013 allChangedRows.AddRange(updatedRows);
1014 }
1015 }
1016 return result;
1017 }
1018
1019 /// <summary>
1020 ///Insert rows in top-down order.
1021 ///</summary>
1022 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1023 private int UpdateInsertedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1024 int result = 0;
1025 if ((this._tblKHOATableAdapter != null)) {
1026 global::System.Data.DataRow[] addedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.Added);
1027 if (((addedRows != null)
1028 && (0 < addedRows.Length))) {
1029 result = (result + this._tblKHOATableAdapter.Update(addedRows));
1030 allAddedRows.AddRange(addedRows);
1031 }
1032 }
1033 return result;
1034 }
1035
1036 /// <summary>
1037 ///Delete rows in bottom-up order.
1038 ///</summary>
1039 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1040 private int UpdateDeletedRows(QuanlydiemDataSet34 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1041 int result = 0;
1042 if ((this._tblKHOATableAdapter != null)) {
1043 global::System.Data.DataRow[] deletedRows = dataSet.tblKHOA.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1044 if (((deletedRows != null)
1045 && (0 < deletedRows.Length))) {
1046 result = (result + this._tblKHOATableAdapter.Update(deletedRows));
1047 allChangedRows.AddRange(deletedRows);
1048 }
1049 }
1050 return result;
1051 }
1052
1053 /// <summary>
1054 ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1055 ///</summary>
1056 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1057 private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1058 if (((updatedRows == null)
1059 || (updatedRows.Length < 1))) {
1060 return updatedRows;
1061 }
1062 if (((allAddedRows == null)
1063 || (allAddedRows.Count < 1))) {
1064 return updatedRows;
1065 }
1066 global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1067 for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1068 global::System.Data.DataRow row = updatedRows[i];
1069 if ((allAddedRows.Contains(row) == false)) {
1070 realUpdatedRows.Add(row);
1071 }
1072 }
1073 return realUpdatedRows.ToArray();
1074 }
1075
1076 /// <summary>
1077 ///Update all changes to the dataset.
1078 ///</summary>
1079 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1080 public virtual int UpdateAll(QuanlydiemDataSet34 dataSet) {
1081 if ((dataSet == null)) {
1082 throw new global::System.ArgumentNullException("dataSet");
1083 }
1084 if ((dataSet.HasChanges() == false)) {
1085 return 0;
1086 }
1087 if (((this._tblKHOATableAdapter != null)
1088 && (this.MatchTableAdapterConnection(this._tblKHOATableAdapter.Connection) == false))) {
1089 throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1090 "tring.");
1091 }
1092 global::System.Data.IDbConnection workConnection = this.Connection;
1093 if ((workConnection == null)) {
1094 throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1095 "ger TableAdapter property to a valid TableAdapter instance.");
1096 }
1097 bool workConnOpened = false;
1098 if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1099 == global::System.Data.ConnectionState.Broken)) {
1100 workConnection.Close();
1101 }
1102 if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1103 workConnection.Open();
1104 workConnOpened = true;
1105 }
1106 global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1107 if ((workTransaction == null)) {
1108 throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1109 "ctions or the current state is not allowing the transaction to begin.");
1110 }
1111 global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1112 global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1113 global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1114 global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1115 int result = 0;
1116 global::System.Data.DataSet backupDataSet = null;
1117 if (this.BackupDataSetBeforeUpdate) {
1118 backupDataSet = new global::System.Data.DataSet();
1119 backupDataSet.Merge(dataSet);
1120 }
1121 try {
1122 // ---- Prepare for update -----------
1123 //
1124 if ((this._tblKHOATableAdapter != null)) {
1125 revertConnections.Add(this._tblKHOATableAdapter, this._tblKHOATableAdapter.Connection);
1126 this._tblKHOATableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1127 this._tblKHOATableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1128 if (this._tblKHOATableAdapter.Adapter.AcceptChangesDuringUpdate) {
1129 this._tblKHOATableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1130 adaptersWithAcceptChangesDuringUpdate.Add(this._tblKHOATableAdapter.Adapter);
1131 }
1132 }
1133 //
1134 //---- Perform updates -----------
1135 //
1136 if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1137 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1138 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1139 }
1140 else {
1141 result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
1142 result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1143 }
1144 result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
1145 //
1146 //---- Commit updates -----------
1147 //
1148 workTransaction.Commit();
1149 if ((0 < allAddedRows.Count)) {
1150 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1151 allAddedRows.CopyTo(rows);
1152 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1153 global::System.Data.DataRow row = rows[i];
1154 row.AcceptChanges();
1155 }
1156 }
1157 if ((0 < allChangedRows.Count)) {
1158 global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1159 allChangedRows.CopyTo(rows);
1160 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1161 global::System.Data.DataRow row = rows[i];
1162 row.AcceptChanges();
1163 }
1164 }
1165 }
1166 catch (global::System.Exception ex) {
1167 workTransaction.Rollback();
1168 // ---- Restore the dataset -----------
1169 if (this.BackupDataSetBeforeUpdate) {
1170 global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1171 dataSet.Clear();
1172 dataSet.Merge(backupDataSet);
1173 }
1174 else {
1175 if ((0 < allAddedRows.Count)) {
1176 global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1177 allAddedRows.CopyTo(rows);
1178 for (int i = 0; (i < rows.Length); i = (i + 1)) {
1179 global::System.Data.DataRow row = rows[i];
1180 row.AcceptChanges();
1181 row.SetAdded();
1182 }
1183 }
1184 }
1185 throw ex;
1186 }
1187 finally {
1188 if (workConnOpened) {
1189 workConnection.Close();
1190 }
1191 if ((this._tblKHOATableAdapter != null)) {
1192 this._tblKHOATableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._tblKHOATableAdapter]));
1193 this._tblKHOATableAdapter.Transaction = null;
1194 }
1195 if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1196 global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1197 adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1198 for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1199 global::System.Data.Common.DataAdapter adapter = adapters[i];
1200 adapter.AcceptChangesDuringUpdate = true;
1201 }
1202 }
1203 }
1204 return result;
1205 }
1206
1207 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1208 protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1209 global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1210 }
1211
1212 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1213 protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1214 if ((this._connection != null)) {
1215 return true;
1216 }
1217 if (((this.Connection == null)
1218 || (inputConnection == null))) {
1219 return true;
1220 }
1221 if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1222 return true;
1223 }
1224 return false;
1225 }
1226
1227 /// <summary>
1228 ///Update Order Option
1229 ///</summary>
1230 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1231 public enum UpdateOrderOption {
1232
1233 InsertUpdateDelete = 0,
1234
1235 UpdateInsertDelete = 1,
1236 }
1237
1238 /// <summary>
1239 ///Used to sort self-referenced table's rows
1240 ///</summary>
1241 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1242 private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1243
1244 private global::System.Data.DataRelation _relation;
1245
1246 private int _childFirst;
1247
1248 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1249 internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1250 this._relation = relation;
1251 if (childFirst) {
1252 this._childFirst = -1;
1253 }
1254 else {
1255 this._childFirst = 1;
1256 }
1257 }
1258
1259 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1260 private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
1261 global::System.Diagnostics.Debug.Assert((child != null));
1262 global::System.Diagnostics.Debug.Assert((parent != null));
1263 global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1264 for (
1265 ; ((newParent != null)
1266 && ((object.ReferenceEquals(newParent, child) == false)
1267 && (object.ReferenceEquals(newParent, parent) == false)));
1268 ) {
1269 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1270 }
1271 if ((newParent == null)) {
1272 for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null)
1273 && ((object.ReferenceEquals(newParent, child) == false)
1274 && (object.ReferenceEquals(newParent, parent) == false)));
1275 ) {
1276 newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
1277 }
1278 }
1279 if (object.ReferenceEquals(newParent, parent)) {
1280 return true;
1281 }
1282 return false;
1283 }
1284
1285 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1286 public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1287 if (object.ReferenceEquals(row1, row2)) {
1288 return 0;
1289 }
1290 if ((row1 == null)) {
1291 return -1;
1292 }
1293 if ((row2 == null)) {
1294 return 1;
1295 }
1296
1297 // Is row1 the child or grandchild of row2
1298 if (this.IsChildAndParent(row1, row2)) {
1299 return this._childFirst;
1300 }
1301
1302 // Is row2 the child or grandchild of row1
1303 if (this.IsChildAndParent(row2, row1)) {
1304 return (-1 * this._childFirst);
1305 }
1306 return 0;
1307 }
1308 }
1309 }
1310 }
1311
1312 #pragma warning restore 1591