Esempio n. 1
0
        private void InitDataSource()
        {
            m_SelectCommand = new SqlCommand();
            m_UpdateCommand = new SqlCommand();
            m_Connection = new SqlConnection();
            m_Adapter = new SqlDataAdapter();
            m_AccountsDataSet = new AccountsDataSet();
            ((System.ComponentModel.ISupportInitialize)(m_AccountsDataSet)).BeginInit();

            // m_SelectCommand
            m_SelectCommand.CommandText = "SELECT Number, Balance, Name FROM dbo.BankAccounts";
            m_SelectCommand.Connection = m_Connection;

            // m_UpdateCommand
            m_UpdateCommand.CommandText = @"UPDATE dbo.BankAccounts SET Number = @Number, Balance = @Balance, Name = @Name WHERE (Number = @Original_Number) AND (Balance = @Original_Balance OR @Original_Balance1 IS NULL AND Balance IS NULL) AND (Name = @Original_Name OR @Original_Name1 IS NULL AND Name IS NULL); SELECT Number, Balance, Name FROM dbo.BankAccounts WHERE (Number = @Select_Number)";
            m_UpdateCommand.Connection = m_Connection;
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Number", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Number", System.Data.DataRowVersion.Current, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Balance", System.Data.DataRowVersion.Current, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Name", System.Data.DataRowVersion.Current, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Original_Number", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Number", System.Data.DataRowVersion.Original, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Original_Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Balance", System.Data.DataRowVersion.Original, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Original_Balance1", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Balance", System.Data.DataRowVersion.Original, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Original_Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Name", System.Data.DataRowVersion.Original, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Original_Name1", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "Name", System.Data.DataRowVersion.Original, null));
            m_UpdateCommand.Parameters.Add(new SqlParameter("@Select_Number", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Number", System.Data.DataRowVersion.Current, null));

            // m_Connection
            m_Connection.ConnectionString = "data source=(local);initial catalog=Bank Account System;integrated security=SSPI;per" +
                "sist security info=True;workstation id=(local);packet size=4096";

            // m_Adapter
            m_Adapter.SelectCommand = m_SelectCommand;
            m_Adapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
                                                                                              new System.Data.Common.DataTableMapping("Table", "BankAccounts", new System.Data.Common.DataColumnMapping[] {
                                                                                                                                                                                                              new System.Data.Common.DataColumnMapping("Number", "Number"),
                                                                                                                                                                                                              new System.Data.Common.DataColumnMapping("Balance", "Balance"),
                                                                                                                                                                                                              new System.Data.Common.DataColumnMapping("Name", "Name")})});
            m_Adapter.UpdateCommand = m_UpdateCommand;

            // m_AccountsDataSet
            m_AccountsDataSet.DataSetName = "AccountsDataSet";
            m_AccountsDataSet.Locale = new System.Globalization.CultureInfo("en-US");
            m_AccountsDataSet.Namespace = "http://www.tempuri.org/AccountsDataSet.xsd";
        }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     AccountsDataSet ds = new AccountsDataSet();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "accountsViewDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     AccountsDataSet ds = new AccountsDataSet();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 public virtual int Fill(AccountsDataSet.accountsViewDataTable dataTable) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public virtual int Update(AccountsDataSet dataSet) {
     return this.Adapter.Update(dataSet, "accounts");
 }
 public virtual int Update(AccountsDataSet.accountsDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Readers));
     this.label1 = new System.Windows.Forms.Label();
     this.label2 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.label5 = new System.Windows.Forms.Label();
     this.textBox1 = new System.Windows.Forms.TextBox();
     this.textBox3 = new System.Windows.Forms.TextBox();
     this.textBox4 = new System.Windows.Forms.TextBox();
     this.textBox5 = new System.Windows.Forms.TextBox();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.radioButton2 = new System.Windows.Forms.RadioButton();
     this.radioButton1 = new System.Windows.Forms.RadioButton();
     this.button5 = new System.Windows.Forms.Button();
     this.button1 = new System.Windows.Forms.Button();
     this.button2 = new System.Windows.Forms.Button();
     this.button3 = new System.Windows.Forms.Button();
     this.button4 = new System.Windows.Forms.Button();
     this.panel1 = new System.Windows.Forms.Panel();
     this.textBox6 = new System.Windows.Forms.TextBox();
     this.label6 = new System.Windows.Forms.Label();
     this.dataGridView2 = new System.Windows.Forms.DataGridView();
     this.fullnameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.usernameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.email = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.accountsBindingSource = new System.Windows.Forms.BindingSource(this.components);
     this.accountsDataSet = new LibraryApp.AccountsDataSet();
     this.dataGridView1 = new System.Windows.Forms.DataGridView();
     this.code = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.fullnameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.emailDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.cityDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.addressDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.phoneDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.textBox2 = new System.Windows.Forms.TextBox();
     this.label7 = new System.Windows.Forms.Label();
     this.accountsTableAdapter = new LibraryApp.AccountsDataSetTableAdapters.AccountsTableAdapter();
     this.panel3 = new System.Windows.Forms.Panel();
     this.groupBox1.SuspendLayout();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.accountsBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.accountsDataSet)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Font = new System.Drawing.Font("Lucida Handwriting", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.White;
     this.label1.Location = new System.Drawing.Point(45, 29);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(323, 31);
     this.label1.TabIndex = 14;
     this.label1.Text = "Add Info to a Reader";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.ForeColor = System.Drawing.Color.White;
     this.label2.Location = new System.Drawing.Point(14, 141);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(118, 21);
     this.label2.TabIndex = 16;
     this.label2.Text = "FULLNAME:";
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label3.ForeColor = System.Drawing.Color.White;
     this.label3.Location = new System.Drawing.Point(72, 262);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(60, 21);
     this.label3.TabIndex = 17;
     this.label3.Text = "CITY:";
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label4.ForeColor = System.Drawing.Color.White;
     this.label4.Location = new System.Drawing.Point(30, 316);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(104, 21);
     this.label4.TabIndex = 18;
     this.label4.Text = "ADDRESS:";
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label5.ForeColor = System.Drawing.Color.White;
     this.label5.Location = new System.Drawing.Point(49, 367);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(83, 21);
     this.label5.TabIndex = 19;
     this.label5.Text = "PHONE:";
     //
     // textBox1
     //
     this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox1.Location = new System.Drawing.Point(138, 141);
     this.textBox1.Name = "textBox1";
     this.textBox1.Size = new System.Drawing.Size(232, 26);
     this.textBox1.TabIndex = 22;
     //
     // textBox3
     //
     this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox3.Location = new System.Drawing.Point(138, 259);
     this.textBox3.Name = "textBox3";
     this.textBox3.Size = new System.Drawing.Size(230, 26);
     this.textBox3.TabIndex = 23;
     //
     // textBox4
     //
     this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox4.Location = new System.Drawing.Point(140, 313);
     this.textBox4.Name = "textBox4";
     this.textBox4.Size = new System.Drawing.Size(232, 26);
     this.textBox4.TabIndex = 24;
     //
     // textBox5
     //
     this.textBox5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox5.Location = new System.Drawing.Point(138, 367);
     this.textBox5.Name = "textBox5";
     this.textBox5.Size = new System.Drawing.Size(234, 26);
     this.textBox5.TabIndex = 25;
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.radioButton2);
     this.groupBox1.Controls.Add(this.radioButton1);
     this.groupBox1.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.ForeColor = System.Drawing.Color.White;
     this.groupBox1.Location = new System.Drawing.Point(118, 416);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(254, 79);
     this.groupBox1.TabIndex = 27;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "SEX";
     //
     // radioButton2
     //
     this.radioButton2.AutoSize = true;
     this.radioButton2.Location = new System.Drawing.Point(120, 29);
     this.radioButton2.Name = "radioButton2";
     this.radioButton2.Size = new System.Drawing.Size(101, 25);
     this.radioButton2.TabIndex = 1;
     this.radioButton2.TabStop = true;
     this.radioButton2.Text = "FEMALE";
     this.radioButton2.UseVisualStyleBackColor = true;
     //
     // radioButton1
     //
     this.radioButton1.AutoSize = true;
     this.radioButton1.Location = new System.Drawing.Point(23, 30);
     this.radioButton1.Name = "radioButton1";
     this.radioButton1.Size = new System.Drawing.Size(79, 25);
     this.radioButton1.TabIndex = 0;
     this.radioButton1.TabStop = true;
     this.radioButton1.Text = "MALE";
     this.radioButton1.UseVisualStyleBackColor = true;
     //
     // button5
     //
     this.button5.AccessibleDescription = "";
     this.button5.BackColor = System.Drawing.SystemColors.ControlLight;
     this.button5.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button5.ForeColor = System.Drawing.Color.Black;
     this.button5.Location = new System.Drawing.Point(885, 545);
     this.button5.Name = "button5";
     this.button5.Size = new System.Drawing.Size(254, 33);
     this.button5.TabIndex = 30;
     this.button5.Text = "Back to Main";
     this.button5.UseVisualStyleBackColor = false;
     this.button5.Click += new System.EventHandler(this.backToMainButton_Click);
     //
     // button1
     //
     this.button1.AccessibleDescription = "";
     this.button1.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button1.Location = new System.Drawing.Point(22, 522);
     this.button1.Name = "button1";
     this.button1.Size = new System.Drawing.Size(96, 33);
     this.button1.TabIndex = 31;
     this.button1.Text = "Insert";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.button_InsertClick);
     //
     // button2
     //
     this.button2.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button2.Location = new System.Drawing.Point(149, 522);
     this.button2.Name = "button2";
     this.button2.Size = new System.Drawing.Size(98, 33);
     this.button2.TabIndex = 32;
     this.button2.Text = "Update";
     this.button2.UseVisualStyleBackColor = true;
     this.button2.Click += new System.EventHandler(this.button_UpdateClick);
     //
     // button3
     //
     this.button3.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button3.Location = new System.Drawing.Point(279, 521);
     this.button3.Name = "button3";
     this.button3.Size = new System.Drawing.Size(95, 35);
     this.button3.TabIndex = 33;
     this.button3.Text = "Delete";
     this.button3.UseVisualStyleBackColor = true;
     this.button3.Click += new System.EventHandler(this.button_DeleteClick);
     //
     // button4
     //
     this.button4.AccessibleDescription = "";
     this.button4.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button4.Location = new System.Drawing.Point(22, 574);
     this.button4.Name = "button4";
     this.button4.Size = new System.Drawing.Size(352, 33);
     this.button4.TabIndex = 34;
     this.button4.Text = "Save to .txt";
     this.button4.UseVisualStyleBackColor = true;
     this.button4.Click += new System.EventHandler(this.button_SaveToTxtClick);
     //
     // panel1
     //
     this.panel1.BackColor = System.Drawing.Color.Transparent;
     this.panel1.Controls.Add(this.panel3);
     this.panel1.Controls.Add(this.textBox6);
     this.panel1.Controls.Add(this.label6);
     this.panel1.Controls.Add(this.dataGridView2);
     this.panel1.Controls.Add(this.dataGridView1);
     this.panel1.Controls.Add(this.button4);
     this.panel1.Controls.Add(this.button3);
     this.panel1.Controls.Add(this.button2);
     this.panel1.Controls.Add(this.button1);
     this.panel1.Controls.Add(this.button5);
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Controls.Add(this.textBox5);
     this.panel1.Controls.Add(this.textBox4);
     this.panel1.Controls.Add(this.textBox3);
     this.panel1.Controls.Add(this.textBox1);
     this.panel1.Controls.Add(this.textBox2);
     this.panel1.Controls.Add(this.label5);
     this.panel1.Controls.Add(this.label4);
     this.panel1.Controls.Add(this.label3);
     this.panel1.Controls.Add(this.label2);
     this.panel1.Controls.Add(this.label7);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Location = new System.Drawing.Point(60, 39);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(1164, 636);
     this.panel1.TabIndex = 0;
     //
     // textBox6
     //
     this.textBox6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox6.Location = new System.Drawing.Point(138, 91);
     this.textBox6.Name = "textBox6";
     this.textBox6.Size = new System.Drawing.Size(232, 26);
     this.textBox6.TabIndex = 38;
     //
     // label6
     //
     this.label6.AutoSize = true;
     this.label6.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label6.ForeColor = System.Drawing.Color.White;
     this.label6.Location = new System.Drawing.Point(61, 94);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(69, 21);
     this.label6.TabIndex = 37;
     this.label6.Text = "CODE:";
     //
     // dataGridView2
     //
     this.dataGridView2.AutoGenerateColumns = false;
     this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.ControlLight;
     this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     this.fullnameDataGridViewTextBoxColumn1,
     this.usernameDataGridViewTextBoxColumn,
     this.email});
     this.dataGridView2.DataSource = this.accountsBindingSource;
     this.dataGridView2.Location = new System.Drawing.Point(793, 329);
     this.dataGridView2.Name = "dataGridView2";
     this.dataGridView2.Size = new System.Drawing.Size(346, 163);
     this.dataGridView2.TabIndex = 36;
     this.dataGridView2.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView2_RowHeaderMouseClick);
     //
     // fullnameDataGridViewTextBoxColumn1
     //
     this.fullnameDataGridViewTextBoxColumn1.DataPropertyName = "fullname";
     this.fullnameDataGridViewTextBoxColumn1.HeaderText = "Fullname";
     this.fullnameDataGridViewTextBoxColumn1.Name = "fullnameDataGridViewTextBoxColumn1";
     //
     // usernameDataGridViewTextBoxColumn
     //
     this.usernameDataGridViewTextBoxColumn.DataPropertyName = "username";
     this.usernameDataGridViewTextBoxColumn.HeaderText = "Username";
     this.usernameDataGridViewTextBoxColumn.Name = "usernameDataGridViewTextBoxColumn";
     //
     // email
     //
     this.email.DataPropertyName = "email";
     this.email.HeaderText = "email";
     this.email.Name = "email";
     //
     // accountsBindingSource
     //
     this.accountsBindingSource.DataMember = "Accounts";
     this.accountsBindingSource.DataSource = this.accountsDataSet;
     //
     // accountsDataSet
     //
     this.accountsDataSet.DataSetName = "AccountsDataSet";
     this.accountsDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // dataGridView1
     //
     this.dataGridView1.AutoGenerateColumns = false;
     this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLight;
     this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     this.code,
     this.fullnameDataGridViewTextBoxColumn,
     this.emailDataGridViewTextBoxColumn,
     this.cityDataGridViewTextBoxColumn,
     this.addressDataGridViewTextBoxColumn,
     this.phoneDataGridViewTextBoxColumn});
     this.dataGridView1.DataSource = this.accountsBindingSource;
     this.dataGridView1.Location = new System.Drawing.Point(499, 29);
     this.dataGridView1.Name = "dataGridView1";
     this.dataGridView1.Size = new System.Drawing.Size(640, 242);
     this.dataGridView1.TabIndex = 35;
     this.dataGridView1.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_RowHeaderMouseClick);
     //
     // code
     //
     this.code.DataPropertyName = "code";
     this.code.HeaderText = "code";
     this.code.Name = "code";
     this.code.ReadOnly = true;
     this.code.Width = 75;
     //
     // fullnameDataGridViewTextBoxColumn
     //
     this.fullnameDataGridViewTextBoxColumn.DataPropertyName = "fullname";
     this.fullnameDataGridViewTextBoxColumn.HeaderText = "Fullname";
     this.fullnameDataGridViewTextBoxColumn.Name = "fullnameDataGridViewTextBoxColumn";
     this.fullnameDataGridViewTextBoxColumn.Width = 110;
     //
     // emailDataGridViewTextBoxColumn
     //
     this.emailDataGridViewTextBoxColumn.DataPropertyName = "email";
     this.emailDataGridViewTextBoxColumn.HeaderText = "Email";
     this.emailDataGridViewTextBoxColumn.Name = "emailDataGridViewTextBoxColumn";
     this.emailDataGridViewTextBoxColumn.Width = 110;
     //
     // cityDataGridViewTextBoxColumn
     //
     this.cityDataGridViewTextBoxColumn.DataPropertyName = "city";
     this.cityDataGridViewTextBoxColumn.HeaderText = "City";
     this.cityDataGridViewTextBoxColumn.Name = "cityDataGridViewTextBoxColumn";
     this.cityDataGridViewTextBoxColumn.Width = 80;
     //
     // addressDataGridViewTextBoxColumn
     //
     this.addressDataGridViewTextBoxColumn.DataPropertyName = "address";
     this.addressDataGridViewTextBoxColumn.HeaderText = "Address";
     this.addressDataGridViewTextBoxColumn.Name = "addressDataGridViewTextBoxColumn";
     this.addressDataGridViewTextBoxColumn.Width = 140;
     //
     // phoneDataGridViewTextBoxColumn
     //
     this.phoneDataGridViewTextBoxColumn.DataPropertyName = "phone";
     this.phoneDataGridViewTextBoxColumn.HeaderText = "Phone";
     this.phoneDataGridViewTextBoxColumn.Name = "phoneDataGridViewTextBoxColumn";
     this.phoneDataGridViewTextBoxColumn.Width = 80;
     //
     // textBox2
     //
     this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.textBox2.Location = new System.Drawing.Point(138, 191);
     this.textBox2.Name = "textBox2";
     this.textBox2.Size = new System.Drawing.Size(232, 26);
     this.textBox2.TabIndex = 21;
     //
     // label7
     //
     this.label7.AutoSize = true;
     this.label7.Font = new System.Drawing.Font("Lucida Handwriting", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label7.ForeColor = System.Drawing.Color.White;
     this.label7.Location = new System.Drawing.Point(53, 196);
     this.label7.Name = "label7";
     this.label7.Size = new System.Drawing.Size(77, 21);
     this.label7.TabIndex = 15;
     this.label7.Text = "EMAIL:";
     //
     // accountsTableAdapter
     //
     this.accountsTableAdapter.ClearBeforeFill = true;
     //
     // panel3
     //
     this.panel3.BackColor = System.Drawing.SystemColors.ControlLightLight;
     this.panel3.Location = new System.Drawing.Point(3, 233);
     this.panel3.Name = "panel3";
     this.panel3.Size = new System.Drawing.Size(443, 10);
     this.panel3.TabIndex = 49;
     //
     // Form_Readers
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.ClientSize = new System.Drawing.Size(1256, 716);
     this.Controls.Add(this.panel1);
     this.DoubleBuffered = true;
     this.Name = "Form_Readers";
     this.ShowIcon = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Readers";
     this.Load += new System.EventHandler(this.Readers_Form_Load);
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.accountsBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.accountsDataSet)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
     this.ResumeLayout(false);
 }
Esempio n. 8
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent()
        {
            this.m_AmountBox = new System.Windows.Forms.TextBox();
            this.m_DestLabel = new System.Windows.Forms.Label();
            this.m_TransferButton = new System.Windows.Forms.Button();
            this.m_Connection = new System.Data.SqlClient.SqlConnection();
            this.m_SelectCommand = new System.Data.SqlClient.SqlCommand();
            this.m_DestBox = new System.Windows.Forms.TextBox();
            this.m_SourceLabel = new System.Windows.Forms.Label();
            this.m_AccountsDataSet = new AccountsDataSet();
            this.m_InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.m_DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.m_AmountLabel = new System.Windows.Forms.Label();
            this.m_AccountsGrid = new System.Windows.Forms.DataGrid();
            this.m_UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.m_Adapter = new System.Data.SqlClient.SqlDataAdapter();
            this.m_SourceBox = new System.Windows.Forms.TextBox();
            this.m_PictureBox = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.m_AccountsDataSet)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_AccountsGrid)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_PictureBox)).BeginInit();
            this.SuspendLayout();
            //
            // m_AmountBox
            //
            this.m_AmountBox.Location = new System.Drawing.Point(272, 40);
            this.m_AmountBox.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
            this.m_AmountBox.Name = "m_AmountBox";
            this.m_AmountBox.Size = new System.Drawing.Size(80, 20);
            this.m_AmountBox.TabIndex = 2;
            this.m_AmountBox.Text = "100";
            //
            // m_DestLabel
            //
            this.m_DestLabel.Location = new System.Drawing.Point(144, 16);
            this.m_DestLabel.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
            this.m_DestLabel.Name = "m_DestLabel";
            this.m_DestLabel.Size = new System.Drawing.Size(104, 23);
            this.m_DestLabel.TabIndex = 3;
            this.m_DestLabel.Text = "Destination Acount:";
            //
            // m_TransferButton
            //
            this.m_TransferButton.Location = new System.Drawing.Point(392, 40);
            this.m_TransferButton.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
            this.m_TransferButton.Name = "m_TransferButton";
            this.m_TransferButton.TabIndex = 1;
            this.m_TransferButton.Text = "Transfer";
            this.m_TransferButton.Click += new System.EventHandler(this.OnTransfer);
            //
            // m_Connection
            //
            this.m_Connection.ConnectionString = "data source=localhost;initial catalog=Bank Account System;integrated security=SSP" +
                "I;persist security info=False;workstation id=localhost;packet size=4096";
            this.m_Connection.FireInfoMessageEventOnUserErrors = false;
            //
            // m_SelectCommand
            //
            this.m_SelectCommand.CommandText = "SELECT Number, Balance, Name FROM dbo.BankAccounts";
            this.m_SelectCommand.Connection = this.m_Connection;
            //
            // m_DestBox
            //
            this.m_DestBox.Location = new System.Drawing.Point(144, 40);
            this.m_DestBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 3);
            this.m_DestBox.Name = "m_DestBox";
            this.m_DestBox.TabIndex = 2;
            this.m_DestBox.Text = "456";
            //
            // m_SourceLabel
            //
            this.m_SourceLabel.Location = new System.Drawing.Point(8, 16);
            this.m_SourceLabel.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
            this.m_SourceLabel.Name = "m_SourceLabel";
            this.m_SourceLabel.TabIndex = 3;
            this.m_SourceLabel.Text = "Source Acount:";
            //
            // m_AccountsDataSet
            //
            this.m_AccountsDataSet.DataSetName = "AccountsDataSet";
            this.m_AccountsDataSet.Locale = new System.Globalization.CultureInfo("en-US");
            this.m_AccountsDataSet.RemotingFormat = System.Data.SerializationFormat.Xml;
            //
            // m_InsertCommand
            //
            this.m_InsertCommand.CommandText = "INSERT INTO dbo.BankAccounts(Number, Balance, Name) VALUES (@Number, @Balance, @N" +
                "ame); SELECT Number, Balance, Name FROM dbo.BankAccounts WHERE (Number = @Select" +
                "_Number)";
            this.m_InsertCommand.Connection = this.m_Connection;
            this.m_InsertCommand.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
            new System.Data.SqlClient.SqlParameter("@Number", System.Data.SqlDbType.Int, 4, "Number"),
            new System.Data.SqlClient.SqlParameter("@Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Current, null),
            new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Current, null),
            new System.Data.SqlClient.SqlParameter("@Select_Number", System.Data.SqlDbType.Int, 4, "Number")});
            //
            // m_DeleteCommand
            //
            this.m_DeleteCommand.CommandText = "DELETE FROM dbo.BankAccounts WHERE (Number = @Number) AND (Balance = @Balance OR " +
                "@Balance1 IS NULL AND Balance IS NULL) AND (Name = @Name OR @Name1 IS NULL AND N" +
                "ame IS NULL)";
            this.m_DeleteCommand.Connection = this.m_Connection;
            this.m_DeleteCommand.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
            new System.Data.SqlClient.SqlParameter("@Number", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Number", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Balance1", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Name1", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Original, null)});
            //
            // m_AmountLabel
            //
            this.m_AmountLabel.Location = new System.Drawing.Point(272, 16);
            this.m_AmountLabel.Margin = new System.Windows.Forms.Padding(3, 3, 3, 1);
            this.m_AmountLabel.Name = "m_AmountLabel";
            this.m_AmountLabel.Size = new System.Drawing.Size(192, 23);
            this.m_AmountLabel.TabIndex = 3;
            this.m_AmountLabel.Text = "Amount:";
            //
            // m_AccountsGrid
            //
            this.m_AccountsGrid.DataMember = "";
            this.m_AccountsGrid.DataSource = this.m_AccountsDataSet.BankAccounts;
            this.m_AccountsGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.m_AccountsGrid.Location = new System.Drawing.Point(8, 104);
            this.m_AccountsGrid.Name = "m_AccountsGrid";
            this.m_AccountsGrid.Size = new System.Drawing.Size(264, 216);
            this.m_AccountsGrid.TabIndex = 4;
            //
            // m_UpdateCommand
            //
            this.m_UpdateCommand.CommandText = @"UPDATE dbo.BankAccounts SET Number = @Number, Balance = @Balance, Name = @Name WHERE (Number = @Original_Number) AND (Balance = @Original_Balance OR @Original_Balance1 IS NULL AND Balance IS NULL) AND (Name = @Original_Name OR @Original_Name1 IS NULL AND Name IS NULL); SELECT Number, Balance, Name FROM dbo.BankAccounts WHERE (Number = @Select_Number)";
            this.m_UpdateCommand.Connection = this.m_Connection;
            this.m_UpdateCommand.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
            new System.Data.SqlClient.SqlParameter("@Number", System.Data.SqlDbType.Int, 4, "Number"),
            new System.Data.SqlClient.SqlParameter("@Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Current, null),
            new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Current, null),
            new System.Data.SqlClient.SqlParameter("@Original_Number", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Number", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Original_Balance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Original_Balance1", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Balance", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Original_Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Original_Name1", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, true, ((byte)(0)), ((byte)(0)), "Name", System.Data.DataRowVersion.Original, null),
            new System.Data.SqlClient.SqlParameter("@Select_Number", System.Data.SqlDbType.Int, 4, "Number")});
            //
            // m_Adapter
            //
            this.m_Adapter.DeleteCommand = this.m_DeleteCommand;
            this.m_Adapter.InsertCommand = this.m_InsertCommand;
            this.m_Adapter.SelectCommand = this.m_SelectCommand;
            this.m_Adapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
            new System.Data.Common.DataTableMapping("Table", "BankAccounts", new System.Data.Common.DataColumnMapping[] {
                        new System.Data.Common.DataColumnMapping("Number", "Number"),
                        new System.Data.Common.DataColumnMapping("Balance", "Balance"),
                        new System.Data.Common.DataColumnMapping("Name", "Name")})});
            this.m_Adapter.UpdateCommand = this.m_UpdateCommand;
            //
            // m_SourceBox
            //
            this.m_SourceBox.Location = new System.Drawing.Point(8, 40);
            this.m_SourceBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 3);
            this.m_SourceBox.Name = "m_SourceBox";
            this.m_SourceBox.TabIndex = 2;
            this.m_SourceBox.Text = "123";
            //
            // m_PictureBox
            //
            this.m_PictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.m_PictureBox.Location = new System.Drawing.Point(319, 104);
            this.m_PictureBox.Name = "m_PictureBox";
            this.m_PictureBox.Size = new System.Drawing.Size(145, 131);
            this.m_PictureBox.TabIndex = 5;
            this.m_PictureBox.TabStop = false;
            m_PictureBox.Image = new Bitmap(typeof(BankClient), "Money.bmp");

            //
            // BankClient
            //

            this.ClientSize = new System.Drawing.Size(504, 333);
            this.Controls.Add(this.m_PictureBox);
            this.Controls.Add(this.m_AccountsGrid);
            this.Controls.Add(this.m_SourceLabel);
            this.Controls.Add(this.m_SourceBox);
            this.Controls.Add(this.m_TransferButton);
            this.Controls.Add(this.m_DestLabel);
            this.Controls.Add(this.m_DestBox);
            this.Controls.Add(this.m_AmountBox);
            this.Controls.Add(this.m_AmountLabel);
            this.Name = "BankClient";
            this.Text = "Bank Client";
            ((System.ComponentModel.ISupportInitialize)(this.m_AccountsDataSet)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_AccountsGrid)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_PictureBox)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }