BranchesOperDataSet.Designer.cs 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  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("BranchesOperDataSet")]
  20. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
  21. public partial class BranchesOperDataSet : 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 BranchesOperDataSet() {
  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 BranchesOperDataSet(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. BranchesOperDataSet cln = ((BranchesOperDataSet)(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 = "BranchesOperDataSet";
  182. this.Prefix = "";
  183. this.Namespace = "http://tempuri.org/BranchesOperDataSet.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. BranchesOperDataSet ds = new BranchesOperDataSet();
  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 columnTitle;
  256. private global::System.Data.DataColumn columnChief;
  257. private global::System.Data.DataColumn columnBranchID;
  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 TitleColumn {
  291. get {
  292. return this.columnTitle;
  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 ChiefColumn {
  298. get {
  299. return this.columnChief;
  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 BranchIDColumn {
  305. get {
  306. return this.columnBranchID;
  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. Title,
  343. Chief,
  344. null};
  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.columnTitle = base.Columns["Title"];
  371. this.columnChief = base.Columns["Chief"];
  372. this.columnBranchID = base.Columns["BranchID"];
  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.columnTitle = new global::System.Data.DataColumn("Title", typeof(string), null, global::System.Data.MappingType.Element);
  378. base.Columns.Add(this.columnTitle);
  379. this.columnChief = new global::System.Data.DataColumn("Chief", typeof(string), null, global::System.Data.MappingType.Element);
  380. base.Columns.Add(this.columnChief);
  381. this.columnBranchID = new global::System.Data.DataColumn("BranchID", typeof(int), null, global::System.Data.MappingType.Element);
  382. base.Columns.Add(this.columnBranchID);
  383. this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
  384. this.columnBranchID}, true));
  385. this.columnTitle.AllowDBNull = false;
  386. this.columnTitle.MaxLength = 100;
  387. this.columnChief.AllowDBNull = false;
  388. this.columnChief.MaxLength = 100;
  389. this.columnBranchID.AutoIncrement = true;
  390. this.columnBranchID.AutoIncrementSeed = -1;
  391. this.columnBranchID.AutoIncrementStep = -1;
  392. this.columnBranchID.AllowDBNull = false;
  393. this.columnBranchID.ReadOnly = true;
  394. this.columnBranchID.Unique = true;
  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. BranchesOperDataSet ds = new BranchesOperDataSet();
  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 string Title {
  525. get {
  526. return ((string)(this[this.tableBranches.TitleColumn]));
  527. }
  528. set {
  529. this[this.tableBranches.TitleColumn] = 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 Chief {
  535. get {
  536. return ((string)(this[this.tableBranches.ChiefColumn]));
  537. }
  538. set {
  539. this[this.tableBranches.ChiefColumn] = value;
  540. }
  541. }
  542. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  543. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  544. public int BranchID {
  545. get {
  546. return ((int)(this[this.tableBranches.BranchIDColumn]));
  547. }
  548. set {
  549. this[this.tableBranches.BranchIDColumn] = 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.BranchesOperDataSetTableAdapters {
  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("Title", "Title");
  694. tableMapping.ColumnMappings.Add("Chief", "Chief");
  695. tableMapping.ColumnMappings.Add("BranchID", "BranchID");
  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 [Branches] WHERE (([Title] = @Original_Title) AND ([Chief] = @Origina" +
  700. "l_Chief) AND ([BranchID] = @Original_BranchID))";
  701. this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
  702. 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, "", "", ""));
  703. 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, "", "", ""));
  704. 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, "", "", ""));
  705. this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
  706. this._adapter.InsertCommand.Connection = this.Connection;
  707. this._adapter.InsertCommand.CommandText = "INSERT INTO [Branches] ([Title], [Chief]) VALUES (@Title, @Chief);\r\nSELECT Title," +
  708. " Chief, BranchID 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 [Branches] SET [Title] = @Title, [Chief] = @Chief WHERE (([Title] = @Origi" +
  715. "nal_Title) AND ([Chief] = @Original_Chief) AND ([BranchID] = @Original_BranchID)" +
  716. ");\r\nSELECT Title, Chief, BranchID FROM Branches WHERE (BranchID = @BranchID)";
  717. this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
  718. 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, "", "", ""));
  719. 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, "", "", ""));
  720. 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, "", "", ""));
  721. 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, "", "", ""));
  722. 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, "", "", ""));
  723. 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, "", "", ""));
  724. }
  725. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  726. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  727. private void InitConnection() {
  728. this._connection = new global::System.Data.SqlClient.SqlConnection();
  729. this._connection.ConnectionString = global::Course_Project.Properties.Settings.Default.courseConnectionString;
  730. }
  731. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  732. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  733. private void InitCommandCollection() {
  734. this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
  735. this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
  736. this._commandCollection[0].Connection = this.Connection;
  737. this._commandCollection[0].CommandText = "SELECT Title, Chief, BranchID FROM Branches";
  738. this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
  739. }
  740. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  741. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  742. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  743. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
  744. public virtual int Fill(BranchesOperDataSet.BranchesDataTable dataTable) {
  745. this.Adapter.SelectCommand = this.CommandCollection[0];
  746. if ((this.ClearBeforeFill == true)) {
  747. dataTable.Clear();
  748. }
  749. int returnValue = this.Adapter.Fill(dataTable);
  750. return returnValue;
  751. }
  752. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  753. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  754. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  755. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
  756. public virtual BranchesOperDataSet.BranchesDataTable GetData() {
  757. this.Adapter.SelectCommand = this.CommandCollection[0];
  758. BranchesOperDataSet.BranchesDataTable dataTable = new BranchesOperDataSet.BranchesDataTable();
  759. this.Adapter.Fill(dataTable);
  760. return dataTable;
  761. }
  762. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  763. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  764. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  765. public virtual int Update(BranchesOperDataSet.BranchesDataTable dataTable) {
  766. return this.Adapter.Update(dataTable);
  767. }
  768. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  769. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  770. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  771. public virtual int Update(BranchesOperDataSet dataSet) {
  772. return this.Adapter.Update(dataSet, "Branches");
  773. }
  774. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  775. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  776. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  777. public virtual int Update(global::System.Data.DataRow dataRow) {
  778. return this.Adapter.Update(new global::System.Data.DataRow[] {
  779. dataRow});
  780. }
  781. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  782. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  783. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  784. public virtual int Update(global::System.Data.DataRow[] dataRows) {
  785. return this.Adapter.Update(dataRows);
  786. }
  787. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  788. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  789. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  790. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
  791. public virtual int Delete(string Original_Title, string Original_Chief, int Original_BranchID) {
  792. if ((Original_Title == null)) {
  793. throw new global::System.ArgumentNullException("Original_Title");
  794. }
  795. else {
  796. this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_Title));
  797. }
  798. if ((Original_Chief == null)) {
  799. throw new global::System.ArgumentNullException("Original_Chief");
  800. }
  801. else {
  802. this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_Chief));
  803. }
  804. this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_BranchID));
  805. global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
  806. if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
  807. != global::System.Data.ConnectionState.Open)) {
  808. this.Adapter.DeleteCommand.Connection.Open();
  809. }
  810. try {
  811. int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
  812. return returnValue;
  813. }
  814. finally {
  815. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  816. this.Adapter.DeleteCommand.Connection.Close();
  817. }
  818. }
  819. }
  820. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  821. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  822. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  823. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
  824. public virtual int Insert(string Title, string Chief) {
  825. if ((Title == null)) {
  826. throw new global::System.ArgumentNullException("Title");
  827. }
  828. else {
  829. this.Adapter.InsertCommand.Parameters[0].Value = ((string)(Title));
  830. }
  831. if ((Chief == null)) {
  832. throw new global::System.ArgumentNullException("Chief");
  833. }
  834. else {
  835. this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Chief));
  836. }
  837. global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
  838. if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
  839. != global::System.Data.ConnectionState.Open)) {
  840. this.Adapter.InsertCommand.Connection.Open();
  841. }
  842. try {
  843. int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
  844. return returnValue;
  845. }
  846. finally {
  847. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  848. this.Adapter.InsertCommand.Connection.Close();
  849. }
  850. }
  851. }
  852. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  853. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  854. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  855. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
  856. public virtual int Update(string Title, string Chief, string Original_Title, string Original_Chief, int Original_BranchID, int BranchID) {
  857. if ((Title == null)) {
  858. throw new global::System.ArgumentNullException("Title");
  859. }
  860. else {
  861. this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(Title));
  862. }
  863. if ((Chief == null)) {
  864. throw new global::System.ArgumentNullException("Chief");
  865. }
  866. else {
  867. this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Chief));
  868. }
  869. if ((Original_Title == null)) {
  870. throw new global::System.ArgumentNullException("Original_Title");
  871. }
  872. else {
  873. this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Original_Title));
  874. }
  875. if ((Original_Chief == null)) {
  876. throw new global::System.ArgumentNullException("Original_Chief");
  877. }
  878. else {
  879. this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Original_Chief));
  880. }
  881. this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Original_BranchID));
  882. this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(BranchID));
  883. global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
  884. if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
  885. != global::System.Data.ConnectionState.Open)) {
  886. this.Adapter.UpdateCommand.Connection.Open();
  887. }
  888. try {
  889. int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
  890. return returnValue;
  891. }
  892. finally {
  893. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  894. this.Adapter.UpdateCommand.Connection.Close();
  895. }
  896. }
  897. }
  898. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  899. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  900. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  901. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
  902. public virtual int Update(string Title, string Chief, string Original_Title, string Original_Chief, int Original_BranchID) {
  903. return this.Update(Title, Chief, Original_Title, Original_Chief, Original_BranchID, Original_BranchID);
  904. }
  905. }
  906. /// <summary>
  907. ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
  908. ///</summary>
  909. [global::System.ComponentModel.DesignerCategoryAttribute("code")]
  910. [global::System.ComponentModel.ToolboxItem(true)]
  911. [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
  912. "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
  913. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
  914. public partial class TableAdapterManager : global::System.ComponentModel.Component {
  915. private UpdateOrderOption _updateOrder;
  916. private BranchesTableAdapter _branchesTableAdapter;
  917. private bool _backupDataSetBeforeUpdate;
  918. private global::System.Data.IDbConnection _connection;
  919. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  920. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  921. public UpdateOrderOption UpdateOrder {
  922. get {
  923. return this._updateOrder;
  924. }
  925. set {
  926. this._updateOrder = value;
  927. }
  928. }
  929. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  930. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  931. [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
  932. "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
  933. "a", "System.Drawing.Design.UITypeEditor")]
  934. public BranchesTableAdapter BranchesTableAdapter {
  935. get {
  936. return this._branchesTableAdapter;
  937. }
  938. set {
  939. this._branchesTableAdapter = value;
  940. }
  941. }
  942. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  943. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  944. public bool BackupDataSetBeforeUpdate {
  945. get {
  946. return this._backupDataSetBeforeUpdate;
  947. }
  948. set {
  949. this._backupDataSetBeforeUpdate = value;
  950. }
  951. }
  952. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  953. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  954. [global::System.ComponentModel.Browsable(false)]
  955. public global::System.Data.IDbConnection Connection {
  956. get {
  957. if ((this._connection != null)) {
  958. return this._connection;
  959. }
  960. if (((this._branchesTableAdapter != null)
  961. && (this._branchesTableAdapter.Connection != null))) {
  962. return this._branchesTableAdapter.Connection;
  963. }
  964. return null;
  965. }
  966. set {
  967. this._connection = value;
  968. }
  969. }
  970. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  971. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  972. [global::System.ComponentModel.Browsable(false)]
  973. public int TableAdapterInstanceCount {
  974. get {
  975. int count = 0;
  976. if ((this._branchesTableAdapter != null)) {
  977. count = (count + 1);
  978. }
  979. return count;
  980. }
  981. }
  982. /// <summary>
  983. ///Update rows in top-down order.
  984. ///</summary>
  985. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  986. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  987. private int UpdateUpdatedRows(BranchesOperDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  988. int result = 0;
  989. if ((this._branchesTableAdapter != null)) {
  990. global::System.Data.DataRow[] updatedRows = dataSet.Branches.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
  991. updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
  992. if (((updatedRows != null)
  993. && (0 < updatedRows.Length))) {
  994. result = (result + this._branchesTableAdapter.Update(updatedRows));
  995. allChangedRows.AddRange(updatedRows);
  996. }
  997. }
  998. return result;
  999. }
  1000. /// <summary>
  1001. ///Insert rows in top-down order.
  1002. ///</summary>
  1003. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1004. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1005. private int UpdateInsertedRows(BranchesOperDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  1006. int result = 0;
  1007. if ((this._branchesTableAdapter != null)) {
  1008. global::System.Data.DataRow[] addedRows = dataSet.Branches.Select(null, null, global::System.Data.DataViewRowState.Added);
  1009. if (((addedRows != null)
  1010. && (0 < addedRows.Length))) {
  1011. result = (result + this._branchesTableAdapter.Update(addedRows));
  1012. allAddedRows.AddRange(addedRows);
  1013. }
  1014. }
  1015. return result;
  1016. }
  1017. /// <summary>
  1018. ///Delete rows in bottom-up order.
  1019. ///</summary>
  1020. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1021. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1022. private int UpdateDeletedRows(BranchesOperDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
  1023. int result = 0;
  1024. if ((this._branchesTableAdapter != null)) {
  1025. global::System.Data.DataRow[] deletedRows = dataSet.Branches.Select(null, null, global::System.Data.DataViewRowState.Deleted);
  1026. if (((deletedRows != null)
  1027. && (0 < deletedRows.Length))) {
  1028. result = (result + this._branchesTableAdapter.Update(deletedRows));
  1029. allChangedRows.AddRange(deletedRows);
  1030. }
  1031. }
  1032. return result;
  1033. }
  1034. /// <summary>
  1035. ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
  1036. ///</summary>
  1037. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1038. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1039. private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  1040. if (((updatedRows == null)
  1041. || (updatedRows.Length < 1))) {
  1042. return updatedRows;
  1043. }
  1044. if (((allAddedRows == null)
  1045. || (allAddedRows.Count < 1))) {
  1046. return updatedRows;
  1047. }
  1048. global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1049. for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
  1050. global::System.Data.DataRow row = updatedRows[i];
  1051. if ((allAddedRows.Contains(row) == false)) {
  1052. realUpdatedRows.Add(row);
  1053. }
  1054. }
  1055. return realUpdatedRows.ToArray();
  1056. }
  1057. /// <summary>
  1058. ///Update all changes to the dataset.
  1059. ///</summary>
  1060. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1061. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1062. public virtual int UpdateAll(BranchesOperDataSet dataSet) {
  1063. if ((dataSet == null)) {
  1064. throw new global::System.ArgumentNullException("dataSet");
  1065. }
  1066. if ((dataSet.HasChanges() == false)) {
  1067. return 0;
  1068. }
  1069. if (((this._branchesTableAdapter != null)
  1070. && (this.MatchTableAdapterConnection(this._branchesTableAdapter.Connection) == false))) {
  1071. throw new global::System.ArgumentException("Все адаптеры таблицы, управляемые диспетчером адаптера таблицы TableAdapterManage" +
  1072. "r, должны использовать одинаковую строку подключения.");
  1073. }
  1074. global::System.Data.IDbConnection workConnection = this.Connection;
  1075. if ((workConnection == null)) {
  1076. throw new global::System.ApplicationException("TableAdapterManager не содержит сведений о подключении. Укажите для каждого адапт" +
  1077. "ера таблицы TableAdapterManager допустимый экземпляр адаптера таблицы.");
  1078. }
  1079. bool workConnOpened = false;
  1080. if (((workConnection.State & global::System.Data.ConnectionState.Broken)
  1081. == global::System.Data.ConnectionState.Broken)) {
  1082. workConnection.Close();
  1083. }
  1084. if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
  1085. workConnection.Open();
  1086. workConnOpened = true;
  1087. }
  1088. global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
  1089. if ((workTransaction == null)) {
  1090. throw new global::System.ApplicationException("Не удается начать транзакцию. Текущее соединение данных не поддерживает транзакци" +
  1091. "и или текущее состояние не позволяет начать транзакцию.");
  1092. }
  1093. global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1094. global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1095. global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
  1096. global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
  1097. int result = 0;
  1098. global::System.Data.DataSet backupDataSet = null;
  1099. if (this.BackupDataSetBeforeUpdate) {
  1100. backupDataSet = new global::System.Data.DataSet();
  1101. backupDataSet.Merge(dataSet);
  1102. }
  1103. try {
  1104. // ---- Prepare for update -----------
  1105. //
  1106. if ((this._branchesTableAdapter != null)) {
  1107. revertConnections.Add(this._branchesTableAdapter, this._branchesTableAdapter.Connection);
  1108. this._branchesTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
  1109. this._branchesTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
  1110. if (this._branchesTableAdapter.Adapter.AcceptChangesDuringUpdate) {
  1111. this._branchesTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
  1112. adaptersWithAcceptChangesDuringUpdate.Add(this._branchesTableAdapter.Adapter);
  1113. }
  1114. }
  1115. //
  1116. //---- Perform updates -----------
  1117. //
  1118. if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
  1119. result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
  1120. result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
  1121. }
  1122. else {
  1123. result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
  1124. result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
  1125. }
  1126. result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
  1127. //
  1128. //---- Commit updates -----------
  1129. //
  1130. workTransaction.Commit();
  1131. if ((0 < allAddedRows.Count)) {
  1132. global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
  1133. allAddedRows.CopyTo(rows);
  1134. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1135. global::System.Data.DataRow row = rows[i];
  1136. row.AcceptChanges();
  1137. }
  1138. }
  1139. if ((0 < allChangedRows.Count)) {
  1140. global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
  1141. allChangedRows.CopyTo(rows);
  1142. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1143. global::System.Data.DataRow row = rows[i];
  1144. row.AcceptChanges();
  1145. }
  1146. }
  1147. }
  1148. catch (global::System.Exception ex) {
  1149. workTransaction.Rollback();
  1150. // ---- Restore the dataset -----------
  1151. if (this.BackupDataSetBeforeUpdate) {
  1152. global::System.Diagnostics.Debug.Assert((backupDataSet != null));
  1153. dataSet.Clear();
  1154. dataSet.Merge(backupDataSet);
  1155. }
  1156. else {
  1157. if ((0 < allAddedRows.Count)) {
  1158. global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
  1159. allAddedRows.CopyTo(rows);
  1160. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1161. global::System.Data.DataRow row = rows[i];
  1162. row.AcceptChanges();
  1163. row.SetAdded();
  1164. }
  1165. }
  1166. }
  1167. throw ex;
  1168. }
  1169. finally {
  1170. if (workConnOpened) {
  1171. workConnection.Close();
  1172. }
  1173. if ((this._branchesTableAdapter != null)) {
  1174. this._branchesTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._branchesTableAdapter]));
  1175. this._branchesTableAdapter.Transaction = null;
  1176. }
  1177. if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
  1178. global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
  1179. adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
  1180. for (int i = 0; (i < adapters.Length); i = (i + 1)) {
  1181. global::System.Data.Common.DataAdapter adapter = adapters[i];
  1182. adapter.AcceptChangesDuringUpdate = true;
  1183. }
  1184. }
  1185. }
  1186. return result;
  1187. }
  1188. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1189. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1190. protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
  1191. global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
  1192. }
  1193. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1194. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1195. protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
  1196. if ((this._connection != null)) {
  1197. return true;
  1198. }
  1199. if (((this.Connection == null)
  1200. || (inputConnection == null))) {
  1201. return true;
  1202. }
  1203. if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
  1204. return true;
  1205. }
  1206. return false;
  1207. }
  1208. /// <summary>
  1209. ///Update Order Option
  1210. ///</summary>
  1211. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1212. public enum UpdateOrderOption {
  1213. InsertUpdateDelete = 0,
  1214. UpdateInsertDelete = 1,
  1215. }
  1216. /// <summary>
  1217. ///Used to sort self-referenced table's rows
  1218. ///</summary>
  1219. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1220. private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
  1221. private global::System.Data.DataRelation _relation;
  1222. private int _childFirst;
  1223. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1224. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1225. internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
  1226. this._relation = relation;
  1227. if (childFirst) {
  1228. this._childFirst = -1;
  1229. }
  1230. else {
  1231. this._childFirst = 1;
  1232. }
  1233. }
  1234. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1235. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1236. private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
  1237. global::System.Diagnostics.Debug.Assert((row != null));
  1238. global::System.Data.DataRow root = row;
  1239. distance = 0;
  1240. 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>();
  1241. traversedRows[row] = row;
  1242. global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
  1243. for (
  1244. ; ((parent != null)
  1245. && (traversedRows.ContainsKey(parent) == false));
  1246. ) {
  1247. distance = (distance + 1);
  1248. root = parent;
  1249. traversedRows[parent] = parent;
  1250. parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
  1251. }
  1252. if ((distance == 0)) {
  1253. traversedRows.Clear();
  1254. traversedRows[row] = row;
  1255. parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
  1256. for (
  1257. ; ((parent != null)
  1258. && (traversedRows.ContainsKey(parent) == false));
  1259. ) {
  1260. distance = (distance + 1);
  1261. root = parent;
  1262. traversedRows[parent] = parent;
  1263. parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
  1264. }
  1265. }
  1266. return root;
  1267. }
  1268. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1269. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1270. public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
  1271. if (object.ReferenceEquals(row1, row2)) {
  1272. return 0;
  1273. }
  1274. if ((row1 == null)) {
  1275. return -1;
  1276. }
  1277. if ((row2 == null)) {
  1278. return 1;
  1279. }
  1280. int distance1 = 0;
  1281. global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
  1282. int distance2 = 0;
  1283. global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
  1284. if (object.ReferenceEquals(root1, root2)) {
  1285. return (this._childFirst * distance1.CompareTo(distance2));
  1286. }
  1287. else {
  1288. global::System.Diagnostics.Debug.Assert(((root1.Table != null)
  1289. && (root2.Table != null)));
  1290. if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
  1291. return -1;
  1292. }
  1293. else {
  1294. return 1;
  1295. }
  1296. }
  1297. }
  1298. }
  1299. }
  1300. }
  1301. #pragma warning restore 1591