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("QuanlydiemDataSet19")]
25     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
26     
public partial class QuanlydiemDataSet19 : global::System.Data.DataSet {
27         
28         
private tblMONDataTable tabletblMON;
29         
30         
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
31         
32         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
33         
public QuanlydiemDataSet19() {
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 QuanlydiemDataSet19(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["tblMON"] != null)) {
57                     
base.Tables.Add(new tblMONDataTable(ds.Tables["tblMON"]));
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 tblMONDataTable tblMON {
81             
get {
82                 
return this.tabletblMON;
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             QuanlydiemDataSet19 cln = ((QuanlydiemDataSet19)(
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["tblMON"] != null)) {
146                     
base.Tables.Add(new tblMONDataTable(ds.Tables["tblMON"]));
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.tabletblMON = ((tblMONDataTable)(base.Tables["tblMON"]));
179             
if ((initTable == true)) {
180                 
if ((this.tabletblMON != null)) {
181                     
this.tabletblMON.InitVars();
182                 }
183             }
184         }
185         
186         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
187         
private void InitClass() {
188             
this.DataSetName = "QuanlydiemDataSet19";
189             
this.Prefix = "";
190             
this.Namespace = "http://tempuri.org/QuanlydiemDataSet19.xsd";
191             
this.EnforceConstraints = true;
192             
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
193             
this.tabletblMON = new tblMONDataTable();
194             
base.Tables.Add(this.tabletblMON);
195         }
196         
197         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
198         
private bool ShouldSerializetblMON() {
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             QuanlydiemDataSet19 ds =
new QuanlydiemDataSet19();
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 tblMONRowChangeEventHandler(object sender, tblMONRowChangeEvent 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 tblMONDataTable : global::System.Data.TypedTableBase<tblMONRow> {
264             
265             
private global::System.Data.DataColumn columnMaMon;
266             
267             
private global::System.Data.DataColumn columnTenMon;
268             
269             
private global::System.Data.DataColumn columnSoDVHT;
270             
271             
private global::System.Data.DataColumn columnMaGV;
272             
273             
private global::System.Data.DataColumn columnHocKi;
274             
275             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
276             
public tblMONDataTable() {
277                 
this.TableName = "tblMON";
278                 
this.BeginInit();
279                 
this.InitClass();
280                 
this.EndInit();
281             }
282             
283             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
284             
internal tblMONDataTable(global::System.Data.DataTable table) {
285                 
this.TableName = table.TableName;
286                 
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
287                     
this.CaseSensitive = table.CaseSensitive;
288                 }
289                 
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
290                     
this.Locale = table.Locale;
291                 }
292                 
if ((table.Namespace != table.DataSet.Namespace)) {
293                     
this.Namespace = table.Namespace;
294                 }
295                 
this.Prefix = table.Prefix;
296                 
this.MinimumCapacity = table.MinimumCapacity;
297             }
298             
299             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
300             
protected tblMONDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
301                     
base(info, context) {
302                 
this.InitVars();
303             }
304             
305             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
306             
public global::System.Data.DataColumn MaMonColumn {
307                 
get {
308                     
return this.columnMaMon;
309                 }
310             }
311             
312             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
313             
public global::System.Data.DataColumn TenMonColumn {
314                 
get {
315                     
return this.columnTenMon;
316                 }
317             }
318             
319             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
320             
public global::System.Data.DataColumn SoDVHTColumn {
321                 
get {
322                     
return this.columnSoDVHT;
323                 }
324             }
325             
326             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
327             
public global::System.Data.DataColumn MaGVColumn {
328                 
get {
329                     
return this.columnMaGV;
330                 }
331             }
332             
333             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
334             
public global::System.Data.DataColumn HocKiColumn {
335                 
get {
336                     
return this.columnHocKi;
337                 }
338             }
339             
340             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
341             
[global::System.ComponentModel.Browsable(false)]
342             
public int Count {
343                 
get {
344                     
return this.Rows.Count;
345                 }
346             }
347             
348             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
349             
public tblMONRow this[int index] {
350                 
get {
351                     
return ((tblMONRow)(this.Rows[index]));
352                 }
353             }
354             
355             
public event tblMONRowChangeEventHandler tblMONRowChanging;
356             
357             
public event tblMONRowChangeEventHandler tblMONRowChanged;
358             
359             
public event tblMONRowChangeEventHandler tblMONRowDeleting;
360             
361             
public event tblMONRowChangeEventHandler tblMONRowDeleted;
362             
363             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
364             
public void AddtblMONRow(tblMONRow row) {
365                 
this.Rows.Add(row);
366             }
367             
368             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
369             
public tblMONRow AddtblMONRow(string MaMon, string TenMon, int SoDVHT, string MaGV, string HocKi) {
370                 tblMONRow rowtblMONRow = ((tblMONRow)(
this.NewRow()));
371                 
object[] columnValuesArray = new object[] {
372                         MaMon,
373                         TenMon,
374                         SoDVHT,
375                         MaGV,
376                         HocKi};
377                 rowtblMONRow.ItemArray = columnValuesArray;
378                 
this.Rows.Add(rowtblMONRow);
379                 
return rowtblMONRow;
380             }
381             
382             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
383             
public tblMONRow FindByMaMon(string MaMon) {
384                 
return ((tblMONRow)(this.Rows.Find(new object[] {
385                             MaMon})));
386             }
387             
388             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
389             
public override global::System.Data.DataTable Clone() {
390                 tblMONDataTable cln = ((tblMONDataTable)(
base.Clone()));
391                 cln.InitVars();
392                 
return cln;
393             }
394             
395             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
396             
protected override global::System.Data.DataTable CreateInstance() {
397                 
return new tblMONDataTable();
398             }
399             
400             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
401             
internal void InitVars() {
402                 
this.columnMaMon = base.Columns["MaMon"];
403                 
this.columnTenMon = base.Columns["TenMon"];
404                 
this.columnSoDVHT = base.Columns["SoDVHT"];
405                 
this.columnMaGV = base.Columns["MaGV"];
406                 
this.columnHocKi = base.Columns["HocKi"];
407             }
408             
409             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
410             
private void InitClass() {
411                 
this.columnMaMon = new global::System.Data.DataColumn("MaMon", typeof(string), null, global::System.Data.MappingType.Element);
412                 
base.Columns.Add(this.columnMaMon);
413                 
this.columnTenMon = new global::System.Data.DataColumn("TenMon", typeof(string), null, global::System.Data.MappingType.Element);
414                 
base.Columns.Add(this.columnTenMon);
415                 
this.columnSoDVHT = new global::System.Data.DataColumn("SoDVHT", typeof(int), null, global::System.Data.MappingType.Element);
416                 
base.Columns.Add(this.columnSoDVHT);
417                 
this.columnMaGV = new global::System.Data.DataColumn("MaGV", typeof(string), null, global::System.Data.MappingType.Element);
418                 
base.Columns.Add(this.columnMaGV);
419                 
this.columnHocKi = new global::System.Data.DataColumn("HocKi", typeof(string), null, global::System.Data.MappingType.Element);
420                 
base.Columns.Add(this.columnHocKi);
421                 
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
422                                 
this.columnMaMon}, true));
423                 
this.columnMaMon.AllowDBNull = false;
424                 
this.columnMaMon.Unique = true;
425                 
this.columnMaMon.MaxLength = 20;
426                 
this.columnTenMon.AllowDBNull = false;
427                 
this.columnTenMon.MaxLength = 50;
428                 
this.columnMaGV.MaxLength = 10;
429                 
this.columnHocKi.MaxLength = 10;
430             }
431             
432             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
433             
public tblMONRow NewtblMONRow() {
434                 
return ((tblMONRow)(this.NewRow()));
435             }
436             
437             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
438             
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
439                 
return new tblMONRow(builder);
440             }
441             
442             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
443             
protected override global::System.Type GetRowType() {
444                 
return typeof(tblMONRow);
445             }
446             
447             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
448             
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
449                 
base.OnRowChanged(e);
450                 
if ((this.tblMONRowChanged != null)) {
451                     
this.tblMONRowChanged(this, new tblMONRowChangeEvent(((tblMONRow)(e.Row)), e.Action));
452                 }
453             }
454             
455             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
456             
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
457                 
base.OnRowChanging(e);
458                 
if ((this.tblMONRowChanging != null)) {
459                     
this.tblMONRowChanging(this, new tblMONRowChangeEvent(((tblMONRow)(e.Row)), e.Action));
460                 }
461             }
462             
463             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
464             
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
465                 
base.OnRowDeleted(e);
466                 
if ((this.tblMONRowDeleted != null)) {
467                     
this.tblMONRowDeleted(this, new tblMONRowChangeEvent(((tblMONRow)(e.Row)), e.Action));
468                 }
469             }
470             
471             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
472             
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
473                 
base.OnRowDeleting(e);
474                 
if ((this.tblMONRowDeleting != null)) {
475                     
this.tblMONRowDeleting(this, new tblMONRowChangeEvent(((tblMONRow)(e.Row)), e.Action));
476                 }
477             }
478             
479             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
480             
public void RemovetblMONRow(tblMONRow row) {
481                 
this.Rows.Remove(row);
482             }
483             
484             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
485             
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
486                 
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
487                 
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
488                 QuanlydiemDataSet19 ds =
new QuanlydiemDataSet19();
489                 
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
490                 any1.Namespace =
"http://www.w3.org/2001/XMLSchema";
491                 any1.MinOccurs =
new decimal(0);
492                 any1.MaxOccurs =
decimal.MaxValue;
493                 any1.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
494                 sequence.Items.Add(any1);
495                 
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
496                 any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1";
497                 any2.MinOccurs =
new decimal(1);
498                 any2.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
499                 sequence.Items.Add(any2);
500                 
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
501                 attribute1.Name =
"namespace";
502                 attribute1.FixedValue = ds.Namespace;
503                 type.Attributes.Add(attribute1);
504                 
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
505                 attribute2.Name =
"tableTypeName";
506                 attribute2.FixedValue =
"tblMONDataTable";
507                 type.Attributes.Add(attribute2);
508                 type.Particle = sequence;
509                 
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
510                 
if (xs.Contains(dsSchema.TargetNamespace)) {
511                     
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
512                     
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
513                     
try {
514                         
global::System.Xml.Schema.XmlSchema schema = null;
515                         dsSchema.Write(s1);
516                         
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
517                             schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
518                             s2.SetLength(
0);
519                             schema.Write(s2);
520                             
if ((s1.Length == s2.Length)) {
521                                 s1.Position =
0;
522                                 s2.Position =
0;
523                                 
for (; ((s1.Position != s1.Length)
524                                             && (s1.ReadByte() == s2.ReadByte())); ) {
525                                     ;
526                                 }
527                                 
if ((s1.Position == s1.Length)) {
528                                     
return type;
529                                 }
530                             }
531                         }
532                     }
533                     
finally {
534                         
if ((s1 != null)) {
535                             s1.Close();
536                         }
537                         
if ((s2 != null)) {
538                             s2.Close();
539                         }
540                     }
541                 }
542                 xs.Add(dsSchema);
543                 
return type;
544             }
545         }

546         
547         ///
<summary>
548         ///
Represents strongly named DataRow class.
549         ///</summary>

550         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
551         
public partial class tblMONRow : global::System.Data.DataRow {
552             
553             
private tblMONDataTable tabletblMON;
554             
555             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
556             
internal tblMONRow(global::System.Data.DataRowBuilder rb) :
557                     
base(rb) {
558                 
this.tabletblMON = ((tblMONDataTable)(this.Table));
559             }
560             
561             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
562             
public string MaMon {
563                 
get {
564                     
return ((string)(this[this.tabletblMON.MaMonColumn]));
565                 }
566                 
set {
567                     
this[this.tabletblMON.MaMonColumn] = value;
568                 }
569             }
570             
571             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
572             
public string TenMon {
573                 
get {
574                     
return ((string)(this[this.tabletblMON.TenMonColumn]));
575                 }
576                 
set {
577                     
this[this.tabletblMON.TenMonColumn] = value;
578                 }
579             }
580             
581             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
582             
public int SoDVHT {
583                 
get {
584                     
try {
585                         
return ((int)(this[this.tabletblMON.SoDVHTColumn]));
586                     }
587                     
catch (global::System.InvalidCastException e) {
588                         
throw new global::System.Data.StrongTypingException("The value for column \'SoDVHT\' in table \'tblMON\' is DBNull.", e);
589                     }
590                 }
591                 
set {
592                     
this[this.tabletblMON.SoDVHTColumn] = value;
593                 }
594             }
595             
596             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
597             
public string MaGV {
598                 
get {
599                     
try {
600                         
return ((string)(this[this.tabletblMON.MaGVColumn]));
601                     }
602                     
catch (global::System.InvalidCastException e) {
603                         
throw new global::System.Data.StrongTypingException("The value for column \'MaGV\' in table \'tblMON\' is DBNull.", e);
604                     }
605                 }
606                 
set {
607                     
this[this.tabletblMON.MaGVColumn] = value;
608                 }
609             }
610             
611             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
612             
public string HocKi {
613                 
get {
614                     
try {
615                         
return ((string)(this[this.tabletblMON.HocKiColumn]));
616                     }
617                     
catch (global::System.InvalidCastException e) {
618                         
throw new global::System.Data.StrongTypingException("The value for column \'HocKi\' in table \'tblMON\' is DBNull.", e);
619                     }
620                 }
621                 
set {
622                     
this[this.tabletblMON.HocKiColumn] = value;
623                 }
624             }
625             
626             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
627             
public bool IsSoDVHTNull() {
628                 
return this.IsNull(this.tabletblMON.SoDVHTColumn);
629             }
630             
631             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
632             
public void SetSoDVHTNull() {
633                 
this[this.tabletblMON.SoDVHTColumn] = global::System.Convert.DBNull;
634             }
635             
636             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
637             
public bool IsMaGVNull() {
638                 
return this.IsNull(this.tabletblMON.MaGVColumn);
639             }
640             
641             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
642             
public void SetMaGVNull() {
643                 
this[this.tabletblMON.MaGVColumn] = global::System.Convert.DBNull;
644             }
645             
646             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
647             
public bool IsHocKiNull() {
648                 
return this.IsNull(this.tabletblMON.HocKiColumn);
649             }
650             
651             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
652             
public void SetHocKiNull() {
653                 
this[this.tabletblMON.HocKiColumn] = global::System.Convert.DBNull;
654             }
655         }

656         
657         ///
<summary>
658         ///
Row event argument class
659         ///</summary>

660         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
661         
public class tblMONRowChangeEvent : global::System.EventArgs {
662             
663             
private tblMONRow eventRow;
664             
665             
private global::System.Data.DataRowAction eventAction;
666             
667             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
668             
public tblMONRowChangeEvent(tblMONRow row, global::System.Data.DataRowAction action) {
669                 
this.eventRow = row;
670                 
this.eventAction = action;
671             }
672             
673             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
674             
public tblMONRow Row {
675                 
get {
676                     
return this.eventRow;
677                 }
678             }
679             
680             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
681             
public global::System.Data.DataRowAction Action {
682                 
get {
683                     
return this.eventAction;
684                 }
685             }
686         }
687     }
688 }

689 namespace
Quản_lý_điểm_sinh_vien_CNTT.QuanlydiemDataSet19TableAdapters {
690     
691     
692     ///
<summary>
693     ///
Represents the connection and commands used to retrieve and save data.
694     ///</summary>

695     
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
696     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
697     
[global::System.ComponentModel.ToolboxItem(true)]
698     
[global::System.ComponentModel.DataObjectAttribute(true)]
699     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
700         
", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
701     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
702     
public partial class tblMONTableAdapter : global::System.ComponentModel.Component {
703         
704         
private global::System.Data.SqlClient.SqlDataAdapter _adapter;
705         
706         
private global::System.Data.SqlClient.SqlConnection _connection;
707         
708         
private global::System.Data.SqlClient.SqlTransaction _transaction;
709         
710         
private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
711         
712         
private bool _clearBeforeFill;
713         
714         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
715         
public tblMONTableAdapter() {
716             
this.ClearBeforeFill = true;
717         }
718         
719         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
720         
protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
721             
get {
722                 
if ((this._adapter == null)) {
723                     
this.InitAdapter();
724                 }
725                 
return this._adapter;
726             }
727         }
728         
729         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
730         
internal global::System.Data.SqlClient.SqlConnection Connection {
731             
get {
732                 
if ((this._connection == null)) {
733                     
this.InitConnection();
734                 }
735                 
return this._connection;
736             }
737             
set {
738                 
this._connection = value;
739                 
if ((this.Adapter.InsertCommand != null)) {
740                     
this.Adapter.InsertCommand.Connection = value;
741                 }
742                 
if ((this.Adapter.DeleteCommand != null)) {
743                     
this.Adapter.DeleteCommand.Connection = value;
744                 }
745                 
if ((this.Adapter.UpdateCommand != null)) {
746                     
this.Adapter.UpdateCommand.Connection = value;
747                 }
748                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
749                     
if ((this.CommandCollection[i] != null)) {
750                         ((
global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
751                     }
752                 }
753             }
754         }
755         
756         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
757         
internal global::System.Data.SqlClient.SqlTransaction Transaction {
758             
get {
759                 
return this._transaction;
760             }
761             
set {
762                 
this._transaction = value;
763                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
764                     
this.CommandCollection[i].Transaction = this._transaction;
765                 }
766                 
if (((this.Adapter != null)
767                             && (
this.Adapter.DeleteCommand != null))) {
768                     
this.Adapter.DeleteCommand.Transaction = this._transaction;
769                 }
770                 
if (((this.Adapter != null)
771                             && (
this.Adapter.InsertCommand != null))) {
772                     
this.Adapter.InsertCommand.Transaction = this._transaction;
773                 }
774                 
if (((this.Adapter != null)
775                             && (
this.Adapter.UpdateCommand != null))) {
776                     
this.Adapter.UpdateCommand.Transaction = this._transaction;
777                 }
778             }
779         }
780         
781         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
782         
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
783             
get {
784                 
if ((this._commandCollection == null)) {
785                     
this.InitCommandCollection();
786                 }
787                 
return this._commandCollection;
788             }
789         }
790         
791         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
792         
public bool ClearBeforeFill {
793             
get {
794                 
return this._clearBeforeFill;
795             }
796             
set {
797                 
this._clearBeforeFill = value;
798             }
799         }
800         
801         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
802         
private void InitAdapter() {
803             
this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
804             
global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
805             tableMapping.SourceTable =
"Table";
806             tableMapping.DataSetTable =
"tblMON";
807             tableMapping.ColumnMappings.Add(
"MaMon", "MaMon");
808             tableMapping.ColumnMappings.Add(
"TenMon", "TenMon");
809             tableMapping.ColumnMappings.Add(
"SoDVHT", "SoDVHT");
810             tableMapping.ColumnMappings.Add(
"MaGV", "MaGV");
811             tableMapping.ColumnMappings.Add(
"HocKi", "HocKi");
812             
this._adapter.TableMappings.Add(tableMapping);
813             
this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
814             
this._adapter.DeleteCommand.Connection = this.Connection;
815             
this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[tblMON] WHERE (([MaMon] = @Original_MaMon) AND ([TenMon] = @Original_TenMon) AND ((@IsNull_SoDVHT = 1 AND [SoDVHT] IS NULL) OR ([SoDVHT] = @Original_SoDVHT)) AND ((@IsNull_MaGV = 1 AND [MaGV] IS NULL) OR ([MaGV] = @Original_MaGV)) AND ((@IsNull_HocKi = 1 AND [HocKi] IS NULL) OR ([HocKi] = @Original_HocKi)))";
816             
this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
817             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaMon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
818             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenMon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
819             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
820             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
821             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_MaGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
822             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
823             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_HocKi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
824             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_HocKi", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
825             
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
826             
this._adapter.InsertCommand.Connection = this.Connection;
827             
this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[tblMON] ([MaMon], [TenMon], [SoDVHT], [MaGV], [HocKi]) VALUES " +
828                 
"(@MaMon, @TenMon, @SoDVHT, @MaGV, @HocKi);\r\nSELECT MaMon, TenMon, SoDVHT, MaGV, " +
829                 
"HocKi FROM tblMON WHERE (MaMon = @MaMon)";
830             
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
831             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaMon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
832             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenMon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
833             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
834             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
835             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@HocKi", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
836             
this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
837             
this._adapter.UpdateCommand.Connection = this.Connection;
838             
this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[tblMON] SET [MaMon] = @MaMon, [TenMon] = @TenMon, [SoDVHT] = @SoDVHT, [MaGV] = @MaGV, [HocKi] = @HocKi WHERE (([MaMon] = @Original_MaMon) AND ([TenMon] = @Original_TenMon) AND ((@IsNull_SoDVHT = 1 AND [SoDVHT] IS NULL) OR ([SoDVHT] = @Original_SoDVHT)) AND ((@IsNull_MaGV = 1 AND [MaGV] IS NULL) OR ([MaGV] = @Original_MaGV)) AND ((@IsNull_HocKi = 1 AND [HocKi] IS NULL) OR ([HocKi] = @Original_HocKi)));
839 SELECT MaMon, TenMon, SoDVHT, MaGV, HocKi FROM tblMON WHERE (MaMon = @MaMon)"
;
840             
this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
841             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaMon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
842             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TenMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenMon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
843             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
844             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaGV", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
845             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@HocKi", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
846             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaMon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
847             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TenMon", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TenMon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
848             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
849             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_SoDVHT", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SoDVHT", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
850             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_MaGV", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
851             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_MaGV", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MaGV", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
852             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_HocKi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
853             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_HocKi", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "HocKi", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
854         }
855         
856         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
857         
private void InitConnection() {
858             
this._connection = new global::System.Data.SqlClient.SqlConnection();
859             
this._connection.ConnectionString = global::Quản_lý_điểm_sinh_vien_CNTT.Properties.Settings.Default.QuanlydiemConnectionString2;
860         }
861         
862         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
863         
private void InitCommandCollection() {
864             
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
865             
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
866             
this._commandCollection[0].Connection = this.Connection;
867             
this._commandCollection[0].CommandText = "SELECT MaMon, TenMon, SoDVHT, MaGV, HocKi FROM dbo.tblMON";
868             
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
869         }
870         
871         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
872         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
873         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
874         
public virtual int Fill(QuanlydiemDataSet19.tblMONDataTable dataTable) {
875             
this.Adapter.SelectCommand = this.CommandCollection[0];
876             
if ((this.ClearBeforeFill == true)) {
877                 dataTable.Clear();
878             }
879             
int returnValue = this.Adapter.Fill(dataTable);
880             
return returnValue;
881         }
882         
883         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
884         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
885         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
886         
public virtual QuanlydiemDataSet19.tblMONDataTable GetData() {
887             
this.Adapter.SelectCommand = this.CommandCollection[0];
888             QuanlydiemDataSet19.tblMONDataTable dataTable =
new QuanlydiemDataSet19.tblMONDataTable();
889             
this.Adapter.Fill(dataTable);
890             
return dataTable;
891         }
892         
893         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
894         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
895         
public virtual int Update(QuanlydiemDataSet19.tblMONDataTable dataTable) {
896             
return this.Adapter.Update(dataTable);
897         }
898         
899         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
900         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
901         
public virtual int Update(QuanlydiemDataSet19 dataSet) {
902             
return this.Adapter.Update(dataSet, "tblMON");
903         }
904         
905         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
906         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
907         
public virtual int Update(global::System.Data.DataRow dataRow) {
908             
return this.Adapter.Update(new global::System.Data.DataRow[] {
909                         dataRow});
910         }
911         
912         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
913         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
914         
public virtual int Update(global::System.Data.DataRow[] dataRows) {
915             
return this.Adapter.Update(dataRows);
916         }
917         
918         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
919         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
920         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
921         
public virtual int Delete(string Original_MaMon, string Original_TenMon, global::System.Nullable<int> Original_SoDVHT, string Original_MaGV, string Original_HocKi) {
922             
if ((Original_MaMon == null)) {
923                 
throw new global::System.ArgumentNullException("Original_MaMon");
924             }
925             
else {
926                 
this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_MaMon));
927             }
928             
if ((Original_TenMon == null)) {
929                 
throw new global::System.ArgumentNullException("Original_TenMon");
930             }
931             
else {
932                 
this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_TenMon));
933             }
934             
if ((Original_SoDVHT.HasValue == true)) {
935                 
this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(0));
936                 
this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(Original_SoDVHT.Value));
937             }
938             
else {
939                 
this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(1));
940                 
this.Adapter.DeleteCommand.Parameters[3].Value = global::System.DBNull.Value;
941             }
942             
if ((Original_MaGV == null)) {
943                 
this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(1));
944                 
this.Adapter.DeleteCommand.Parameters[5].Value = global::System.DBNull.Value;
945             }
946             
else {
947                 
this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(0));
948                 
this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_MaGV));
949             }
950             
if ((Original_HocKi == null)) {
951                 
this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(1));
952                 
this.Adapter.DeleteCommand.Parameters[7].Value = global::System.DBNull.Value;
953             }
954             
else {
955                 
this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(0));
956                 
this.Adapter.DeleteCommand.Parameters[7].Value = ((string)(Original_HocKi));
957             }
958             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
959             
if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
960                         !=
global::System.Data.ConnectionState.Open)) {
961                 
this.Adapter.DeleteCommand.Connection.Open();
962             }
963             
try {
964                 
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
965                 
return returnValue;
966             }
967             
finally {
968                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
969                     
this.Adapter.DeleteCommand.Connection.Close();
970                 }
971             }
972         }
973         
974         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
975         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
976         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
977         
public virtual int Insert(string MaMon, string TenMon, global::System.Nullable<int> SoDVHT, string MaGV, string HocKi) {
978             
if ((MaMon == null)) {
979                 
throw new global::System.ArgumentNullException("MaMon");
980             }
981             
else {
982                 
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(MaMon));
983             }
984             
if ((TenMon == null)) {
985                 
throw new global::System.ArgumentNullException("TenMon");
986             }
987             
else {
988                 
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TenMon));
989             }
990             
if ((SoDVHT.HasValue == true)) {
991                 
this.Adapter.InsertCommand.Parameters[2].Value = ((int)(SoDVHT.Value));
992             }
993             
else {
994                 
this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
995             }
996             
if ((MaGV == null)) {
997                 
this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
998             }
999             
else {
1000                 
this.Adapter.InsertCommand.Parameters[3].Value = ((string)(MaGV));
1001             }
1002             
if ((HocKi == null)) {
1003                 
this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
1004             }
1005             
else {
1006                 
this.Adapter.InsertCommand.Parameters[4].Value = ((string)(HocKi));
1007             }
1008             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
1009             
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
1010                         !=
global::System.Data.ConnectionState.Open)) {
1011                 
this.Adapter.InsertCommand.Connection.Open();
1012             }
1013             
try {
1014                 
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
1015                 
return returnValue;
1016             }
1017             
finally {
1018                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1019                     
this.Adapter.InsertCommand.Connection.Close();
1020                 }
1021             }
1022         }
1023         
1024         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1025         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1026         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1027         
public virtual int Update(string MaMon, string TenMon, global::System.Nullable<int> SoDVHT, string MaGV, string HocKi, string Original_MaMon, string Original_TenMon, global::System.Nullable<int> Original_SoDVHT, string Original_MaGV, string Original_HocKi) {
1028             
if ((MaMon == null)) {
1029                 
throw new global::System.ArgumentNullException("MaMon");
1030             }
1031             
else {
1032                 
this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(MaMon));
1033             }
1034             
if ((TenMon == null)) {
1035                 
throw new global::System.ArgumentNullException("TenMon");
1036             }
1037             
else {
1038                 
this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TenMon));
1039             }
1040             
if ((SoDVHT.HasValue == true)) {
1041                 
this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(SoDVHT.Value));
1042             }
1043             
else {
1044                 
this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
1045             }
1046             
if ((MaGV == null)) {
1047                 
this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
1048             }
1049             
else {
1050                 
this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(MaGV));
1051             }
1052             
if ((HocKi == null)) {
1053                 
this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
1054             }
1055             
else {
1056                 
this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(HocKi));
1057             }
1058             
if ((Original_MaMon == null)) {
1059                 
throw new global::System.ArgumentNullException("Original_MaMon");
1060             }
1061             
else {
1062                 
this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_MaMon));
1063             }
1064             
if ((Original_TenMon == null)) {
1065                 
throw new global::System.ArgumentNullException("Original_TenMon");
1066             }
1067             
else {
1068                 
this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_TenMon));
1069             }
1070             
if ((Original_SoDVHT.HasValue == true)) {
1071                 
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
1072                 
this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_SoDVHT.Value));
1073             }
1074             
else {
1075                 
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
1076                 
this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
1077             }
1078             
if ((Original_MaGV == null)) {
1079                 
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1));
1080                 
this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
1081             }
1082             
else {
1083                 
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0));
1084                 
this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_MaGV));
1085             }
1086             
if ((Original_HocKi == null)) {
1087                 
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(1));
1088                 
this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value;
1089             }
1090             
else {
1091                 
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(0));
1092                 
this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(Original_HocKi));
1093             }
1094             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
1095             
if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
1096                         !=
global::System.Data.ConnectionState.Open)) {
1097                 
this.Adapter.UpdateCommand.Connection.Open();
1098             }
1099             
try {
1100                 
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
1101                 
return returnValue;
1102             }
1103             
finally {
1104                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1105                     
this.Adapter.UpdateCommand.Connection.Close();
1106                 }
1107             }
1108         }
1109         
1110         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1111         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1112         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1113         
public virtual int Update(string TenMon, global::System.Nullable<int> SoDVHT, string MaGV, string HocKi, string Original_MaMon, string Original_TenMon, global::System.Nullable<int> Original_SoDVHT, string Original_MaGV, string Original_HocKi) {
1114             
return this.Update(Original_MaMon, TenMon, SoDVHT, MaGV, HocKi, Original_MaMon, Original_TenMon, Original_SoDVHT, Original_MaGV, Original_HocKi);
1115         }
1116     }

1117     
1118     ///
<summary>
1119     ///
TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1120     ///</summary>

1121     
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1122     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
1123     
[global::System.ComponentModel.ToolboxItem(true)]
1124     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1125         
"esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1126     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1127     
public partial class TableAdapterManager : global::System.ComponentModel.Component {
1128         
1129         
private UpdateOrderOption _updateOrder;
1130         
1131         
private tblMONTableAdapter _tblMONTableAdapter;
1132         
1133         
private bool _backupDataSetBeforeUpdate;
1134         
1135         
private global::System.Data.IDbConnection _connection;
1136         
1137         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1138         
public UpdateOrderOption UpdateOrder {
1139             
get {
1140                 
return this._updateOrder;
1141             }
1142             
set {
1143                 
this._updateOrder = value;
1144             }
1145         }
1146         
1147         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1148         [
global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1149             
"ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
1150             
"", "System.Drawing.Design.UITypeEditor")]
1151         
public tblMONTableAdapter tblMONTableAdapter {
1152             
get {
1153                 
return this._tblMONTableAdapter;
1154             }
1155             
set {
1156                 
this._tblMONTableAdapter = value;
1157             }
1158         }
1159         
1160         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1161         
public bool BackupDataSetBeforeUpdate {
1162             
get {
1163                 
return this._backupDataSetBeforeUpdate;
1164             }
1165             
set {
1166                 
this._backupDataSetBeforeUpdate = value;
1167             }
1168         }
1169         
1170         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1171         
[global::System.ComponentModel.Browsable(false)]
1172         
public global::System.Data.IDbConnection Connection {
1173             
get {
1174                 
if ((this._connection != null)) {
1175                     
return this._connection;
1176                 }
1177                 
if (((this._tblMONTableAdapter != null)
1178                             && (
this._tblMONTableAdapter.Connection != null))) {
1179                     
return this._tblMONTableAdapter.Connection;
1180                 }
1181                 
return null;
1182             }
1183             
set {
1184                 
this._connection = value;
1185             }
1186         }
1187         
1188         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1189         
[global::System.ComponentModel.Browsable(false)]
1190         
public int TableAdapterInstanceCount {
1191             
get {
1192                 
int count = 0;
1193                 
if ((this._tblMONTableAdapter != null)) {
1194                     count = (count +
1);
1195                 }
1196                 
return count;
1197             }
1198         }

1199         
1200         ///
<summary>
1201         ///
Update rows in top-down order.
1202         ///</summary>

1203         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1204         
private int UpdateUpdatedRows(QuanlydiemDataSet19 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1205             
int result = 0;
1206             
if ((this._tblMONTableAdapter != null)) {
1207                 
global::System.Data.DataRow[] updatedRows = dataSet.tblMON.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1208                 updatedRows =
this.GetRealUpdatedRows(updatedRows, allAddedRows);
1209                 
if (((updatedRows != null)
1210                             && (
0 < updatedRows.Length))) {
1211                     result = (result +
this._tblMONTableAdapter.Update(updatedRows));
1212                     allChangedRows.AddRange(updatedRows);
1213                 }
1214             }
1215             
return result;
1216         }

1217         
1218         ///
<summary>
1219         ///
Insert rows in top-down order.
1220         ///</summary>

1221         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1222         
private int UpdateInsertedRows(QuanlydiemDataSet19 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1223             
int result = 0;
1224             
if ((this._tblMONTableAdapter != null)) {
1225                 
global::System.Data.DataRow[] addedRows = dataSet.tblMON.Select(null, null, global::System.Data.DataViewRowState.Added);
1226                 
if (((addedRows != null)
1227                             && (
0 < addedRows.Length))) {
1228                     result = (result +
this._tblMONTableAdapter.Update(addedRows));
1229                     allAddedRows.AddRange(addedRows);
1230                 }
1231             }
1232             
return result;
1233         }

1234         
1235         ///
<summary>
1236         ///
Delete rows in bottom-up order.
1237         ///</summary>

1238         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1239         
private int UpdateDeletedRows(QuanlydiemDataSet19 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1240             
int result = 0;
1241             
if ((this._tblMONTableAdapter != null)) {
1242                 
global::System.Data.DataRow[] deletedRows = dataSet.tblMON.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1243                 
if (((deletedRows != null)
1244                             && (
0 < deletedRows.Length))) {
1245                     result = (result +
this._tblMONTableAdapter.Update(deletedRows));
1246                     allChangedRows.AddRange(deletedRows);
1247                 }
1248             }
1249             
return result;
1250         }

1251         
1252         ///
<summary>
1253         ///
Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1254         ///</summary>

1255         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1256         
private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1257             
if (((updatedRows == null)
1258                         || (updatedRows.Length <
1))) {
1259                 
return updatedRows;
1260             }
1261             
if (((allAddedRows == null)
1262                         || (allAddedRows.Count <
1))) {
1263                 
return updatedRows;
1264             }
1265             
global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1266             
for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1267                 
global::System.Data.DataRow row = updatedRows[i];
1268                 
if ((allAddedRows.Contains(row) == false)) {
1269                     realUpdatedRows.Add(row);
1270                 }
1271             }
1272             
return realUpdatedRows.ToArray();
1273         }

1274         
1275         ///
<summary>
1276         ///
Update all changes to the dataset.
1277         ///</summary>

1278         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1279         
public virtual int UpdateAll(QuanlydiemDataSet19 dataSet) {
1280             
if ((dataSet == null)) {
1281                 
throw new global::System.ArgumentNullException("dataSet");
1282             }
1283             
if ((dataSet.HasChanges() == false)) {
1284                 
return 0;
1285             }
1286             
if (((this._tblMONTableAdapter != null)
1287                         && (
this.MatchTableAdapterConnection(this._tblMONTableAdapter.Connection) == false))) {
1288                 
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1289                         
"tring.");
1290             }
1291             
global::System.Data.IDbConnection workConnection = this.Connection;
1292             
if ((workConnection == null)) {
1293                 
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1294                         
"ger TableAdapter property to a valid TableAdapter instance.");
1295             }
1296             
bool workConnOpened = false;
1297             
if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1298                         ==
global::System.Data.ConnectionState.Broken)) {
1299                 workConnection.Close();
1300             }
1301             
if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1302                 workConnection.Open();
1303                 workConnOpened =
true;
1304             }
1305             
global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1306             
if ((workTransaction == null)) {
1307                 
throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1308                         
"ctions or the current state is not allowing the transaction to begin.");
1309             }
1310             
global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1311             
global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1312             
global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1313             
global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1314             
int result = 0;
1315             
global::System.Data.DataSet backupDataSet = null;
1316             
if (this.BackupDataSetBeforeUpdate) {
1317                 backupDataSet =
new global::System.Data.DataSet();
1318                 backupDataSet.Merge(dataSet);
1319             }
1320             
try {
1321                 
// ---- Prepare for update -----------
1322                 
//
1323                 
if ((this._tblMONTableAdapter != null)) {
1324                     revertConnections.Add(
this._tblMONTableAdapter, this._tblMONTableAdapter.Connection);
1325                     
this._tblMONTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1326                     
this._tblMONTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1327                     
if (this._tblMONTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1328                         
this._tblMONTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1329                         adaptersWithAcceptChangesDuringUpdate.Add(
this._tblMONTableAdapter.Adapter);
1330                     }
1331                 }
1332                 
//
1333                 
//---- Perform updates -----------
1334                 
//
1335                 
if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1336                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1337                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1338                 }
1339                 
else {
1340                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1341                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1342                 }
1343                 result = (result +
this.UpdateDeletedRows(dataSet, allChangedRows));
1344                 
//
1345                 
//---- Commit updates -----------
1346                 
//
1347                 workTransaction.Commit();
1348                 
if ((0 < allAddedRows.Count)) {
1349                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1350                     allAddedRows.CopyTo(rows);
1351                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1352                         
global::System.Data.DataRow row = rows[i];
1353                         row.AcceptChanges();
1354                     }
1355                 }
1356                 
if ((0 < allChangedRows.Count)) {
1357                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1358                     allChangedRows.CopyTo(rows);
1359                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1360                         
global::System.Data.DataRow row = rows[i];
1361                         row.AcceptChanges();
1362                     }
1363                 }
1364             }
1365             
catch (global::System.Exception ex) {
1366                 workTransaction.Rollback();
1367                 
// ---- Restore the dataset -----------
1368                 
if (this.BackupDataSetBeforeUpdate) {
1369                     
global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1370                     dataSet.Clear();
1371                     dataSet.Merge(backupDataSet);
1372                 }
1373                 
else {
1374                     
if ((0 < allAddedRows.Count)) {
1375                         
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1376                         allAddedRows.CopyTo(rows);
1377                         
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1378                             
global::System.Data.DataRow row = rows[i];
1379                             row.AcceptChanges();
1380                             row.SetAdded();
1381                         }
1382                     }
1383                 }
1384                 
throw ex;
1385             }
1386             
finally {
1387                 
if (workConnOpened) {
1388                     workConnection.Close();
1389                 }
1390                 
if ((this._tblMONTableAdapter != null)) {
1391                     
this._tblMONTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._tblMONTableAdapter]));
1392                     
this._tblMONTableAdapter.Transaction = null;
1393                 }
1394                 
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1395                     
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1396                     adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1397                     
for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1398                         
global::System.Data.Common.DataAdapter adapter = adapters[i];
1399                         adapter.AcceptChangesDuringUpdate =
true;
1400                     }
1401                 }
1402             }
1403             
return result;
1404         }
1405         
1406         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1407         
protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1408             
global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1409         }
1410         
1411         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1412         
protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1413             
if ((this._connection != null)) {
1414                 
return true;
1415             }
1416             
if (((this.Connection == null)
1417                         || (inputConnection ==
null))) {
1418                 
return true;
1419             }
1420             
if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1421                 
return true;
1422             }
1423             
return false;
1424         }

1425         
1426         ///
<summary>
1427         ///
Update Order Option
1428         ///</summary>

1429         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1430         
public enum UpdateOrderOption {
1431             
1432             InsertUpdateDelete =
0,
1433             
1434             UpdateInsertDelete =
1,
1435         }

1436         
1437         ///
<summary>
1438         ///
Used to sort self-referenced table's rows
1439         ///</summary>

1440         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
1441         
private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1442             
1443             
private global::System.Data.DataRelation _relation;
1444             
1445             
private int _childFirst;
1446             
1447             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1448             
internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1449                 
this._relation = relation;
1450                 
if (childFirst) {
1451                     
this._childFirst = -1;
1452                 }
1453                 
else {
1454                     
this._childFirst = 1;
1455                 }
1456             }
1457             
1458             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1459             
private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
1460                 
global::System.Diagnostics.Debug.Assert((child != null));
1461                 
global::System.Diagnostics.Debug.Assert((parent != null));
1462                 
global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1463                 
for (
1464                 ; ((newParent !=
null)
1465                             && ((
object.ReferenceEquals(newParent, child) == false)
1466                             && (
object.ReferenceEquals(newParent, parent) == false)));
1467                 ) {
1468                     newParent = newParent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Default);
1469                 }
1470                 
if ((newParent == null)) {
1471                     
for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null)
1472                                 && ((
object.ReferenceEquals(newParent, child) == false)
1473                                 && (
object.ReferenceEquals(newParent, parent) == false)));
1474                     ) {
1475                         newParent = newParent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1476                     }
1477                 }
1478                 
if (object.ReferenceEquals(newParent, parent)) {
1479                     
return true;
1480                 }
1481                 
return false;
1482             }
1483             
1484             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1485             
public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1486                 
if (object.ReferenceEquals(row1, row2)) {
1487                     
return 0;
1488                 }
1489                 
if ((row1 == null)) {
1490                     
return -1;
1491                 }
1492                 
if ((row2 == null)) {
1493                     
return 1;
1494                 }
1495
1496                 
// Is row1 the child or grandchild of row2
1497                 
if (this.IsChildAndParent(row1, row2)) {
1498                     
return this._childFirst;
1499                 }
1500
1501                 
// Is row2 the child or grandchild of row1
1502                 
if (this.IsChildAndParent(row2, row1)) {
1503                     
return (-1 * this._childFirst);
1504                 }
1505                 
return 0;
1506             }
1507         }
1508     }
1509 }
1510
1511 #pragma warning restore
1591



Quản lý điểm sinh viên CNTT 180.093 lượt xem

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