compDataSet.Designer.cs 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  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("compDataSet")]
  20. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
  21. public partial class compDataSet : global::System.Data.DataSet {
  22. private CompaniesDataTable tableCompanies;
  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 compDataSet() {
  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 compDataSet(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["Companies"] != null)) {
  50. base.Tables.Add(new CompaniesDataTable(ds.Tables["Companies"]));
  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 CompaniesDataTable Companies {
  74. get {
  75. return this.tableCompanies;
  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. compDataSet cln = ((compDataSet)(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["Companies"] != null)) {
  139. base.Tables.Add(new CompaniesDataTable(ds.Tables["Companies"]));
  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.tableCompanies = ((CompaniesDataTable)(base.Tables["Companies"]));
  172. if ((initTable == true)) {
  173. if ((this.tableCompanies != null)) {
  174. this.tableCompanies.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 = "compDataSet";
  182. this.Prefix = "";
  183. this.Namespace = "http://tempuri.org/compDataSet.xsd";
  184. this.EnforceConstraints = true;
  185. this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
  186. this.tableCompanies = new CompaniesDataTable();
  187. base.Tables.Add(this.tableCompanies);
  188. }
  189. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  190. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  191. private bool ShouldSerializeCompanies() {
  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. compDataSet ds = new compDataSet();
  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 CompaniesRowChangeEventHandler(object sender, CompaniesRowChangeEvent 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 CompaniesDataTable : global::System.Data.TypedTableBase<CompaniesRow> {
  255. private global::System.Data.DataColumn columnCompanyID;
  256. private global::System.Data.DataColumn columnTitle;
  257. private global::System.Data.DataColumn columnAddress;
  258. private global::System.Data.DataColumn columnTelNumber;
  259. private global::System.Data.DataColumn columnRequisites;
  260. private global::System.Data.DataColumn columnResponsiblePerson;
  261. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  262. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  263. public CompaniesDataTable() {
  264. this.TableName = "Companies";
  265. this.BeginInit();
  266. this.InitClass();
  267. this.EndInit();
  268. }
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  270. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  271. internal CompaniesDataTable(global::System.Data.DataTable table) {
  272. this.TableName = table.TableName;
  273. if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
  274. this.CaseSensitive = table.CaseSensitive;
  275. }
  276. if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
  277. this.Locale = table.Locale;
  278. }
  279. if ((table.Namespace != table.DataSet.Namespace)) {
  280. this.Namespace = table.Namespace;
  281. }
  282. this.Prefix = table.Prefix;
  283. this.MinimumCapacity = table.MinimumCapacity;
  284. }
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  286. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  287. protected CompaniesDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
  288. base(info, context) {
  289. this.InitVars();
  290. }
  291. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  292. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  293. public global::System.Data.DataColumn CompanyIDColumn {
  294. get {
  295. return this.columnCompanyID;
  296. }
  297. }
  298. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  299. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  300. public global::System.Data.DataColumn TitleColumn {
  301. get {
  302. return this.columnTitle;
  303. }
  304. }
  305. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  306. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  307. public global::System.Data.DataColumn AddressColumn {
  308. get {
  309. return this.columnAddress;
  310. }
  311. }
  312. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  313. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  314. public global::System.Data.DataColumn TelNumberColumn {
  315. get {
  316. return this.columnTelNumber;
  317. }
  318. }
  319. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  320. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  321. public global::System.Data.DataColumn RequisitesColumn {
  322. get {
  323. return this.columnRequisites;
  324. }
  325. }
  326. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  327. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  328. public global::System.Data.DataColumn ResponsiblePersonColumn {
  329. get {
  330. return this.columnResponsiblePerson;
  331. }
  332. }
  333. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  334. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  335. [global::System.ComponentModel.Browsable(false)]
  336. public int Count {
  337. get {
  338. return this.Rows.Count;
  339. }
  340. }
  341. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  342. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  343. public CompaniesRow this[int index] {
  344. get {
  345. return ((CompaniesRow)(this.Rows[index]));
  346. }
  347. }
  348. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  349. public event CompaniesRowChangeEventHandler CompaniesRowChanging;
  350. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  351. public event CompaniesRowChangeEventHandler CompaniesRowChanged;
  352. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  353. public event CompaniesRowChangeEventHandler CompaniesRowDeleting;
  354. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  355. public event CompaniesRowChangeEventHandler CompaniesRowDeleted;
  356. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  357. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  358. public void AddCompaniesRow(CompaniesRow row) {
  359. this.Rows.Add(row);
  360. }
  361. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  362. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  363. public CompaniesRow AddCompaniesRow(string Title, string Address, string TelNumber, string Requisites, string ResponsiblePerson) {
  364. CompaniesRow rowCompaniesRow = ((CompaniesRow)(this.NewRow()));
  365. object[] columnValuesArray = new object[] {
  366. null,
  367. Title,
  368. Address,
  369. TelNumber,
  370. Requisites,
  371. ResponsiblePerson};
  372. rowCompaniesRow.ItemArray = columnValuesArray;
  373. this.Rows.Add(rowCompaniesRow);
  374. return rowCompaniesRow;
  375. }
  376. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  377. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  378. public CompaniesRow FindByCompanyID(int CompanyID) {
  379. return ((CompaniesRow)(this.Rows.Find(new object[] {
  380. CompanyID})));
  381. }
  382. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  383. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  384. public override global::System.Data.DataTable Clone() {
  385. CompaniesDataTable cln = ((CompaniesDataTable)(base.Clone()));
  386. cln.InitVars();
  387. return cln;
  388. }
  389. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  390. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  391. protected override global::System.Data.DataTable CreateInstance() {
  392. return new CompaniesDataTable();
  393. }
  394. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  395. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  396. internal void InitVars() {
  397. this.columnCompanyID = base.Columns["CompanyID"];
  398. this.columnTitle = base.Columns["Title"];
  399. this.columnAddress = base.Columns["Address"];
  400. this.columnTelNumber = base.Columns["TelNumber"];
  401. this.columnRequisites = base.Columns["Requisites"];
  402. this.columnResponsiblePerson = base.Columns["ResponsiblePerson"];
  403. }
  404. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  405. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  406. private void InitClass() {
  407. this.columnCompanyID = new global::System.Data.DataColumn("CompanyID", typeof(int), null, global::System.Data.MappingType.Element);
  408. base.Columns.Add(this.columnCompanyID);
  409. this.columnTitle = new global::System.Data.DataColumn("Title", typeof(string), null, global::System.Data.MappingType.Element);
  410. base.Columns.Add(this.columnTitle);
  411. this.columnAddress = new global::System.Data.DataColumn("Address", typeof(string), null, global::System.Data.MappingType.Element);
  412. base.Columns.Add(this.columnAddress);
  413. this.columnTelNumber = new global::System.Data.DataColumn("TelNumber", typeof(string), null, global::System.Data.MappingType.Element);
  414. base.Columns.Add(this.columnTelNumber);
  415. this.columnRequisites = new global::System.Data.DataColumn("Requisites", typeof(string), null, global::System.Data.MappingType.Element);
  416. base.Columns.Add(this.columnRequisites);
  417. this.columnResponsiblePerson = new global::System.Data.DataColumn("ResponsiblePerson", typeof(string), null, global::System.Data.MappingType.Element);
  418. base.Columns.Add(this.columnResponsiblePerson);
  419. this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
  420. this.columnCompanyID}, true));
  421. this.columnCompanyID.AutoIncrement = true;
  422. this.columnCompanyID.AutoIncrementSeed = -1;
  423. this.columnCompanyID.AutoIncrementStep = -1;
  424. this.columnCompanyID.AllowDBNull = false;
  425. this.columnCompanyID.ReadOnly = true;
  426. this.columnCompanyID.Unique = true;
  427. this.columnTitle.AllowDBNull = false;
  428. this.columnTitle.MaxLength = 50;
  429. this.columnAddress.AllowDBNull = false;
  430. this.columnAddress.MaxLength = 50;
  431. this.columnTelNumber.AllowDBNull = false;
  432. this.columnTelNumber.MaxLength = 15;
  433. this.columnRequisites.AllowDBNull = false;
  434. this.columnRequisites.MaxLength = 150;
  435. this.columnResponsiblePerson.AllowDBNull = false;
  436. this.columnResponsiblePerson.MaxLength = 50;
  437. }
  438. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  439. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  440. public CompaniesRow NewCompaniesRow() {
  441. return ((CompaniesRow)(this.NewRow()));
  442. }
  443. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  444. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  445. protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
  446. return new CompaniesRow(builder);
  447. }
  448. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  449. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  450. protected override global::System.Type GetRowType() {
  451. return typeof(CompaniesRow);
  452. }
  453. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  454. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  455. protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
  456. base.OnRowChanged(e);
  457. if ((this.CompaniesRowChanged != null)) {
  458. this.CompaniesRowChanged(this, new CompaniesRowChangeEvent(((CompaniesRow)(e.Row)), e.Action));
  459. }
  460. }
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  462. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  463. protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
  464. base.OnRowChanging(e);
  465. if ((this.CompaniesRowChanging != null)) {
  466. this.CompaniesRowChanging(this, new CompaniesRowChangeEvent(((CompaniesRow)(e.Row)), e.Action));
  467. }
  468. }
  469. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  470. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  471. protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
  472. base.OnRowDeleted(e);
  473. if ((this.CompaniesRowDeleted != null)) {
  474. this.CompaniesRowDeleted(this, new CompaniesRowChangeEvent(((CompaniesRow)(e.Row)), e.Action));
  475. }
  476. }
  477. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  478. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  479. protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
  480. base.OnRowDeleting(e);
  481. if ((this.CompaniesRowDeleting != null)) {
  482. this.CompaniesRowDeleting(this, new CompaniesRowChangeEvent(((CompaniesRow)(e.Row)), e.Action));
  483. }
  484. }
  485. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  486. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  487. public void RemoveCompaniesRow(CompaniesRow row) {
  488. this.Rows.Remove(row);
  489. }
  490. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  491. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  492. public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
  493. global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
  494. global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
  495. compDataSet ds = new compDataSet();
  496. global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
  497. any1.Namespace = "http://www.w3.org/2001/XMLSchema";
  498. any1.MinOccurs = new decimal(0);
  499. any1.MaxOccurs = decimal.MaxValue;
  500. any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
  501. sequence.Items.Add(any1);
  502. global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
  503. any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
  504. any2.MinOccurs = new decimal(1);
  505. any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
  506. sequence.Items.Add(any2);
  507. global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
  508. attribute1.Name = "namespace";
  509. attribute1.FixedValue = ds.Namespace;
  510. type.Attributes.Add(attribute1);
  511. global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
  512. attribute2.Name = "tableTypeName";
  513. attribute2.FixedValue = "CompaniesDataTable";
  514. type.Attributes.Add(attribute2);
  515. type.Particle = sequence;
  516. global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
  517. if (xs.Contains(dsSchema.TargetNamespace)) {
  518. global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
  519. global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
  520. try {
  521. global::System.Xml.Schema.XmlSchema schema = null;
  522. dsSchema.Write(s1);
  523. for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
  524. schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
  525. s2.SetLength(0);
  526. schema.Write(s2);
  527. if ((s1.Length == s2.Length)) {
  528. s1.Position = 0;
  529. s2.Position = 0;
  530. for (; ((s1.Position != s1.Length)
  531. && (s1.ReadByte() == s2.ReadByte())); ) {
  532. ;
  533. }
  534. if ((s1.Position == s1.Length)) {
  535. return type;
  536. }
  537. }
  538. }
  539. }
  540. finally {
  541. if ((s1 != null)) {
  542. s1.Close();
  543. }
  544. if ((s2 != null)) {
  545. s2.Close();
  546. }
  547. }
  548. }
  549. xs.Add(dsSchema);
  550. return type;
  551. }
  552. }
  553. /// <summary>
  554. ///Represents strongly named DataRow class.
  555. ///</summary>
  556. public partial class CompaniesRow : global::System.Data.DataRow {
  557. private CompaniesDataTable tableCompanies;
  558. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  559. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  560. internal CompaniesRow(global::System.Data.DataRowBuilder rb) :
  561. base(rb) {
  562. this.tableCompanies = ((CompaniesDataTable)(this.Table));
  563. }
  564. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  565. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  566. public int CompanyID {
  567. get {
  568. return ((int)(this[this.tableCompanies.CompanyIDColumn]));
  569. }
  570. set {
  571. this[this.tableCompanies.CompanyIDColumn] = value;
  572. }
  573. }
  574. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  575. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  576. public string Title {
  577. get {
  578. return ((string)(this[this.tableCompanies.TitleColumn]));
  579. }
  580. set {
  581. this[this.tableCompanies.TitleColumn] = value;
  582. }
  583. }
  584. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  585. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  586. public string Address {
  587. get {
  588. return ((string)(this[this.tableCompanies.AddressColumn]));
  589. }
  590. set {
  591. this[this.tableCompanies.AddressColumn] = value;
  592. }
  593. }
  594. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  595. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  596. public string TelNumber {
  597. get {
  598. return ((string)(this[this.tableCompanies.TelNumberColumn]));
  599. }
  600. set {
  601. this[this.tableCompanies.TelNumberColumn] = value;
  602. }
  603. }
  604. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  605. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  606. public string Requisites {
  607. get {
  608. return ((string)(this[this.tableCompanies.RequisitesColumn]));
  609. }
  610. set {
  611. this[this.tableCompanies.RequisitesColumn] = value;
  612. }
  613. }
  614. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  615. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  616. public string ResponsiblePerson {
  617. get {
  618. return ((string)(this[this.tableCompanies.ResponsiblePersonColumn]));
  619. }
  620. set {
  621. this[this.tableCompanies.ResponsiblePersonColumn] = value;
  622. }
  623. }
  624. }
  625. /// <summary>
  626. ///Row event argument class
  627. ///</summary>
  628. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  629. public class CompaniesRowChangeEvent : global::System.EventArgs {
  630. private CompaniesRow eventRow;
  631. private global::System.Data.DataRowAction eventAction;
  632. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  633. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  634. public CompaniesRowChangeEvent(CompaniesRow row, global::System.Data.DataRowAction action) {
  635. this.eventRow = row;
  636. this.eventAction = action;
  637. }
  638. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  639. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  640. public CompaniesRow Row {
  641. get {
  642. return this.eventRow;
  643. }
  644. }
  645. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  646. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  647. public global::System.Data.DataRowAction Action {
  648. get {
  649. return this.eventAction;
  650. }
  651. }
  652. }
  653. }
  654. }
  655. namespace Course_Project.compDataSetTableAdapters {
  656. /// <summary>
  657. ///Represents the connection and commands used to retrieve and save data.
  658. ///</summary>
  659. [global::System.ComponentModel.DesignerCategoryAttribute("code")]
  660. [global::System.ComponentModel.ToolboxItem(true)]
  661. [global::System.ComponentModel.DataObjectAttribute(true)]
  662. [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
  663. ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
  664. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  665. public partial class CompaniesTableAdapter : global::System.ComponentModel.Component {
  666. private global::System.Data.SqlClient.SqlDataAdapter _adapter;
  667. private global::System.Data.SqlClient.SqlConnection _connection;
  668. private global::System.Data.SqlClient.SqlTransaction _transaction;
  669. private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
  670. private bool _clearBeforeFill;
  671. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  672. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  673. public CompaniesTableAdapter() {
  674. this.ClearBeforeFill = true;
  675. }
  676. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  677. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  678. protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
  679. get {
  680. if ((this._adapter == null)) {
  681. this.InitAdapter();
  682. }
  683. return this._adapter;
  684. }
  685. }
  686. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  687. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  688. internal global::System.Data.SqlClient.SqlConnection Connection {
  689. get {
  690. if ((this._connection == null)) {
  691. this.InitConnection();
  692. }
  693. return this._connection;
  694. }
  695. set {
  696. this._connection = value;
  697. if ((this.Adapter.InsertCommand != null)) {
  698. this.Adapter.InsertCommand.Connection = value;
  699. }
  700. if ((this.Adapter.DeleteCommand != null)) {
  701. this.Adapter.DeleteCommand.Connection = value;
  702. }
  703. if ((this.Adapter.UpdateCommand != null)) {
  704. this.Adapter.UpdateCommand.Connection = value;
  705. }
  706. for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
  707. if ((this.CommandCollection[i] != null)) {
  708. ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
  709. }
  710. }
  711. }
  712. }
  713. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  714. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  715. internal global::System.Data.SqlClient.SqlTransaction Transaction {
  716. get {
  717. return this._transaction;
  718. }
  719. set {
  720. this._transaction = value;
  721. for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
  722. this.CommandCollection[i].Transaction = this._transaction;
  723. }
  724. if (((this.Adapter != null)
  725. && (this.Adapter.DeleteCommand != null))) {
  726. this.Adapter.DeleteCommand.Transaction = this._transaction;
  727. }
  728. if (((this.Adapter != null)
  729. && (this.Adapter.InsertCommand != null))) {
  730. this.Adapter.InsertCommand.Transaction = this._transaction;
  731. }
  732. if (((this.Adapter != null)
  733. && (this.Adapter.UpdateCommand != null))) {
  734. this.Adapter.UpdateCommand.Transaction = this._transaction;
  735. }
  736. }
  737. }
  738. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  739. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  740. protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
  741. get {
  742. if ((this._commandCollection == null)) {
  743. this.InitCommandCollection();
  744. }
  745. return this._commandCollection;
  746. }
  747. }
  748. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  749. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  750. public bool ClearBeforeFill {
  751. get {
  752. return this._clearBeforeFill;
  753. }
  754. set {
  755. this._clearBeforeFill = value;
  756. }
  757. }
  758. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  759. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  760. private void InitAdapter() {
  761. this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
  762. global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
  763. tableMapping.SourceTable = "Table";
  764. tableMapping.DataSetTable = "Companies";
  765. tableMapping.ColumnMappings.Add("CompanyID", "CompanyID");
  766. tableMapping.ColumnMappings.Add("Title", "Title");
  767. tableMapping.ColumnMappings.Add("Address", "Address");
  768. tableMapping.ColumnMappings.Add("TelNumber", "TelNumber");
  769. tableMapping.ColumnMappings.Add("Requisites", "Requisites");
  770. tableMapping.ColumnMappings.Add("ResponsiblePerson", "ResponsiblePerson");
  771. this._adapter.TableMappings.Add(tableMapping);
  772. this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
  773. this._adapter.DeleteCommand.Connection = this.Connection;
  774. this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[Companies] WHERE (([CompanyID] = @Original_CompanyID) AND ([Title] = @Original_Title) AND ([Address] = @Original_Address) AND ([TelNumber] = @Original_TelNumber) AND ([Requisites] = @Original_Requisites) AND ([ResponsiblePerson] = @Original_ResponsiblePerson))";
  775. this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
  776. this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CompanyID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CompanyID", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  777. 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, "", "", ""));
  778. this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Address", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Address", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  779. this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TelNumber", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TelNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  780. this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Requisites", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Requisites", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  781. this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ResponsiblePerson", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResponsiblePerson", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  782. this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
  783. this._adapter.InsertCommand.Connection = this.Connection;
  784. this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[Companies] ([Title], [Address], [TelNumber], [Requisites], [ResponsiblePerson]) VALUES (@Title, @Address, @TelNumber, @Requisites, @ResponsiblePerson);
  785. SELECT CompanyID, Title, Address, TelNumber, Requisites, ResponsiblePerson FROM Companies WHERE (CompanyID = SCOPE_IDENTITY())";
  786. this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
  787. 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, "", "", ""));
  788. this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Address", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Address", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  789. this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TelNumber", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TelNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  790. this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Requisites", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Requisites", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  791. this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResponsiblePerson", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResponsiblePerson", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  792. this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
  793. this._adapter.UpdateCommand.Connection = this.Connection;
  794. this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[Companies] SET [Title] = @Title, [Address] = @Address, [TelNumber] = @TelNumber, [Requisites] = @Requisites, [ResponsiblePerson] = @ResponsiblePerson WHERE (([CompanyID] = @Original_CompanyID) AND ([Title] = @Original_Title) AND ([Address] = @Original_Address) AND ([TelNumber] = @Original_TelNumber) AND ([Requisites] = @Original_Requisites) AND ([ResponsiblePerson] = @Original_ResponsiblePerson));
  795. SELECT CompanyID, Title, Address, TelNumber, Requisites, ResponsiblePerson FROM Companies WHERE (CompanyID = @CompanyID)";
  796. this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
  797. 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, "", "", ""));
  798. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Address", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Address", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  799. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TelNumber", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TelNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  800. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Requisites", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Requisites", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  801. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResponsiblePerson", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResponsiblePerson", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  802. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CompanyID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CompanyID", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  803. 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, "", "", ""));
  804. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Address", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Address", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  805. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TelNumber", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TelNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  806. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Requisites", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Requisites", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  807. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ResponsiblePerson", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResponsiblePerson", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
  808. this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CompanyID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "CompanyID", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
  809. }
  810. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  811. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  812. private void InitConnection() {
  813. this._connection = new global::System.Data.SqlClient.SqlConnection();
  814. this._connection.ConnectionString = global::Course_Project.Properties.Settings.Default.courseConnectionString;
  815. }
  816. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  817. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  818. private void InitCommandCollection() {
  819. this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
  820. this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
  821. this._commandCollection[0].Connection = this.Connection;
  822. this._commandCollection[0].CommandText = "SELECT CompanyID, Title, Address, TelNumber, Requisites, ResponsiblePerson FROM d" +
  823. "bo.Companies";
  824. this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
  825. }
  826. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  827. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  828. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  829. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
  830. public virtual int Fill(compDataSet.CompaniesDataTable dataTable) {
  831. this.Adapter.SelectCommand = this.CommandCollection[0];
  832. if ((this.ClearBeforeFill == true)) {
  833. dataTable.Clear();
  834. }
  835. int returnValue = this.Adapter.Fill(dataTable);
  836. return returnValue;
  837. }
  838. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  839. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  840. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  841. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
  842. public virtual compDataSet.CompaniesDataTable GetData() {
  843. this.Adapter.SelectCommand = this.CommandCollection[0];
  844. compDataSet.CompaniesDataTable dataTable = new compDataSet.CompaniesDataTable();
  845. this.Adapter.Fill(dataTable);
  846. return dataTable;
  847. }
  848. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  849. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  850. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  851. public virtual int Update(compDataSet.CompaniesDataTable dataTable) {
  852. return this.Adapter.Update(dataTable);
  853. }
  854. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  855. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  856. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  857. public virtual int Update(compDataSet dataSet) {
  858. return this.Adapter.Update(dataSet, "Companies");
  859. }
  860. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  861. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  862. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  863. public virtual int Update(global::System.Data.DataRow dataRow) {
  864. return this.Adapter.Update(new global::System.Data.DataRow[] {
  865. dataRow});
  866. }
  867. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  868. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  869. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  870. public virtual int Update(global::System.Data.DataRow[] dataRows) {
  871. return this.Adapter.Update(dataRows);
  872. }
  873. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  874. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  875. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  876. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
  877. public virtual int Delete(int Original_CompanyID, string Original_Title, string Original_Address, string Original_TelNumber, string Original_Requisites, string Original_ResponsiblePerson) {
  878. this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_CompanyID));
  879. if ((Original_Title == null)) {
  880. throw new global::System.ArgumentNullException("Original_Title");
  881. }
  882. else {
  883. this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_Title));
  884. }
  885. if ((Original_Address == null)) {
  886. throw new global::System.ArgumentNullException("Original_Address");
  887. }
  888. else {
  889. this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_Address));
  890. }
  891. if ((Original_TelNumber == null)) {
  892. throw new global::System.ArgumentNullException("Original_TelNumber");
  893. }
  894. else {
  895. this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_TelNumber));
  896. }
  897. if ((Original_Requisites == null)) {
  898. throw new global::System.ArgumentNullException("Original_Requisites");
  899. }
  900. else {
  901. this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_Requisites));
  902. }
  903. if ((Original_ResponsiblePerson == null)) {
  904. throw new global::System.ArgumentNullException("Original_ResponsiblePerson");
  905. }
  906. else {
  907. this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_ResponsiblePerson));
  908. }
  909. global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
  910. if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
  911. != global::System.Data.ConnectionState.Open)) {
  912. this.Adapter.DeleteCommand.Connection.Open();
  913. }
  914. try {
  915. int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
  916. return returnValue;
  917. }
  918. finally {
  919. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  920. this.Adapter.DeleteCommand.Connection.Close();
  921. }
  922. }
  923. }
  924. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  925. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  926. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  927. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
  928. public virtual int Insert(string Title, string Address, string TelNumber, string Requisites, string ResponsiblePerson) {
  929. if ((Title == null)) {
  930. throw new global::System.ArgumentNullException("Title");
  931. }
  932. else {
  933. this.Adapter.InsertCommand.Parameters[0].Value = ((string)(Title));
  934. }
  935. if ((Address == null)) {
  936. throw new global::System.ArgumentNullException("Address");
  937. }
  938. else {
  939. this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Address));
  940. }
  941. if ((TelNumber == null)) {
  942. throw new global::System.ArgumentNullException("TelNumber");
  943. }
  944. else {
  945. this.Adapter.InsertCommand.Parameters[2].Value = ((string)(TelNumber));
  946. }
  947. if ((Requisites == null)) {
  948. throw new global::System.ArgumentNullException("Requisites");
  949. }
  950. else {
  951. this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Requisites));
  952. }
  953. if ((ResponsiblePerson == null)) {
  954. throw new global::System.ArgumentNullException("ResponsiblePerson");
  955. }
  956. else {
  957. this.Adapter.InsertCommand.Parameters[4].Value = ((string)(ResponsiblePerson));
  958. }
  959. global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
  960. if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
  961. != global::System.Data.ConnectionState.Open)) {
  962. this.Adapter.InsertCommand.Connection.Open();
  963. }
  964. try {
  965. int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
  966. return returnValue;
  967. }
  968. finally {
  969. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  970. this.Adapter.InsertCommand.Connection.Close();
  971. }
  972. }
  973. }
  974. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  975. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  976. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  977. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
  978. public virtual int Update(string Title, string Address, string TelNumber, string Requisites, string ResponsiblePerson, int Original_CompanyID, string Original_Title, string Original_Address, string Original_TelNumber, string Original_Requisites, string Original_ResponsiblePerson, int CompanyID) {
  979. if ((Title == null)) {
  980. throw new global::System.ArgumentNullException("Title");
  981. }
  982. else {
  983. this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(Title));
  984. }
  985. if ((Address == null)) {
  986. throw new global::System.ArgumentNullException("Address");
  987. }
  988. else {
  989. this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Address));
  990. }
  991. if ((TelNumber == null)) {
  992. throw new global::System.ArgumentNullException("TelNumber");
  993. }
  994. else {
  995. this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(TelNumber));
  996. }
  997. if ((Requisites == null)) {
  998. throw new global::System.ArgumentNullException("Requisites");
  999. }
  1000. else {
  1001. this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Requisites));
  1002. }
  1003. if ((ResponsiblePerson == null)) {
  1004. throw new global::System.ArgumentNullException("ResponsiblePerson");
  1005. }
  1006. else {
  1007. this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(ResponsiblePerson));
  1008. }
  1009. this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_CompanyID));
  1010. if ((Original_Title == null)) {
  1011. throw new global::System.ArgumentNullException("Original_Title");
  1012. }
  1013. else {
  1014. this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_Title));
  1015. }
  1016. if ((Original_Address == null)) {
  1017. throw new global::System.ArgumentNullException("Original_Address");
  1018. }
  1019. else {
  1020. this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_Address));
  1021. }
  1022. if ((Original_TelNumber == null)) {
  1023. throw new global::System.ArgumentNullException("Original_TelNumber");
  1024. }
  1025. else {
  1026. this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_TelNumber));
  1027. }
  1028. if ((Original_Requisites == null)) {
  1029. throw new global::System.ArgumentNullException("Original_Requisites");
  1030. }
  1031. else {
  1032. this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_Requisites));
  1033. }
  1034. if ((Original_ResponsiblePerson == null)) {
  1035. throw new global::System.ArgumentNullException("Original_ResponsiblePerson");
  1036. }
  1037. else {
  1038. this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_ResponsiblePerson));
  1039. }
  1040. this.Adapter.UpdateCommand.Parameters[11].Value = ((int)(CompanyID));
  1041. global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
  1042. if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
  1043. != global::System.Data.ConnectionState.Open)) {
  1044. this.Adapter.UpdateCommand.Connection.Open();
  1045. }
  1046. try {
  1047. int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
  1048. return returnValue;
  1049. }
  1050. finally {
  1051. if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
  1052. this.Adapter.UpdateCommand.Connection.Close();
  1053. }
  1054. }
  1055. }
  1056. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1057. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1058. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
  1059. [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
  1060. public virtual int Update(string Title, string Address, string TelNumber, string Requisites, string ResponsiblePerson, int Original_CompanyID, string Original_Title, string Original_Address, string Original_TelNumber, string Original_Requisites, string Original_ResponsiblePerson) {
  1061. return this.Update(Title, Address, TelNumber, Requisites, ResponsiblePerson, Original_CompanyID, Original_Title, Original_Address, Original_TelNumber, Original_Requisites, Original_ResponsiblePerson, Original_CompanyID);
  1062. }
  1063. }
  1064. /// <summary>
  1065. ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
  1066. ///</summary>
  1067. [global::System.ComponentModel.DesignerCategoryAttribute("code")]
  1068. [global::System.ComponentModel.ToolboxItem(true)]
  1069. [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
  1070. "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
  1071. [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
  1072. public partial class TableAdapterManager : global::System.ComponentModel.Component {
  1073. private UpdateOrderOption _updateOrder;
  1074. private CompaniesTableAdapter _companiesTableAdapter;
  1075. private bool _backupDataSetBeforeUpdate;
  1076. private global::System.Data.IDbConnection _connection;
  1077. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1078. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1079. public UpdateOrderOption UpdateOrder {
  1080. get {
  1081. return this._updateOrder;
  1082. }
  1083. set {
  1084. this._updateOrder = value;
  1085. }
  1086. }
  1087. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1088. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1089. [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
  1090. "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
  1091. "a", "System.Drawing.Design.UITypeEditor")]
  1092. public CompaniesTableAdapter CompaniesTableAdapter {
  1093. get {
  1094. return this._companiesTableAdapter;
  1095. }
  1096. set {
  1097. this._companiesTableAdapter = value;
  1098. }
  1099. }
  1100. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1101. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1102. public bool BackupDataSetBeforeUpdate {
  1103. get {
  1104. return this._backupDataSetBeforeUpdate;
  1105. }
  1106. set {
  1107. this._backupDataSetBeforeUpdate = value;
  1108. }
  1109. }
  1110. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1111. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1112. [global::System.ComponentModel.Browsable(false)]
  1113. public global::System.Data.IDbConnection Connection {
  1114. get {
  1115. if ((this._connection != null)) {
  1116. return this._connection;
  1117. }
  1118. if (((this._companiesTableAdapter != null)
  1119. && (this._companiesTableAdapter.Connection != null))) {
  1120. return this._companiesTableAdapter.Connection;
  1121. }
  1122. return null;
  1123. }
  1124. set {
  1125. this._connection = value;
  1126. }
  1127. }
  1128. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1129. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1130. [global::System.ComponentModel.Browsable(false)]
  1131. public int TableAdapterInstanceCount {
  1132. get {
  1133. int count = 0;
  1134. if ((this._companiesTableAdapter != null)) {
  1135. count = (count + 1);
  1136. }
  1137. return count;
  1138. }
  1139. }
  1140. /// <summary>
  1141. ///Update rows in top-down order.
  1142. ///</summary>
  1143. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1144. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1145. private int UpdateUpdatedRows(compDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  1146. int result = 0;
  1147. if ((this._companiesTableAdapter != null)) {
  1148. global::System.Data.DataRow[] updatedRows = dataSet.Companies.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
  1149. updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
  1150. if (((updatedRows != null)
  1151. && (0 < updatedRows.Length))) {
  1152. result = (result + this._companiesTableAdapter.Update(updatedRows));
  1153. allChangedRows.AddRange(updatedRows);
  1154. }
  1155. }
  1156. return result;
  1157. }
  1158. /// <summary>
  1159. ///Insert rows in top-down order.
  1160. ///</summary>
  1161. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1162. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1163. private int UpdateInsertedRows(compDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  1164. int result = 0;
  1165. if ((this._companiesTableAdapter != null)) {
  1166. global::System.Data.DataRow[] addedRows = dataSet.Companies.Select(null, null, global::System.Data.DataViewRowState.Added);
  1167. if (((addedRows != null)
  1168. && (0 < addedRows.Length))) {
  1169. result = (result + this._companiesTableAdapter.Update(addedRows));
  1170. allAddedRows.AddRange(addedRows);
  1171. }
  1172. }
  1173. return result;
  1174. }
  1175. /// <summary>
  1176. ///Delete rows in bottom-up order.
  1177. ///</summary>
  1178. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1179. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1180. private int UpdateDeletedRows(compDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
  1181. int result = 0;
  1182. if ((this._companiesTableAdapter != null)) {
  1183. global::System.Data.DataRow[] deletedRows = dataSet.Companies.Select(null, null, global::System.Data.DataViewRowState.Deleted);
  1184. if (((deletedRows != null)
  1185. && (0 < deletedRows.Length))) {
  1186. result = (result + this._companiesTableAdapter.Update(deletedRows));
  1187. allChangedRows.AddRange(deletedRows);
  1188. }
  1189. }
  1190. return result;
  1191. }
  1192. /// <summary>
  1193. ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
  1194. ///</summary>
  1195. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1196. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1197. private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
  1198. if (((updatedRows == null)
  1199. || (updatedRows.Length < 1))) {
  1200. return updatedRows;
  1201. }
  1202. if (((allAddedRows == null)
  1203. || (allAddedRows.Count < 1))) {
  1204. return updatedRows;
  1205. }
  1206. global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1207. for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
  1208. global::System.Data.DataRow row = updatedRows[i];
  1209. if ((allAddedRows.Contains(row) == false)) {
  1210. realUpdatedRows.Add(row);
  1211. }
  1212. }
  1213. return realUpdatedRows.ToArray();
  1214. }
  1215. /// <summary>
  1216. ///Update all changes to the dataset.
  1217. ///</summary>
  1218. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1219. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1220. public virtual int UpdateAll(compDataSet dataSet) {
  1221. if ((dataSet == null)) {
  1222. throw new global::System.ArgumentNullException("dataSet");
  1223. }
  1224. if ((dataSet.HasChanges() == false)) {
  1225. return 0;
  1226. }
  1227. if (((this._companiesTableAdapter != null)
  1228. && (this.MatchTableAdapterConnection(this._companiesTableAdapter.Connection) == false))) {
  1229. throw new global::System.ArgumentException("Все адаптеры таблицы, управляемые диспетчером адаптера таблицы TableAdapterManage" +
  1230. "r, должны использовать одинаковую строку подключения.");
  1231. }
  1232. global::System.Data.IDbConnection workConnection = this.Connection;
  1233. if ((workConnection == null)) {
  1234. throw new global::System.ApplicationException("TableAdapterManager не содержит сведений о подключении. Укажите для каждого адапт" +
  1235. "ера таблицы TableAdapterManager допустимый экземпляр адаптера таблицы.");
  1236. }
  1237. bool workConnOpened = false;
  1238. if (((workConnection.State & global::System.Data.ConnectionState.Broken)
  1239. == global::System.Data.ConnectionState.Broken)) {
  1240. workConnection.Close();
  1241. }
  1242. if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
  1243. workConnection.Open();
  1244. workConnOpened = true;
  1245. }
  1246. global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
  1247. if ((workTransaction == null)) {
  1248. throw new global::System.ApplicationException("Не удается начать транзакцию. Текущее соединение данных не поддерживает транзакци" +
  1249. "и или текущее состояние не позволяет начать транзакцию.");
  1250. }
  1251. global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1252. global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
  1253. global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
  1254. global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
  1255. int result = 0;
  1256. global::System.Data.DataSet backupDataSet = null;
  1257. if (this.BackupDataSetBeforeUpdate) {
  1258. backupDataSet = new global::System.Data.DataSet();
  1259. backupDataSet.Merge(dataSet);
  1260. }
  1261. try {
  1262. // ---- Prepare for update -----------
  1263. //
  1264. if ((this._companiesTableAdapter != null)) {
  1265. revertConnections.Add(this._companiesTableAdapter, this._companiesTableAdapter.Connection);
  1266. this._companiesTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
  1267. this._companiesTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
  1268. if (this._companiesTableAdapter.Adapter.AcceptChangesDuringUpdate) {
  1269. this._companiesTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
  1270. adaptersWithAcceptChangesDuringUpdate.Add(this._companiesTableAdapter.Adapter);
  1271. }
  1272. }
  1273. //
  1274. //---- Perform updates -----------
  1275. //
  1276. if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
  1277. result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
  1278. result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
  1279. }
  1280. else {
  1281. result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
  1282. result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
  1283. }
  1284. result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
  1285. //
  1286. //---- Commit updates -----------
  1287. //
  1288. workTransaction.Commit();
  1289. if ((0 < allAddedRows.Count)) {
  1290. global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
  1291. allAddedRows.CopyTo(rows);
  1292. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1293. global::System.Data.DataRow row = rows[i];
  1294. row.AcceptChanges();
  1295. }
  1296. }
  1297. if ((0 < allChangedRows.Count)) {
  1298. global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
  1299. allChangedRows.CopyTo(rows);
  1300. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1301. global::System.Data.DataRow row = rows[i];
  1302. row.AcceptChanges();
  1303. }
  1304. }
  1305. }
  1306. catch (global::System.Exception ex) {
  1307. workTransaction.Rollback();
  1308. // ---- Restore the dataset -----------
  1309. if (this.BackupDataSetBeforeUpdate) {
  1310. global::System.Diagnostics.Debug.Assert((backupDataSet != null));
  1311. dataSet.Clear();
  1312. dataSet.Merge(backupDataSet);
  1313. }
  1314. else {
  1315. if ((0 < allAddedRows.Count)) {
  1316. global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
  1317. allAddedRows.CopyTo(rows);
  1318. for (int i = 0; (i < rows.Length); i = (i + 1)) {
  1319. global::System.Data.DataRow row = rows[i];
  1320. row.AcceptChanges();
  1321. row.SetAdded();
  1322. }
  1323. }
  1324. }
  1325. throw ex;
  1326. }
  1327. finally {
  1328. if (workConnOpened) {
  1329. workConnection.Close();
  1330. }
  1331. if ((this._companiesTableAdapter != null)) {
  1332. this._companiesTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._companiesTableAdapter]));
  1333. this._companiesTableAdapter.Transaction = null;
  1334. }
  1335. if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
  1336. global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
  1337. adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
  1338. for (int i = 0; (i < adapters.Length); i = (i + 1)) {
  1339. global::System.Data.Common.DataAdapter adapter = adapters[i];
  1340. adapter.AcceptChangesDuringUpdate = true;
  1341. }
  1342. }
  1343. }
  1344. return result;
  1345. }
  1346. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1347. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1348. protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
  1349. global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
  1350. }
  1351. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1352. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1353. protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
  1354. if ((this._connection != null)) {
  1355. return true;
  1356. }
  1357. if (((this.Connection == null)
  1358. || (inputConnection == null))) {
  1359. return true;
  1360. }
  1361. if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
  1362. return true;
  1363. }
  1364. return false;
  1365. }
  1366. /// <summary>
  1367. ///Update Order Option
  1368. ///</summary>
  1369. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1370. public enum UpdateOrderOption {
  1371. InsertUpdateDelete = 0,
  1372. UpdateInsertDelete = 1,
  1373. }
  1374. /// <summary>
  1375. ///Used to sort self-referenced table's rows
  1376. ///</summary>
  1377. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1378. private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
  1379. private global::System.Data.DataRelation _relation;
  1380. private int _childFirst;
  1381. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1382. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1383. internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
  1384. this._relation = relation;
  1385. if (childFirst) {
  1386. this._childFirst = -1;
  1387. }
  1388. else {
  1389. this._childFirst = 1;
  1390. }
  1391. }
  1392. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1393. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1394. private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
  1395. global::System.Diagnostics.Debug.Assert((row != null));
  1396. global::System.Data.DataRow root = row;
  1397. distance = 0;
  1398. 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>();
  1399. traversedRows[row] = row;
  1400. global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
  1401. for (
  1402. ; ((parent != null)
  1403. && (traversedRows.ContainsKey(parent) == false));
  1404. ) {
  1405. distance = (distance + 1);
  1406. root = parent;
  1407. traversedRows[parent] = parent;
  1408. parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
  1409. }
  1410. if ((distance == 0)) {
  1411. traversedRows.Clear();
  1412. traversedRows[row] = row;
  1413. parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
  1414. for (
  1415. ; ((parent != null)
  1416. && (traversedRows.ContainsKey(parent) == false));
  1417. ) {
  1418. distance = (distance + 1);
  1419. root = parent;
  1420. traversedRows[parent] = parent;
  1421. parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
  1422. }
  1423. }
  1424. return root;
  1425. }
  1426. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1427. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
  1428. public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
  1429. if (object.ReferenceEquals(row1, row2)) {
  1430. return 0;
  1431. }
  1432. if ((row1 == null)) {
  1433. return -1;
  1434. }
  1435. if ((row2 == null)) {
  1436. return 1;
  1437. }
  1438. int distance1 = 0;
  1439. global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
  1440. int distance2 = 0;
  1441. global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
  1442. if (object.ReferenceEquals(root1, root2)) {
  1443. return (this._childFirst * distance1.CompareTo(distance2));
  1444. }
  1445. else {
  1446. global::System.Diagnostics.Debug.Assert(((root1.Table != null)
  1447. && (root2.Table != null)));
  1448. if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
  1449. return -1;
  1450. }
  1451. else {
  1452. return 1;
  1453. }
  1454. }
  1455. }
  1456. }
  1457. }
  1458. }
  1459. #pragma warning restore 1591