AuthorizationKomadinDataSet.Designer.cs 80 KB

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