BranchesOperSet.Designer.cs 78 KB

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