commit 5c3c70c121f55fde0fdc3415df7cfe08cc9242a1 Author: Arshia Esmailzadeh Date: Thu Jun 18 18:34:05 2026 +0330 Final files diff --git a/MyShop.sln b/MyShop.sln new file mode 100644 index 0000000..7d58f79 --- /dev/null +++ b/MyShop.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyShop", "MyShop\MyShop.csproj", "{0A9689AD-3745-42B7-8187-97A99CF65480}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0A9689AD-3745-42B7-8187-97A99CF65480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A9689AD-3745-42B7-8187-97A99CF65480}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A9689AD-3745-42B7-8187-97A99CF65480}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A9689AD-3745-42B7-8187-97A99CF65480}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MyShop.v12.suo b/MyShop.v12.suo new file mode 100644 index 0000000..17349d8 Binary files /dev/null and b/MyShop.v12.suo differ diff --git a/MyShop/AGENTS.md b/MyShop/AGENTS.md new file mode 100644 index 0000000..ed2c1cc --- /dev/null +++ b/MyShop/AGENTS.md @@ -0,0 +1,102 @@ +# AGENTS.md + +## هدف پروژه +این پروژه یک برنامه **Windows Forms** با **.NET Framework 4.5** و ساختار کلاسیک (non-SDK) است. +فایل پروژه: `MyShop.csproj` +فرم اصلی فعلی: `Form1` +پایگاه داده هدف: **Microsoft Access** + +--- + +## قوانین کلی برای Agent (Codex) + +1. **سازگاری نسخه‌ای (خیلی مهم)** + - تمام کدها باید با `.NET Framework 4.5` سازگار باشند. + - از سینتکس‌ها و قابلیت‌های جدید C# که ممکن است در ابزارهای قدیمی مشکل ایجاد کنند استفاده نشود. + - فرض بر سازگاری با محیط قدیمی Visual Studio / MSBuild باشد. + +2. **زبان کامنت‌ها** + - تمام کامنت‌های کد باید **فارسی** باشند. + - متن‌های توضیحی داخل کد (در صورت نیاز) فارسی نوشته شوند. + +3. **ساخت و اجرا** + - ساخت و اجرا از طریق **Visual Studio** انجام می‌شود. + - تغییراتی که نیازمند ابزار خارج از روال عادی Visual Studio هستند اعمال نشود مگر با درخواست صریح. + +4. **قانون تغییرات** + - تغییرات باید **حداقلی، دقیق و قابل‌ردیابی** باشند. + - از بازنویسی گسترده‌ی فایل‌ها بدون نیاز خودداری شود. + - قبل از اعمال تغییرات پرریسک، توضیح کوتاه از اثر تغییر ارائه شود. + +--- + +## قوانین مربوط به WinForms و Designer + +1. فایل‌های زیر جزو ساختار اصلی WinForms هستند: + - `Form1.cs` + - `Form1.Designer.cs` + - `Program.cs` + - `Properties/*` + +2. **ویرایش `*.Designer.cs` مجاز است**، اما با دقت: + - فقط تغییرات لازم برای پیاده‌سازی UI خواسته‌شده انجام شود. + - نام کنترل‌ها معنی‌دار و پایدار انتخاب شوند. + - از حذف/تغییر ناخواسته تنظیمات فرم و کنترل‌ها جلوگیری شود. + +3. اگر UI بر اساس تصویر/طرح خواسته شد: + - ابتدا لیست کنترل‌های لازم، نام‌ها و نوع‌ها مشخص شود. + - سپس `InitializeComponent` به‌صورت منظم و قابل‌فهم تولید/ویرایش شود. + - در صورت ابهام در فاصله‌ها/ابعاد، از مقادیر منطقی و قابل اصلاح استفاده شود. + +--- + +## قوانین پایگاه داده (Microsoft Access) + +1. اتصال دیتابیس با `OleDb` انجام شود (سازگار با .NET Framework 4.5). +2. از **Query پارامتری** استفاده شود (جلوگیری از خطا و Injection). +3. Connection string در `App.config` نگهداری شود (نه هاردکد داخل فرم). +4. عملیات دیتابیس: + - `using` برای `OleDbConnection`, `OleDbCommand`, `OleDbDataAdapter` رعایت شود. + - مدیریت خطا با `try/catch` انجام شود و پیام مناسب به کاربر نمایش داده شود. +5. نام جدول/فیلدها در صورت استفاده از کلمات رزرو‌شده Access، با براکت `[]` مدیریت شوند. + +--- + +## سبک کدنویسی + +1. نام‌گذاری: + - کلاس‌ها و متدها: واضح و معنی‌دار. + - کنترل‌ها: پیشوند مناسب (مثل `txtName`, `btnSave`, `dgvProducts`). +2. متدها کوتاه و مسئولیت‌محور باشند. +3. منطق دیتابیس تا حد ممکن از کد مستقیم UI جدا شود (در حد سبک پروژه). +4. از افزودن وابستگی/NuGet جدید بدون درخواست صریح خودداری شود. +5. از تغییر خودکار فایل‌های `Properties/*.Designer.cs` مگر در صورت نیاز مشخص خودداری شود. + +--- + +## موارد خارج از محدوده (مگر با درخواست کاربر) + +- افزودن فریم‌ورک‌های جدید (WPF, ASP.NET, EF جدید و ...) +- مهاجرت پروژه به نسخه‌های جدید .NET +- افزودن زیرساخت تست خودکار +- تغییرات معماری سنگین + +--- + +## چک‌لیست قبل از تحویل تغییر + +- [ ] کد با .NET Framework 4.5 سازگار است. +- [ ] کامنت‌ها فارسی هستند. +- [ ] تغییرات حداقلی و مرتبط با درخواست هستند. +- [ ] در صورت استفاده از Access، کوئری‌ها پارامتری هستند. +- [ ] فایل‌های Designer بدون آسیب به ساختار فرم ویرایش شده‌اند. +- [ ] برنامه در Visual Studio قابل Build/Run است. + +--- + +## قالب پاسخ‌دهی Agent برای هر تسک + +1. خلاصه کوتاه از کار انجام‌شده +2. لیست فایل‌های تغییرکرده +3. نکات مهم/ریسک‌ها +4. اگر ابهام وجود داشت: سوال شفاف قبل از اعمال تغییر نهایی diff --git a/MyShop/App.config b/MyShop/App.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/App.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/Log.txt b/MyShop/Log.txt new file mode 100644 index 0000000..f19b5e8 --- /dev/null +++ b/MyShop/Log.txt @@ -0,0 +1,2 @@ +ورود ناموفق: 2026/06/09 13:47:15 - نام کاربری وارد شده: admin +ورود مدیر: 2026/06/09 13:47:56 diff --git a/MyShop/LoginForm.Designer.cs b/MyShop/LoginForm.Designer.cs new file mode 100644 index 0000000..a35ed8e --- /dev/null +++ b/MyShop/LoginForm.Designer.cs @@ -0,0 +1,226 @@ +namespace MyShop +{ + partial class LoginForm + { + /// + /// متغیرهای مورد نیاز Designer + /// + private System.ComponentModel.IContainer components = null; + + /// + /// آزادسازی منابع استفاده شده + /// + /// اگر true باشد منابع مدیریت‌شده آزاد می‌شوند. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region کد تولید شده توسط Windows Form Designer + + /// + /// متد مورد نیاز Designer + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.pnlHeader = new System.Windows.Forms.Panel(); + this.lblTitle = new System.Windows.Forms.Label(); + this.pnlContent = new System.Windows.Forms.Panel(); + this.chkRememberUserName = new System.Windows.Forms.CheckBox(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.txtUserName = new System.Windows.Forms.TextBox(); + this.lblPassword = new System.Windows.Forms.Label(); + this.lblUserName = new System.Windows.Forms.Label(); + this.picUser = new System.Windows.Forms.PictureBox(); + this.btnExit = new System.Windows.Forms.Button(); + this.btnLogin = new System.Windows.Forms.Button(); + this.myShopDataSet = new MyShop.MyShopDataSet(); + this.usersBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.usersTableAdapter = new MyShop.MyShopDataSetTableAdapters.UsersTableAdapter(); + this.pnlHeader.SuspendLayout(); + this.pnlContent.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picUser)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.myShopDataSet)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.usersBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // pnlHeader + // + this.pnlHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(42)))), ((int)(((byte)(36)))), ((int)(((byte)(96))))); + this.pnlHeader.Controls.Add(this.lblTitle); + this.pnlHeader.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlHeader.Location = new System.Drawing.Point(0, 0); + this.pnlHeader.Name = "pnlHeader"; + this.pnlHeader.Size = new System.Drawing.Size(420, 42); + this.pnlHeader.TabIndex = 0; + // + // lblTitle + // + this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblTitle.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold); + this.lblTitle.ForeColor = System.Drawing.Color.White; + this.lblTitle.Location = new System.Drawing.Point(0, 0); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(420, 42); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "ورود به برنامه فروشگاه"; + this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // pnlContent + // + this.pnlContent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(177)))), ((int)(((byte)(231)))), ((int)(((byte)(240))))); + this.pnlContent.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.pnlContent.Controls.Add(this.chkRememberUserName); + this.pnlContent.Controls.Add(this.txtPassword); + this.pnlContent.Controls.Add(this.txtUserName); + this.pnlContent.Controls.Add(this.lblPassword); + this.pnlContent.Controls.Add(this.lblUserName); + this.pnlContent.Controls.Add(this.picUser); + this.pnlContent.Location = new System.Drawing.Point(14, 54); + this.pnlContent.Name = "pnlContent"; + this.pnlContent.Size = new System.Drawing.Size(392, 150); + this.pnlContent.TabIndex = 1; + // + // chkRememberUserName + // + this.chkRememberUserName.AutoSize = true; + this.chkRememberUserName.Location = new System.Drawing.Point(176, 112); + this.chkRememberUserName.Name = "chkRememberUserName"; + this.chkRememberUserName.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.chkRememberUserName.Size = new System.Drawing.Size(126, 21); + this.chkRememberUserName.TabIndex = 5; + this.chkRememberUserName.Text = "ذخیره نام کاربری"; + this.chkRememberUserName.UseVisualStyleBackColor = true; + // + // txtPassword + // + this.txtPassword.Location = new System.Drawing.Point(118, 78); + this.txtPassword.Name = "txtPassword"; + this.txtPassword.PasswordChar = '*'; + this.txtPassword.Size = new System.Drawing.Size(200, 24); + this.txtPassword.TabIndex = 4; + // + // txtUserName + // + this.txtUserName.Location = new System.Drawing.Point(118, 31); + this.txtUserName.Name = "txtUserName"; + this.txtUserName.Size = new System.Drawing.Size(200, 24); + this.txtUserName.TabIndex = 3; + // + // lblPassword + // + this.lblPassword.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblPassword.Location = new System.Drawing.Point(315, 80); + this.lblPassword.Name = "lblPassword"; + this.lblPassword.Size = new System.Drawing.Size(68, 18); + this.lblPassword.TabIndex = 2; + this.lblPassword.Text = "گذرواژه:"; + this.lblPassword.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblUserName + // + this.lblUserName.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblUserName.Location = new System.Drawing.Point(315, 33); + this.lblUserName.Name = "lblUserName"; + this.lblUserName.Size = new System.Drawing.Size(68, 18); + this.lblUserName.TabIndex = 1; + this.lblUserName.Text = "نام کاربری:"; + this.lblUserName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // picUser + // + this.picUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(238)))), ((int)(((byte)(244))))); + this.picUser.Image = global::MyShop.Properties.Resources.LoginIcon; + this.picUser.Location = new System.Drawing.Point(17, 12); + this.picUser.Name = "picUser"; + this.picUser.Size = new System.Drawing.Size(92, 121); + this.picUser.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picUser.TabIndex = 0; + this.picUser.TabStop = false; + // + // btnExit + // + this.btnExit.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnExit.Location = new System.Drawing.Point(14, 214); + this.btnExit.Name = "btnExit"; + this.btnExit.Size = new System.Drawing.Size(142, 30); + this.btnExit.TabIndex = 2; + this.btnExit.Text = "خروج"; + this.btnExit.UseVisualStyleBackColor = true; + this.btnExit.Click += new System.EventHandler(this.btnExit_Click); + // + // btnLogin + // + this.btnLogin.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnLogin.Location = new System.Drawing.Point(264, 214); + this.btnLogin.Name = "btnLogin"; + this.btnLogin.Size = new System.Drawing.Size(142, 30); + this.btnLogin.TabIndex = 3; + this.btnLogin.Text = "ورود"; + this.btnLogin.UseVisualStyleBackColor = true; + this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click); + // + // myShopDataSet + // + this.myShopDataSet.DataSetName = "MyShopDataSet"; + this.myShopDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + // + // usersBindingSource + // + this.usersBindingSource.DataMember = "Users"; + this.usersBindingSource.DataSource = this.myShopDataSet; + // + // usersTableAdapter + // + this.usersTableAdapter.ClearBeforeFill = true; + // + // LoginForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(191)))), ((int)(((byte)(229))))); + this.ClientSize = new System.Drawing.Size(420, 258); + this.Controls.Add(this.btnLogin); + this.Controls.Add(this.btnExit); + this.Controls.Add(this.pnlContent); + this.Controls.Add(this.pnlHeader); + this.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "LoginForm"; + this.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ورود"; + this.pnlHeader.ResumeLayout(false); + this.pnlContent.ResumeLayout(false); + this.pnlContent.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picUser)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.myShopDataSet)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.usersBindingSource)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel pnlHeader; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Panel pnlContent; + private System.Windows.Forms.CheckBox chkRememberUserName; + private System.Windows.Forms.TextBox txtPassword; + private System.Windows.Forms.TextBox txtUserName; + private System.Windows.Forms.Label lblPassword; + private System.Windows.Forms.Label lblUserName; + private System.Windows.Forms.PictureBox picUser; + private System.Windows.Forms.Button btnExit; + private System.Windows.Forms.Button btnLogin; + private MyShopDataSet myShopDataSet; + private System.Windows.Forms.BindingSource usersBindingSource; + private MyShopDataSetTableAdapters.UsersTableAdapter usersTableAdapter; + } +} diff --git a/MyShop/LoginForm.cs b/MyShop/LoginForm.cs new file mode 100644 index 0000000..845d865 --- /dev/null +++ b/MyShop/LoginForm.cs @@ -0,0 +1,95 @@ +using System; +using System.IO; +using System.Windows.Forms; + +namespace MyShop +{ + public partial class LoginForm : Form + { + public bool succeeded; + public string CurrentUserName; + + public LoginForm() + { + InitializeComponent(); + LoadSavedUserName(); + } + + private void LoadSavedUserName() + { + txtUserName.Text = Properties.Settings.Default.SavedUserName; + chkRememberUserName.Checked = txtUserName.Text.Length > 0; + } + + private void btnLogin_Click(object sender, EventArgs e) + { + usersTableAdapter.FillByUserNameAndPass(myShopDataSet.Users, txtUserName.Text, txtPassword.Text); + + if (myShopDataSet.Users.Rows.Count > 0) + { + SaveUserName(); + CurrentUserName = txtUserName.Text; + succeeded = true; + + MainForm mainForm = new MainForm(CurrentUserName); + mainForm.FormClosed += new FormClosedEventHandler(MainForm_FormClosed); + mainForm.Show(); + this.Hide(); + } + else + { + WriteFailedLoginLog(txtUserName.Text); + MessageBox.Show("خطا: نام کاربری یا گذرواژه صحیح نیست.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnExit_Click(object sender, EventArgs e) + { + succeeded = false; + this.Close(); + } + + private void MainForm_FormClosed(object sender, FormClosedEventArgs e) + { + this.Close(); + } + + private void WriteFailedLoginLog(string userName) + { + string logPath; + string logText; + + logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log.txt"); + logText = "ورود ناموفق: " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + + " - نام کاربری وارد شده: " + userName + Environment.NewLine; + + try + { + File.AppendAllText(logPath, logText, System.Text.Encoding.UTF8); + } + catch + { + MessageBox.Show("خطا در ثبت ورود ناموفق در پرونده Log.txt", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void SaveUserName() + { + if (chkRememberUserName.Checked) + { + Properties.Settings.Default.SavedUserName = txtUserName.Text; + } + else + { + Properties.Settings.Default.SavedUserName = ""; + } + + Properties.Settings.Default.Save(); + } + + private void usersBindingNavigatorSaveItem_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/MyShop/LoginForm.resx b/MyShop/LoginForm.resx new file mode 100644 index 0000000..15b4a08 --- /dev/null +++ b/MyShop/LoginForm.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 183, 17 + + + 373, 17 + + \ No newline at end of file diff --git a/MyShop/LoginIcon.png b/MyShop/LoginIcon.png new file mode 100644 index 0000000..abf61eb Binary files /dev/null and b/MyShop/LoginIcon.png differ diff --git a/MyShop/MainForm.Designer.cs b/MyShop/MainForm.Designer.cs new file mode 100644 index 0000000..60521b8 --- /dev/null +++ b/MyShop/MainForm.Designer.cs @@ -0,0 +1,1461 @@ +namespace MyShop +{ + partial class MainForm + { + /// + /// متغیرهای مورد نیاز Designer + /// + private System.ComponentModel.IContainer components = null; + + /// + /// آزادسازی منابع استفاده شده + /// + /// اگر true باشد منابع مدیریت‌شده آزاد می‌شوند. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region کد تولید شده توسط Windows Form Designer + + /// + /// متد مورد نیاز Designer + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + this.tabMain = new System.Windows.Forms.TabControl(); + this.tabBuy = new System.Windows.Forms.TabPage(); + this.lblBasketTitle = new System.Windows.Forms.Label(); + this.lblFactorNumberCaption = new System.Windows.Forms.Label(); + this.lblFactorNumberValue = new System.Windows.Forms.Label(); + this.lblFactorDateCaption = new System.Windows.Forms.Label(); + this.lblFactorDateValue = new System.Windows.Forms.Label(); + this.btnFindCustomer = new System.Windows.Forms.Button(); + this.btnFindGoods = new System.Windows.Forms.Button(); + this.btnClearFactor = new System.Windows.Forms.Button(); + this.btnPrintFactor = new System.Windows.Forms.Button(); + this.btnAddFactor = new System.Windows.Forms.Button(); + this.lblFTotalCaption = new System.Windows.Forms.Label(); + this.lblFTotalValue = new System.Windows.Forms.Label(); + this.lblFTotalCurrency = new System.Windows.Forms.Label(); + this.txtFAmount = new System.Windows.Forms.TextBox(); + this.txtFGoodsCode = new System.Windows.Forms.TextBox(); + this.btnSaveFactor = new System.Windows.Forms.Button(); + this.txtFCustomerCode = new System.Windows.Forms.TextBox(); + this.lblFCustomerCode = new System.Windows.Forms.Label(); + this.lblFCustomerName = new System.Windows.Forms.Label(); + this.lblFCustomerNameCaption = new System.Windows.Forms.Label(); + this.lblFCustomerMobile = new System.Windows.Forms.Label(); + this.lblFCustomerMobileCaption = new System.Windows.Forms.Label(); + this.lblFStockValue = new System.Windows.Forms.Label(); + this.lblFStockCaption = new System.Windows.Forms.Label(); + this.lblPrice = new System.Windows.Forms.Label(); + this.lblFPriceCaption = new System.Windows.Forms.Label(); + this.lblGoodsName = new System.Windows.Forms.Label(); + this.lblFGoodsNameCaption = new System.Windows.Forms.Label(); + this.lblFAmount = new System.Windows.Forms.Label(); + this.lblFGoodsCode = new System.Windows.Forms.Label(); + this.dgvFactors = new System.Windows.Forms.DataGridView(); + this.colFactorDelete = new System.Windows.Forms.DataGridViewImageColumn(); + this.colFactorCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFactorName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFactorAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFactorUnitPrice = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFactorTotalPrice = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tabProduct = new System.Windows.Forms.TabPage(); + this.grpProductInfo = new System.Windows.Forms.GroupBox(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnShowBuyForm = new System.Windows.Forms.Button(); + this.btnClear = new System.Windows.Forms.Button(); + this.btnSave = new System.Windows.Forms.Button(); + this.btnDelete = new System.Windows.Forms.Button(); + this.btnEdit = new System.Windows.Forms.Button(); + this.txtStock = new System.Windows.Forms.TextBox(); + this.txtUnitPrice = new System.Windows.Forms.TextBox(); + this.txtGoodsName = new System.Windows.Forms.TextBox(); + this.txtGoodsCode = new System.Windows.Forms.TextBox(); + this.lblStock = new System.Windows.Forms.Label(); + this.lblUnitPrice = new System.Windows.Forms.Label(); + this.lblProductName = new System.Windows.Forms.Label(); + this.lblProductCode = new System.Windows.Forms.Label(); + this.dgvGoods = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.goodsBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.myShopDataSet1 = new MyShop.MyShopDataSet(); + this.grpSearch = new System.Windows.Forms.GroupBox(); + this.txtSearchProductName = new System.Windows.Forms.TextBox(); + this.txtSearchProductCode = new System.Windows.Forms.TextBox(); + this.lblSearchProductName = new System.Windows.Forms.Label(); + this.lblSearchProductCode = new System.Windows.Forms.Label(); + this.tabCustomer = new System.Windows.Forms.TabPage(); + this.grpCustomerInfo = new System.Windows.Forms.GroupBox(); + this.btnCancelCustomer = new System.Windows.Forms.Button(); + this.btnShowBuyFormCustomer = new System.Windows.Forms.Button(); + this.btnClearCustomer = new System.Windows.Forms.Button(); + this.btnSaveCustomer = new System.Windows.Forms.Button(); + this.btnDeleteCustomer = new System.Windows.Forms.Button(); + this.btnEditCustomer = new System.Windows.Forms.Button(); + this.txtCustomerMobile = new System.Windows.Forms.TextBox(); + this.txtCustomerLastName = new System.Windows.Forms.TextBox(); + this.txtCustomerFirstName = new System.Windows.Forms.TextBox(); + this.txtCustomerCode = new System.Windows.Forms.TextBox(); + this.lblCustomerMobile = new System.Windows.Forms.Label(); + this.lblCustomerLastName = new System.Windows.Forms.Label(); + this.lblCustomerFirstName = new System.Windows.Forms.Label(); + this.lblCustomerCode = new System.Windows.Forms.Label(); + this.dgvCustomers = new System.Windows.Forms.DataGridView(); + this.colCustomerCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCustomerFirstName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCustomerLastName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCustomerMobile = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.customersBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.grpCustomerSearch = new System.Windows.Forms.GroupBox(); + this.txtSearchCustomerName = new System.Windows.Forms.TextBox(); + this.txtSearchCustomerCode = new System.Windows.Forms.TextBox(); + this.lblSearchCustomerName = new System.Windows.Forms.Label(); + this.lblSearchCustomerCode = new System.Windows.Forms.Label(); + this.tabReport = new System.Windows.Forms.TabPage(); + this.tabUsers = new System.Windows.Forms.TabPage(); + this.btnDeleteUser = new System.Windows.Forms.Button(); + this.btnUpdateUser = new System.Windows.Forms.Button(); + this.btnAddUser = new System.Windows.Forms.Button(); + this.lblUserPasswordAdmin = new System.Windows.Forms.Label(); + this.lblUserNameAdmin = new System.Windows.Forms.Label(); + this.lblUserCodeAdmin = new System.Windows.Forms.Label(); + this.txtUserPasswordAdmin = new System.Windows.Forms.TextBox(); + this.txtUserNameAdmin = new System.Windows.Forms.TextBox(); + this.txtUserCodeAdmin = new System.Windows.Forms.TextBox(); + this.dgvUsers = new System.Windows.Forms.DataGridView(); + this.btnFirst = new System.Windows.Forms.Button(); + this.btnPrevious = new System.Windows.Forms.Button(); + this.btnNext = new System.Windows.Forms.Button(); + this.btnLast = new System.Windows.Forms.Button(); + this.goodsTableAdapter1 = new MyShop.MyShopDataSetTableAdapters.GoodsTableAdapter(); + this.customersTableAdapter1 = new MyShop.MyShopDataSetTableAdapters.CustomersTableAdapter(); + this.tabMain.SuspendLayout(); + this.tabBuy.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvFactors)).BeginInit(); + this.tabProduct.SuspendLayout(); + this.grpProductInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvGoods)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.goodsBindingSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.myShopDataSet1)).BeginInit(); + this.grpSearch.SuspendLayout(); + this.tabCustomer.SuspendLayout(); + this.grpCustomerInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvCustomers)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).BeginInit(); + this.grpCustomerSearch.SuspendLayout(); + this.tabUsers.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).BeginInit(); + this.SuspendLayout(); + // + // tabMain + // + this.tabMain.Controls.Add(this.tabBuy); + this.tabMain.Controls.Add(this.tabProduct); + this.tabMain.Controls.Add(this.tabCustomer); + this.tabMain.Controls.Add(this.tabReport); + this.tabMain.Controls.Add(this.tabUsers); + this.tabMain.Location = new System.Drawing.Point(12, 12); + this.tabMain.Name = "tabMain"; + this.tabMain.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.tabMain.RightToLeftLayout = true; + this.tabMain.SelectedIndex = 0; + this.tabMain.Size = new System.Drawing.Size(770, 323); + this.tabMain.TabIndex = 0; + // + // tabBuy + // + this.tabBuy.Controls.Add(this.lblBasketTitle); + this.tabBuy.Controls.Add(this.lblFactorNumberCaption); + this.tabBuy.Controls.Add(this.lblFactorNumberValue); + this.tabBuy.Controls.Add(this.lblFactorDateCaption); + this.tabBuy.Controls.Add(this.lblFactorDateValue); + this.tabBuy.Controls.Add(this.btnFindCustomer); + this.tabBuy.Controls.Add(this.btnFindGoods); + this.tabBuy.Controls.Add(this.btnClearFactor); + this.tabBuy.Controls.Add(this.btnPrintFactor); + this.tabBuy.Controls.Add(this.btnAddFactor); + this.tabBuy.Controls.Add(this.lblFTotalCaption); + this.tabBuy.Controls.Add(this.lblFTotalValue); + this.tabBuy.Controls.Add(this.lblFTotalCurrency); + this.tabBuy.Controls.Add(this.txtFAmount); + this.tabBuy.Controls.Add(this.txtFGoodsCode); + this.tabBuy.Controls.Add(this.btnSaveFactor); + this.tabBuy.Controls.Add(this.txtFCustomerCode); + this.tabBuy.Controls.Add(this.lblFCustomerCode); + this.tabBuy.Controls.Add(this.lblFCustomerName); + this.tabBuy.Controls.Add(this.lblFCustomerNameCaption); + this.tabBuy.Controls.Add(this.lblFCustomerMobile); + this.tabBuy.Controls.Add(this.lblFCustomerMobileCaption); + this.tabBuy.Controls.Add(this.lblFStockValue); + this.tabBuy.Controls.Add(this.lblFStockCaption); + this.tabBuy.Controls.Add(this.lblPrice); + this.tabBuy.Controls.Add(this.lblFPriceCaption); + this.tabBuy.Controls.Add(this.lblGoodsName); + this.tabBuy.Controls.Add(this.lblFGoodsNameCaption); + this.tabBuy.Controls.Add(this.lblFAmount); + this.tabBuy.Controls.Add(this.lblFGoodsCode); + this.tabBuy.Controls.Add(this.dgvFactors); + this.tabBuy.Location = new System.Drawing.Point(4, 26); + this.tabBuy.Name = "tabBuy"; + this.tabBuy.Padding = new System.Windows.Forms.Padding(3); + this.tabBuy.Size = new System.Drawing.Size(762, 293); + this.tabBuy.TabIndex = 0; + this.tabBuy.Text = "برگه خرید"; + this.tabBuy.UseVisualStyleBackColor = true; + // + // lblBasketTitle + // + this.lblBasketTitle.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblBasketTitle.Location = new System.Drawing.Point(196, 12); + this.lblBasketTitle.Name = "lblBasketTitle"; + this.lblBasketTitle.Size = new System.Drawing.Size(90, 18); + this.lblBasketTitle.TabIndex = 30; + this.lblBasketTitle.Text = "سبد خرید"; + this.lblBasketTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFactorNumberCaption + // + this.lblFactorNumberCaption.Location = new System.Drawing.Point(636, 18); + this.lblFactorNumberCaption.Name = "lblFactorNumberCaption"; + this.lblFactorNumberCaption.Size = new System.Drawing.Size(88, 18); + this.lblFactorNumberCaption.TabIndex = 29; + this.lblFactorNumberCaption.Text = "شماره برگه خرید:"; + this.lblFactorNumberCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFactorNumberValue + // + this.lblFactorNumberValue.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFactorNumberValue.ForeColor = System.Drawing.Color.Red; + this.lblFactorNumberValue.Location = new System.Drawing.Point(590, 18); + this.lblFactorNumberValue.Name = "lblFactorNumberValue"; + this.lblFactorNumberValue.Size = new System.Drawing.Size(30, 18); + this.lblFactorNumberValue.TabIndex = 28; + this.lblFactorNumberValue.Text = "1"; + this.lblFactorNumberValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFactorDateCaption + // + this.lblFactorDateCaption.Location = new System.Drawing.Point(490, 18); + this.lblFactorDateCaption.Name = "lblFactorDateCaption"; + this.lblFactorDateCaption.Size = new System.Drawing.Size(45, 18); + this.lblFactorDateCaption.TabIndex = 27; + this.lblFactorDateCaption.Text = "تاریخ:"; + this.lblFactorDateCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFactorDateValue + // + this.lblFactorDateValue.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFactorDateValue.ForeColor = System.Drawing.Color.Red; + this.lblFactorDateValue.Location = new System.Drawing.Point(408, 18); + this.lblFactorDateValue.Name = "lblFactorDateValue"; + this.lblFactorDateValue.Size = new System.Drawing.Size(76, 18); + this.lblFactorDateValue.TabIndex = 26; + this.lblFactorDateValue.Text = "1396/11/29"; + this.lblFactorDateValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // btnFindCustomer + // + this.btnFindCustomer.Location = new System.Drawing.Point(390, 55); + this.btnFindCustomer.Name = "btnFindCustomer"; + this.btnFindCustomer.Size = new System.Drawing.Size(28, 24); + this.btnFindCustomer.TabIndex = 25; + this.btnFindCustomer.Text = "..."; + this.btnFindCustomer.UseVisualStyleBackColor = true; + this.btnFindCustomer.Click += new System.EventHandler(this.btnFindCustomer_Click); + // + // btnFindGoods + // + this.btnFindGoods.Location = new System.Drawing.Point(390, 176); + this.btnFindGoods.Name = "btnFindGoods"; + this.btnFindGoods.Size = new System.Drawing.Size(28, 24); + this.btnFindGoods.TabIndex = 24; + this.btnFindGoods.Text = "..."; + this.btnFindGoods.UseVisualStyleBackColor = true; + this.btnFindGoods.Click += new System.EventHandler(this.btnFindGoods_Click); + // + // btnClearFactor + // + this.btnClearFactor.Location = new System.Drawing.Point(18, 252); + this.btnClearFactor.Name = "btnClearFactor"; + this.btnClearFactor.Size = new System.Drawing.Size(110, 28); + this.btnClearFactor.TabIndex = 10; + this.btnClearFactor.Text = "پاک کردن"; + this.btnClearFactor.UseVisualStyleBackColor = true; + this.btnClearFactor.Click += new System.EventHandler(this.btnClearFactor_Click); + // + // btnPrintFactor + // + this.btnPrintFactor.Location = new System.Drawing.Point(140, 252); + this.btnPrintFactor.Name = "btnPrintFactor"; + this.btnPrintFactor.Size = new System.Drawing.Size(110, 28); + this.btnPrintFactor.TabIndex = 9; + this.btnPrintFactor.Text = "چاپ"; + this.btnPrintFactor.UseVisualStyleBackColor = true; + // + // btnAddFactor + // + this.btnAddFactor.Location = new System.Drawing.Point(398, 232); + this.btnAddFactor.Name = "btnAddFactor"; + this.btnAddFactor.Size = new System.Drawing.Size(110, 28); + this.btnAddFactor.TabIndex = 8; + this.btnAddFactor.Text = "درج در سبد خرید"; + this.btnAddFactor.UseVisualStyleBackColor = true; + this.btnAddFactor.Click += new System.EventHandler(this.btnInsertGoods_Click); + // + // lblFTotalCaption + // + this.lblFTotalCaption.Location = new System.Drawing.Point(246, 214); + this.lblFTotalCaption.Name = "lblFTotalCaption"; + this.lblFTotalCaption.Size = new System.Drawing.Size(118, 18); + this.lblFTotalCaption.TabIndex = 7; + this.lblFTotalCaption.Text = "مبلغ قابل پرداخت:"; + this.lblFTotalCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFTotalValue + // + this.lblFTotalValue.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFTotalValue.ForeColor = System.Drawing.Color.Red; + this.lblFTotalValue.Location = new System.Drawing.Point(86, 214); + this.lblFTotalValue.Name = "lblFTotalValue"; + this.lblFTotalValue.Size = new System.Drawing.Size(90, 18); + this.lblFTotalValue.TabIndex = 6; + this.lblFTotalValue.Text = "0"; + this.lblFTotalValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFTotalCurrency + // + this.lblFTotalCurrency.Location = new System.Drawing.Point(28, 214); + this.lblFTotalCurrency.Name = "lblFTotalCurrency"; + this.lblFTotalCurrency.Size = new System.Drawing.Size(50, 18); + this.lblFTotalCurrency.TabIndex = 5; + this.lblFTotalCurrency.Text = "تومان"; + this.lblFTotalCurrency.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtFAmount + // + this.txtFAmount.Location = new System.Drawing.Point(430, 176); + this.txtFAmount.Name = "txtFAmount"; + this.txtFAmount.Size = new System.Drawing.Size(72, 24); + this.txtFAmount.TabIndex = 4; + this.txtFAmount.Text = "1"; + // + // txtFGoodsCode + // + this.txtFGoodsCode.Location = new System.Drawing.Point(570, 176); + this.txtFGoodsCode.Name = "txtFGoodsCode"; + this.txtFGoodsCode.Size = new System.Drawing.Size(72, 24); + this.txtFGoodsCode.TabIndex = 3; + this.txtFGoodsCode.Text = "10"; + this.txtFGoodsCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFGoodsCode_KeyDown); + // + // btnSaveFactor + // + this.btnSaveFactor.Location = new System.Drawing.Point(262, 252); + this.btnSaveFactor.Name = "btnSaveFactor"; + this.btnSaveFactor.Size = new System.Drawing.Size(110, 28); + this.btnSaveFactor.TabIndex = 23; + this.btnSaveFactor.Text = "ثبت برگه خرید"; + this.btnSaveFactor.UseVisualStyleBackColor = true; + this.btnSaveFactor.Click += new System.EventHandler(this.btnSaveFactor_Click); + // + // txtFCustomerCode + // + this.txtFCustomerCode.Location = new System.Drawing.Point(424, 55); + this.txtFCustomerCode.Name = "txtFCustomerCode"; + this.txtFCustomerCode.Size = new System.Drawing.Size(193, 24); + this.txtFCustomerCode.TabIndex = 22; + this.txtFCustomerCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFCustomerCode_KeyDown); + // + // lblFCustomerCode + // + this.lblFCustomerCode.Location = new System.Drawing.Point(636, 57); + this.lblFCustomerCode.Name = "lblFCustomerCode"; + this.lblFCustomerCode.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.lblFCustomerCode.Size = new System.Drawing.Size(74, 18); + this.lblFCustomerCode.TabIndex = 21; + this.lblFCustomerCode.Text = "کد مشتری:"; + this.lblFCustomerCode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.lblFCustomerCode.Click += new System.EventHandler(this.lblFCustomerCode_Click); + // + // lblFCustomerName + // + this.lblFCustomerName.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFCustomerName.ForeColor = System.Drawing.Color.Red; + this.lblFCustomerName.Location = new System.Drawing.Point(505, 91); + this.lblFCustomerName.Name = "lblFCustomerName"; + this.lblFCustomerName.Size = new System.Drawing.Size(107, 18); + this.lblFCustomerName.TabIndex = 20; + this.lblFCustomerName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFCustomerNameCaption + // + this.lblFCustomerNameCaption.Location = new System.Drawing.Point(636, 91); + this.lblFCustomerNameCaption.Name = "lblFCustomerNameCaption"; + this.lblFCustomerNameCaption.Size = new System.Drawing.Size(74, 18); + this.lblFCustomerNameCaption.TabIndex = 19; + this.lblFCustomerNameCaption.Text = "نام مشتری:"; + this.lblFCustomerNameCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFCustomerMobile + // + this.lblFCustomerMobile.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFCustomerMobile.ForeColor = System.Drawing.Color.Red; + this.lblFCustomerMobile.Location = new System.Drawing.Point(515, 122); + this.lblFCustomerMobile.Name = "lblFCustomerMobile"; + this.lblFCustomerMobile.Size = new System.Drawing.Size(95, 18); + this.lblFCustomerMobile.TabIndex = 18; + this.lblFCustomerMobile.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFCustomerMobileCaption + // + this.lblFCustomerMobileCaption.Location = new System.Drawing.Point(634, 122); + this.lblFCustomerMobileCaption.Name = "lblFCustomerMobileCaption"; + this.lblFCustomerMobileCaption.Size = new System.Drawing.Size(48, 18); + this.lblFCustomerMobileCaption.TabIndex = 17; + this.lblFCustomerMobileCaption.Text = "تلفن:"; + this.lblFCustomerMobileCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFStockValue + // + this.lblFStockValue.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblFStockValue.ForeColor = System.Drawing.Color.Red; + this.lblFStockValue.Location = new System.Drawing.Point(515, 256); + this.lblFStockValue.Name = "lblFStockValue"; + this.lblFStockValue.Size = new System.Drawing.Size(94, 18); + this.lblFStockValue.TabIndex = 16; + this.lblFStockValue.Text = "0"; + this.lblFStockValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFStockCaption + // + this.lblFStockCaption.Location = new System.Drawing.Point(623, 256); + this.lblFStockCaption.Name = "lblFStockCaption"; + this.lblFStockCaption.Size = new System.Drawing.Size(80, 18); + this.lblFStockCaption.TabIndex = 15; + this.lblFStockCaption.Text = "موجودی کالا:"; + this.lblFStockCaption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblPrice + // + this.lblPrice.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblPrice.ForeColor = System.Drawing.Color.Red; + this.lblPrice.Location = new System.Drawing.Point(520, 232); + this.lblPrice.Name = "lblPrice"; + this.lblPrice.Size = new System.Drawing.Size(86, 18); + this.lblPrice.TabIndex = 14; + this.lblPrice.Text = "0"; + this.lblPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFPriceCaption + // + this.lblFPriceCaption.Location = new System.Drawing.Point(624, 232); + this.lblFPriceCaption.Name = "lblFPriceCaption"; + this.lblFPriceCaption.Size = new System.Drawing.Size(80, 18); + this.lblFPriceCaption.TabIndex = 13; + this.lblFPriceCaption.Text = "قیمت:"; + this.lblFPriceCaption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblGoodsName + // + this.lblGoodsName.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.lblGoodsName.ForeColor = System.Drawing.Color.Red; + this.lblGoodsName.Location = new System.Drawing.Point(520, 206); + this.lblGoodsName.Name = "lblGoodsName"; + this.lblGoodsName.Size = new System.Drawing.Size(118, 18); + this.lblGoodsName.TabIndex = 12; + this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFGoodsNameCaption + // + this.lblFGoodsNameCaption.Location = new System.Drawing.Point(643, 206); + this.lblFGoodsNameCaption.Name = "lblFGoodsNameCaption"; + this.lblFGoodsNameCaption.Size = new System.Drawing.Size(62, 18); + this.lblFGoodsNameCaption.TabIndex = 11; + this.lblFGoodsNameCaption.Text = "نام کالا:"; + this.lblFGoodsNameCaption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblFAmount + // + this.lblFAmount.Location = new System.Drawing.Point(508, 178); + this.lblFAmount.Name = "lblFAmount"; + this.lblFAmount.Size = new System.Drawing.Size(62, 18); + this.lblFAmount.TabIndex = 2; + this.lblFAmount.Text = "تعداد:"; + this.lblFAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblFGoodsCode + // + this.lblFGoodsCode.Location = new System.Drawing.Point(648, 179); + this.lblFGoodsCode.Name = "lblFGoodsCode"; + this.lblFGoodsCode.Size = new System.Drawing.Size(76, 18); + this.lblFGoodsCode.TabIndex = 1; + this.lblFGoodsCode.Text = "کد کالا:"; + this.lblFGoodsCode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // dgvFactors + // + this.dgvFactors.AllowUserToAddRows = false; + this.dgvFactors.AllowUserToDeleteRows = false; + this.dgvFactors.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvFactors.BackgroundColor = System.Drawing.Color.White; + this.dgvFactors.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvFactors.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colFactorDelete, + this.colFactorCode, + this.colFactorName, + this.colFactorAmount, + this.colFactorUnitPrice, + this.colFactorTotalPrice}); + this.dgvFactors.Location = new System.Drawing.Point(18, 32); + this.dgvFactors.Name = "dgvFactors"; + this.dgvFactors.ReadOnly = true; + this.dgvFactors.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.dgvFactors.RowHeadersWidth = 24; + this.dgvFactors.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvFactors.Size = new System.Drawing.Size(360, 176); + this.dgvFactors.TabIndex = 0; + this.dgvFactors.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvFactors_CellContentClick); + // + // colFactorDelete + // + this.colFactorDelete.FillWeight = 35F; + this.colFactorDelete.HeaderText = ""; + this.colFactorDelete.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.colFactorDelete.Name = "colFactorDelete"; + this.colFactorDelete.ReadOnly = true; + // + // colFactorCode + // + this.colFactorCode.HeaderText = "کد کالا"; + this.colFactorCode.Name = "colFactorCode"; + this.colFactorCode.ReadOnly = true; + // + // colFactorName + // + this.colFactorName.HeaderText = "نام کالا"; + this.colFactorName.Name = "colFactorName"; + this.colFactorName.ReadOnly = true; + // + // colFactorAmount + // + this.colFactorAmount.HeaderText = "تعداد"; + this.colFactorAmount.Name = "colFactorAmount"; + this.colFactorAmount.ReadOnly = true; + // + // colFactorUnitPrice + // + this.colFactorUnitPrice.HeaderText = "قیمت واحد"; + this.colFactorUnitPrice.Name = "colFactorUnitPrice"; + this.colFactorUnitPrice.ReadOnly = true; + // + // colFactorTotalPrice + // + this.colFactorTotalPrice.HeaderText = "قیمت کل"; + this.colFactorTotalPrice.Name = "colFactorTotalPrice"; + this.colFactorTotalPrice.ReadOnly = true; + // + // tabProduct + // + this.tabProduct.Controls.Add(this.grpProductInfo); + this.tabProduct.Controls.Add(this.dgvGoods); + this.tabProduct.Controls.Add(this.grpSearch); + this.tabProduct.Location = new System.Drawing.Point(4, 26); + this.tabProduct.Name = "tabProduct"; + this.tabProduct.Padding = new System.Windows.Forms.Padding(3); + this.tabProduct.Size = new System.Drawing.Size(762, 293); + this.tabProduct.TabIndex = 1; + this.tabProduct.Text = "کالا"; + this.tabProduct.UseVisualStyleBackColor = true; + // + // grpProductInfo + // + this.grpProductInfo.Controls.Add(this.btnCancel); + this.grpProductInfo.Controls.Add(this.btnShowBuyForm); + this.grpProductInfo.Controls.Add(this.btnClear); + this.grpProductInfo.Controls.Add(this.btnSave); + this.grpProductInfo.Controls.Add(this.btnDelete); + this.grpProductInfo.Controls.Add(this.btnEdit); + this.grpProductInfo.Controls.Add(this.txtStock); + this.grpProductInfo.Controls.Add(this.txtUnitPrice); + this.grpProductInfo.Controls.Add(this.txtGoodsName); + this.grpProductInfo.Controls.Add(this.txtGoodsCode); + this.grpProductInfo.Controls.Add(this.lblStock); + this.grpProductInfo.Controls.Add(this.lblUnitPrice); + this.grpProductInfo.Controls.Add(this.lblProductName); + this.grpProductInfo.Controls.Add(this.lblProductCode); + this.grpProductInfo.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.grpProductInfo.Location = new System.Drawing.Point(344, 100); + this.grpProductInfo.Name = "grpProductInfo"; + this.grpProductInfo.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.grpProductInfo.Size = new System.Drawing.Size(412, 184); + this.grpProductInfo.TabIndex = 6; + this.grpProductInfo.TabStop = false; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(6, 152); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(70, 26); + this.btnCancel.TabIndex = 13; + this.btnCancel.Text = "برگشت"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnShowBuyForm + // + this.btnShowBuyForm.Location = new System.Drawing.Point(82, 152); + this.btnShowBuyForm.Name = "btnShowBuyForm"; + this.btnShowBuyForm.Size = new System.Drawing.Size(66, 26); + this.btnShowBuyForm.TabIndex = 12; + this.btnShowBuyForm.Text = "فرم برگه خرید"; + this.btnShowBuyForm.UseVisualStyleBackColor = true; + this.btnShowBuyForm.Click += new System.EventHandler(this.btnInsertGoodsFactor_Click); + // + // btnClear + // + this.btnClear.Location = new System.Drawing.Point(154, 152); + this.btnClear.Name = "btnClear"; + this.btnClear.Size = new System.Drawing.Size(56, 26); + this.btnClear.TabIndex = 11; + this.btnClear.Text = "پاک کردن"; + this.btnClear.UseVisualStyleBackColor = true; + this.btnClear.Click += new System.EventHandler(this.btnClearGoods_Click); + // + // btnSave + // + this.btnSave.Location = new System.Drawing.Point(350, 152); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(53, 26); + this.btnSave.TabIndex = 8; + this.btnSave.Text = "ثبت"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnAddGoods_Click); + // + // btnDelete + // + this.btnDelete.Location = new System.Drawing.Point(216, 152); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.Size = new System.Drawing.Size(57, 26); + this.btnDelete.TabIndex = 10; + this.btnDelete.Text = "حذف"; + this.btnDelete.UseVisualStyleBackColor = true; + this.btnDelete.Click += new System.EventHandler(this.btnDeleteGoods_Click); + // + // btnEdit + // + this.btnEdit.Location = new System.Drawing.Point(279, 152); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.Size = new System.Drawing.Size(65, 26); + this.btnEdit.TabIndex = 9; + this.btnEdit.Text = "ویرایش"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnUpdateGoods_Click); + // + // txtStock + // + this.txtStock.Location = new System.Drawing.Point(51, 112); + this.txtStock.Name = "txtStock"; + this.txtStock.Size = new System.Drawing.Size(175, 24); + this.txtStock.TabIndex = 7; + // + // txtUnitPrice + // + this.txtUnitPrice.Location = new System.Drawing.Point(51, 82); + this.txtUnitPrice.Name = "txtUnitPrice"; + this.txtUnitPrice.Size = new System.Drawing.Size(175, 24); + this.txtUnitPrice.TabIndex = 6; + // + // txtGoodsName + // + this.txtGoodsName.Location = new System.Drawing.Point(51, 52); + this.txtGoodsName.Name = "txtGoodsName"; + this.txtGoodsName.Size = new System.Drawing.Size(175, 24); + this.txtGoodsName.TabIndex = 5; + // + // txtGoodsCode + // + this.txtGoodsCode.Location = new System.Drawing.Point(51, 22); + this.txtGoodsCode.Name = "txtGoodsCode"; + this.txtGoodsCode.Size = new System.Drawing.Size(175, 24); + this.txtGoodsCode.TabIndex = 4; + // + // lblStock + // + this.lblStock.Location = new System.Drawing.Point(232, 115); + this.lblStock.Name = "lblStock"; + this.lblStock.Size = new System.Drawing.Size(56, 17); + this.lblStock.TabIndex = 3; + this.lblStock.Text = "موجودی:"; + // + // lblUnitPrice + // + this.lblUnitPrice.Location = new System.Drawing.Point(232, 85); + this.lblUnitPrice.Name = "lblUnitPrice"; + this.lblUnitPrice.Size = new System.Drawing.Size(56, 17); + this.lblUnitPrice.TabIndex = 2; + this.lblUnitPrice.Text = "قیمت واحد:"; + // + // lblProductName + // + this.lblProductName.Location = new System.Drawing.Point(232, 55); + this.lblProductName.Name = "lblProductName"; + this.lblProductName.Size = new System.Drawing.Size(56, 17); + this.lblProductName.TabIndex = 1; + this.lblProductName.Text = "نام کالا:"; + // + // lblProductCode + // + this.lblProductCode.Location = new System.Drawing.Point(232, 25); + this.lblProductCode.Name = "lblProductCode"; + this.lblProductCode.Size = new System.Drawing.Size(56, 17); + this.lblProductCode.TabIndex = 0; + this.lblProductCode.Text = "کد کالا:"; + // + // dgvGoods + // + this.dgvGoods.AllowUserToAddRows = false; + this.dgvGoods.AllowUserToDeleteRows = false; + this.dgvGoods.AutoGenerateColumns = false; + this.dgvGoods.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvGoods.BackgroundColor = System.Drawing.Color.White; + this.dgvGoods.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvGoods.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2, + this.dataGridViewTextBoxColumn3, + this.dataGridViewTextBoxColumn4}); + this.dgvGoods.DataSource = this.goodsBindingSource; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8.25F); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvGoods.DefaultCellStyle = dataGridViewCellStyle3; + this.dgvGoods.Location = new System.Drawing.Point(8, 30); + this.dgvGoods.Name = "dgvGoods"; + this.dgvGoods.ReadOnly = true; + this.dgvGoods.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.dgvGoods.RowHeadersWidth = 24; + this.dgvGoods.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvGoods.Size = new System.Drawing.Size(330, 254); + this.dgvGoods.TabIndex = 5; + this.dgvGoods.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvProducts_CellClick); + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.DataPropertyName = "GoodsCode"; + this.dataGridViewTextBoxColumn1.HeaderText = "کد کالا"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.DataPropertyName = "GoodsName"; + this.dataGridViewTextBoxColumn2.HeaderText = "نام کالا"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.ReadOnly = true; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.DataPropertyName = "GoodsUnitPrice"; + this.dataGridViewTextBoxColumn3.HeaderText = "قیمت واحد"; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + this.dataGridViewTextBoxColumn3.ReadOnly = true; + // + // dataGridViewTextBoxColumn4 + // + this.dataGridViewTextBoxColumn4.DataPropertyName = "GoodsStock"; + this.dataGridViewTextBoxColumn4.HeaderText = "موجودی"; + this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; + this.dataGridViewTextBoxColumn4.ReadOnly = true; + // + // goodsBindingSource + // + this.goodsBindingSource.DataMember = "Goods"; + this.goodsBindingSource.DataSource = this.myShopDataSet1; + // + // myShopDataSet1 + // + this.myShopDataSet1.DataSetName = "MyShopDataSet"; + this.myShopDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + // + // grpSearch + // + this.grpSearch.Controls.Add(this.txtSearchProductName); + this.grpSearch.Controls.Add(this.txtSearchProductCode); + this.grpSearch.Controls.Add(this.lblSearchProductName); + this.grpSearch.Controls.Add(this.lblSearchProductCode); + this.grpSearch.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.grpSearch.Location = new System.Drawing.Point(346, 9); + this.grpSearch.Name = "grpSearch"; + this.grpSearch.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.grpSearch.Size = new System.Drawing.Size(258, 82); + this.grpSearch.TabIndex = 4; + this.grpSearch.TabStop = false; + this.grpSearch.Text = "جستجو"; + // + // txtSearchProductName + // + this.txtSearchProductName.Location = new System.Drawing.Point(17, 50); + this.txtSearchProductName.Name = "txtSearchProductName"; + this.txtSearchProductName.Size = new System.Drawing.Size(174, 24); + this.txtSearchProductName.TabIndex = 3; + this.txtSearchProductName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearchProductName_KeyDown); + // + // txtSearchProductCode + // + this.txtSearchProductCode.Location = new System.Drawing.Point(17, 20); + this.txtSearchProductCode.Name = "txtSearchProductCode"; + this.txtSearchProductCode.Size = new System.Drawing.Size(174, 24); + this.txtSearchProductCode.TabIndex = 2; + this.txtSearchProductCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearchProductCode_KeyDown); + // + // lblSearchProductName + // + this.lblSearchProductName.Location = new System.Drawing.Point(197, 52); + this.lblSearchProductName.Name = "lblSearchProductName"; + this.lblSearchProductName.Size = new System.Drawing.Size(50, 17); + this.lblSearchProductName.TabIndex = 1; + this.lblSearchProductName.Text = "نام کالا:"; + // + // lblSearchProductCode + // + this.lblSearchProductCode.Location = new System.Drawing.Point(197, 22); + this.lblSearchProductCode.Name = "lblSearchProductCode"; + this.lblSearchProductCode.Size = new System.Drawing.Size(50, 17); + this.lblSearchProductCode.TabIndex = 0; + this.lblSearchProductCode.Text = "کد کالا:"; + // + // tabCustomer + // + this.tabCustomer.Controls.Add(this.grpCustomerInfo); + this.tabCustomer.Controls.Add(this.dgvCustomers); + this.tabCustomer.Controls.Add(this.grpCustomerSearch); + this.tabCustomer.Location = new System.Drawing.Point(4, 26); + this.tabCustomer.Name = "tabCustomer"; + this.tabCustomer.Padding = new System.Windows.Forms.Padding(3); + this.tabCustomer.Size = new System.Drawing.Size(762, 293); + this.tabCustomer.TabIndex = 2; + this.tabCustomer.Text = "مشتری"; + this.tabCustomer.UseVisualStyleBackColor = true; + // + // grpCustomerInfo + // + this.grpCustomerInfo.Controls.Add(this.btnCancelCustomer); + this.grpCustomerInfo.Controls.Add(this.btnShowBuyFormCustomer); + this.grpCustomerInfo.Controls.Add(this.btnClearCustomer); + this.grpCustomerInfo.Controls.Add(this.btnSaveCustomer); + this.grpCustomerInfo.Controls.Add(this.btnDeleteCustomer); + this.grpCustomerInfo.Controls.Add(this.btnEditCustomer); + this.grpCustomerInfo.Controls.Add(this.txtCustomerMobile); + this.grpCustomerInfo.Controls.Add(this.txtCustomerLastName); + this.grpCustomerInfo.Controls.Add(this.txtCustomerFirstName); + this.grpCustomerInfo.Controls.Add(this.txtCustomerCode); + this.grpCustomerInfo.Controls.Add(this.lblCustomerMobile); + this.grpCustomerInfo.Controls.Add(this.lblCustomerLastName); + this.grpCustomerInfo.Controls.Add(this.lblCustomerFirstName); + this.grpCustomerInfo.Controls.Add(this.lblCustomerCode); + this.grpCustomerInfo.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.grpCustomerInfo.Location = new System.Drawing.Point(344, 100); + this.grpCustomerInfo.Name = "grpCustomerInfo"; + this.grpCustomerInfo.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.grpCustomerInfo.Size = new System.Drawing.Size(412, 184); + this.grpCustomerInfo.TabIndex = 9; + this.grpCustomerInfo.TabStop = false; + // + // btnCancelCustomer + // + this.btnCancelCustomer.Location = new System.Drawing.Point(6, 152); + this.btnCancelCustomer.Name = "btnCancelCustomer"; + this.btnCancelCustomer.Size = new System.Drawing.Size(70, 26); + this.btnCancelCustomer.TabIndex = 13; + this.btnCancelCustomer.Text = "برگشت"; + this.btnCancelCustomer.UseVisualStyleBackColor = true; + // + // btnShowBuyFormCustomer + // + this.btnShowBuyFormCustomer.Location = new System.Drawing.Point(82, 152); + this.btnShowBuyFormCustomer.Name = "btnShowBuyFormCustomer"; + this.btnShowBuyFormCustomer.Size = new System.Drawing.Size(66, 26); + this.btnShowBuyFormCustomer.TabIndex = 12; + this.btnShowBuyFormCustomer.Text = "فرم برگه خرید"; + this.btnShowBuyFormCustomer.UseVisualStyleBackColor = true; + this.btnShowBuyFormCustomer.Click += new System.EventHandler(this.btnShowBuyFormCustomer_Click); + // + // btnClearCustomer + // + this.btnClearCustomer.Location = new System.Drawing.Point(154, 152); + this.btnClearCustomer.Name = "btnClearCustomer"; + this.btnClearCustomer.Size = new System.Drawing.Size(56, 26); + this.btnClearCustomer.TabIndex = 11; + this.btnClearCustomer.Text = "پاک کردن"; + this.btnClearCustomer.UseVisualStyleBackColor = true; + this.btnClearCustomer.Click += new System.EventHandler(this.btnClearCustomer_Click); + // + // btnSaveCustomer + // + this.btnSaveCustomer.Location = new System.Drawing.Point(350, 152); + this.btnSaveCustomer.Name = "btnSaveCustomer"; + this.btnSaveCustomer.Size = new System.Drawing.Size(53, 26); + this.btnSaveCustomer.TabIndex = 8; + this.btnSaveCustomer.Text = "ثبت"; + this.btnSaveCustomer.UseVisualStyleBackColor = true; + this.btnSaveCustomer.Click += new System.EventHandler(this.btnAddCustomer_Click); + // + // btnDeleteCustomer + // + this.btnDeleteCustomer.Location = new System.Drawing.Point(216, 152); + this.btnDeleteCustomer.Name = "btnDeleteCustomer"; + this.btnDeleteCustomer.Size = new System.Drawing.Size(57, 26); + this.btnDeleteCustomer.TabIndex = 10; + this.btnDeleteCustomer.Text = "حذف"; + this.btnDeleteCustomer.UseVisualStyleBackColor = true; + this.btnDeleteCustomer.Click += new System.EventHandler(this.btnDeleteCustomer_Click); + // + // btnEditCustomer + // + this.btnEditCustomer.Location = new System.Drawing.Point(279, 152); + this.btnEditCustomer.Name = "btnEditCustomer"; + this.btnEditCustomer.Size = new System.Drawing.Size(65, 26); + this.btnEditCustomer.TabIndex = 9; + this.btnEditCustomer.Text = "ویرایش"; + this.btnEditCustomer.UseVisualStyleBackColor = true; + this.btnEditCustomer.Click += new System.EventHandler(this.btnUpdateCustomer_Click); + // + // txtCustomerMobile + // + this.txtCustomerMobile.Location = new System.Drawing.Point(51, 112); + this.txtCustomerMobile.Name = "txtCustomerMobile"; + this.txtCustomerMobile.Size = new System.Drawing.Size(175, 24); + this.txtCustomerMobile.TabIndex = 7; + this.txtCustomerMobile.TextChanged += new System.EventHandler(this.txtCustomerMobile_TextChanged); + // + // txtCustomerLastName + // + this.txtCustomerLastName.Location = new System.Drawing.Point(51, 82); + this.txtCustomerLastName.Name = "txtCustomerLastName"; + this.txtCustomerLastName.Size = new System.Drawing.Size(175, 24); + this.txtCustomerLastName.TabIndex = 6; + this.txtCustomerLastName.TextChanged += new System.EventHandler(this.txtCustomerLastName_TextChanged); + // + // txtCustomerFirstName + // + this.txtCustomerFirstName.Location = new System.Drawing.Point(51, 52); + this.txtCustomerFirstName.Name = "txtCustomerFirstName"; + this.txtCustomerFirstName.Size = new System.Drawing.Size(175, 24); + this.txtCustomerFirstName.TabIndex = 5; + this.txtCustomerFirstName.TextChanged += new System.EventHandler(this.txtCustomerFirstName_TextChanged); + // + // txtCustomerCode + // + this.txtCustomerCode.Location = new System.Drawing.Point(51, 22); + this.txtCustomerCode.Name = "txtCustomerCode"; + this.txtCustomerCode.Size = new System.Drawing.Size(175, 24); + this.txtCustomerCode.TabIndex = 4; + this.txtCustomerCode.TextChanged += new System.EventHandler(this.txtCustomerCode_TextChanged); + // + // lblCustomerMobile + // + this.lblCustomerMobile.Location = new System.Drawing.Point(232, 115); + this.lblCustomerMobile.Name = "lblCustomerMobile"; + this.lblCustomerMobile.Size = new System.Drawing.Size(70, 17); + this.lblCustomerMobile.TabIndex = 3; + this.lblCustomerMobile.Text = "موبایل:"; + // + // lblCustomerLastName + // + this.lblCustomerLastName.Location = new System.Drawing.Point(232, 85); + this.lblCustomerLastName.Name = "lblCustomerLastName"; + this.lblCustomerLastName.Size = new System.Drawing.Size(70, 17); + this.lblCustomerLastName.TabIndex = 2; + this.lblCustomerLastName.Text = "نام خانوادگی:"; + // + // lblCustomerFirstName + // + this.lblCustomerFirstName.Location = new System.Drawing.Point(232, 55); + this.lblCustomerFirstName.Name = "lblCustomerFirstName"; + this.lblCustomerFirstName.Size = new System.Drawing.Size(70, 17); + this.lblCustomerFirstName.TabIndex = 1; + this.lblCustomerFirstName.Text = "نام:"; + // + // lblCustomerCode + // + this.lblCustomerCode.Location = new System.Drawing.Point(232, 25); + this.lblCustomerCode.Name = "lblCustomerCode"; + this.lblCustomerCode.Size = new System.Drawing.Size(70, 17); + this.lblCustomerCode.TabIndex = 0; + this.lblCustomerCode.Text = "کد مشتری:"; + // + // dgvCustomers + // + this.dgvCustomers.AllowUserToAddRows = false; + this.dgvCustomers.AllowUserToDeleteRows = false; + this.dgvCustomers.AutoGenerateColumns = false; + this.dgvCustomers.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvCustomers.BackgroundColor = System.Drawing.Color.White; + this.dgvCustomers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvCustomers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colCustomerCode, + this.colCustomerFirstName, + this.colCustomerLastName, + this.colCustomerMobile}); + this.dgvCustomers.DataSource = this.customersBindingSource; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Tahoma", 8.25F); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvCustomers.DefaultCellStyle = dataGridViewCellStyle4; + this.dgvCustomers.Location = new System.Drawing.Point(8, 30); + this.dgvCustomers.Name = "dgvCustomers"; + this.dgvCustomers.ReadOnly = true; + this.dgvCustomers.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.dgvCustomers.RowHeadersWidth = 24; + this.dgvCustomers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvCustomers.Size = new System.Drawing.Size(330, 254); + this.dgvCustomers.TabIndex = 8; + this.dgvCustomers.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvCustomers_CellClick); + // + // colCustomerCode + // + this.colCustomerCode.DataPropertyName = "CustomerCode"; + this.colCustomerCode.HeaderText = "کد مشتری"; + this.colCustomerCode.Name = "colCustomerCode"; + this.colCustomerCode.ReadOnly = true; + // + // colCustomerFirstName + // + this.colCustomerFirstName.DataPropertyName = "CustomerFirstName"; + this.colCustomerFirstName.HeaderText = "نام"; + this.colCustomerFirstName.Name = "colCustomerFirstName"; + this.colCustomerFirstName.ReadOnly = true; + // + // colCustomerLastName + // + this.colCustomerLastName.DataPropertyName = "CustomerLastName"; + this.colCustomerLastName.HeaderText = "نام خانوادگی"; + this.colCustomerLastName.Name = "colCustomerLastName"; + this.colCustomerLastName.ReadOnly = true; + // + // colCustomerMobile + // + this.colCustomerMobile.DataPropertyName = "CustomerMobile"; + this.colCustomerMobile.HeaderText = "موبایل"; + this.colCustomerMobile.Name = "colCustomerMobile"; + this.colCustomerMobile.ReadOnly = true; + // + // customersBindingSource + // + this.customersBindingSource.DataMember = "Customers"; + this.customersBindingSource.DataSource = this.myShopDataSet1; + // + // grpCustomerSearch + // + this.grpCustomerSearch.Controls.Add(this.txtSearchCustomerName); + this.grpCustomerSearch.Controls.Add(this.txtSearchCustomerCode); + this.grpCustomerSearch.Controls.Add(this.lblSearchCustomerName); + this.grpCustomerSearch.Controls.Add(this.lblSearchCustomerCode); + this.grpCustomerSearch.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.grpCustomerSearch.Location = new System.Drawing.Point(346, 9); + this.grpCustomerSearch.Name = "grpCustomerSearch"; + this.grpCustomerSearch.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.grpCustomerSearch.Size = new System.Drawing.Size(258, 82); + this.grpCustomerSearch.TabIndex = 7; + this.grpCustomerSearch.TabStop = false; + this.grpCustomerSearch.Text = "جستجو"; + // + // txtSearchCustomerName + // + this.txtSearchCustomerName.Location = new System.Drawing.Point(17, 50); + this.txtSearchCustomerName.Name = "txtSearchCustomerName"; + this.txtSearchCustomerName.Size = new System.Drawing.Size(174, 24); + this.txtSearchCustomerName.TabIndex = 3; + this.txtSearchCustomerName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearchCustomerName_KeyDown); + // + // txtSearchCustomerCode + // + this.txtSearchCustomerCode.Location = new System.Drawing.Point(17, 20); + this.txtSearchCustomerCode.Name = "txtSearchCustomerCode"; + this.txtSearchCustomerCode.Size = new System.Drawing.Size(174, 24); + this.txtSearchCustomerCode.TabIndex = 2; + this.txtSearchCustomerCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearchCustomerCode_KeyDown); + // + // lblSearchCustomerName + // + this.lblSearchCustomerName.Location = new System.Drawing.Point(197, 52); + this.lblSearchCustomerName.Name = "lblSearchCustomerName"; + this.lblSearchCustomerName.Size = new System.Drawing.Size(50, 17); + this.lblSearchCustomerName.TabIndex = 1; + this.lblSearchCustomerName.Text = "نام:"; + // + // lblSearchCustomerCode + // + this.lblSearchCustomerCode.Location = new System.Drawing.Point(197, 22); + this.lblSearchCustomerCode.Name = "lblSearchCustomerCode"; + this.lblSearchCustomerCode.Size = new System.Drawing.Size(50, 17); + this.lblSearchCustomerCode.TabIndex = 0; + this.lblSearchCustomerCode.Text = "کد مشتری:"; + // + // tabReport + // + this.tabReport.Location = new System.Drawing.Point(4, 26); + this.tabReport.Name = "tabReport"; + this.tabReport.Padding = new System.Windows.Forms.Padding(3); + this.tabReport.Size = new System.Drawing.Size(762, 293); + this.tabReport.TabIndex = 3; + this.tabReport.Text = "گزارش"; + this.tabReport.UseVisualStyleBackColor = true; + // + // tabUsers + // + this.tabUsers.Controls.Add(this.btnDeleteUser); + this.tabUsers.Controls.Add(this.btnUpdateUser); + this.tabUsers.Controls.Add(this.btnAddUser); + this.tabUsers.Controls.Add(this.lblUserPasswordAdmin); + this.tabUsers.Controls.Add(this.lblUserNameAdmin); + this.tabUsers.Controls.Add(this.lblUserCodeAdmin); + this.tabUsers.Controls.Add(this.txtUserPasswordAdmin); + this.tabUsers.Controls.Add(this.txtUserNameAdmin); + this.tabUsers.Controls.Add(this.txtUserCodeAdmin); + this.tabUsers.Controls.Add(this.dgvUsers); + this.tabUsers.Location = new System.Drawing.Point(4, 26); + this.tabUsers.Name = "tabUsers"; + this.tabUsers.Padding = new System.Windows.Forms.Padding(3); + this.tabUsers.Size = new System.Drawing.Size(762, 293); + this.tabUsers.TabIndex = 4; + this.tabUsers.Text = "کاربران"; + this.tabUsers.UseVisualStyleBackColor = true; + // + // btnDeleteUser + // + this.btnDeleteUser.Location = new System.Drawing.Point(632, 170); + this.btnDeleteUser.Name = "btnDeleteUser"; + this.btnDeleteUser.Size = new System.Drawing.Size(70, 26); + this.btnDeleteUser.TabIndex = 9; + this.btnDeleteUser.Text = "حذف"; + this.btnDeleteUser.UseVisualStyleBackColor = true; + this.btnDeleteUser.Click += new System.EventHandler(this.btnDeleteUser_Click); + // + // btnUpdateUser + // + this.btnUpdateUser.Location = new System.Drawing.Point(556, 170); + this.btnUpdateUser.Name = "btnUpdateUser"; + this.btnUpdateUser.Size = new System.Drawing.Size(70, 26); + this.btnUpdateUser.TabIndex = 8; + this.btnUpdateUser.Text = "ویرایش"; + this.btnUpdateUser.UseVisualStyleBackColor = true; + this.btnUpdateUser.Click += new System.EventHandler(this.btnUpdateUser_Click); + // + // btnAddUser + // + this.btnAddUser.Location = new System.Drawing.Point(480, 170); + this.btnAddUser.Name = "btnAddUser"; + this.btnAddUser.Size = new System.Drawing.Size(70, 26); + this.btnAddUser.TabIndex = 7; + this.btnAddUser.Text = "ثبت"; + this.btnAddUser.UseVisualStyleBackColor = true; + this.btnAddUser.Click += new System.EventHandler(this.btnAddUser_Click); + // + // lblUserPasswordAdmin + // + this.lblUserPasswordAdmin.Location = new System.Drawing.Point(636, 124); + this.lblUserPasswordAdmin.Name = "lblUserPasswordAdmin"; + this.lblUserPasswordAdmin.Size = new System.Drawing.Size(70, 18); + this.lblUserPasswordAdmin.TabIndex = 6; + this.lblUserPasswordAdmin.Text = "گذرواژه:"; + // + // lblUserNameAdmin + // + this.lblUserNameAdmin.Location = new System.Drawing.Point(636, 82); + this.lblUserNameAdmin.Name = "lblUserNameAdmin"; + this.lblUserNameAdmin.Size = new System.Drawing.Size(70, 18); + this.lblUserNameAdmin.TabIndex = 5; + this.lblUserNameAdmin.Text = "نام کاربری:"; + // + // lblUserCodeAdmin + // + this.lblUserCodeAdmin.Location = new System.Drawing.Point(636, 40); + this.lblUserCodeAdmin.Name = "lblUserCodeAdmin"; + this.lblUserCodeAdmin.Size = new System.Drawing.Size(70, 18); + this.lblUserCodeAdmin.TabIndex = 4; + this.lblUserCodeAdmin.Text = "کد کاربر:"; + // + // txtUserPasswordAdmin + // + this.txtUserPasswordAdmin.Location = new System.Drawing.Point(480, 122); + this.txtUserPasswordAdmin.Name = "txtUserPasswordAdmin"; + this.txtUserPasswordAdmin.Size = new System.Drawing.Size(150, 24); + this.txtUserPasswordAdmin.TabIndex = 3; + // + // txtUserNameAdmin + // + this.txtUserNameAdmin.Location = new System.Drawing.Point(480, 80); + this.txtUserNameAdmin.Name = "txtUserNameAdmin"; + this.txtUserNameAdmin.Size = new System.Drawing.Size(150, 24); + this.txtUserNameAdmin.TabIndex = 2; + // + // txtUserCodeAdmin + // + this.txtUserCodeAdmin.Location = new System.Drawing.Point(480, 38); + this.txtUserCodeAdmin.Name = "txtUserCodeAdmin"; + this.txtUserCodeAdmin.ReadOnly = true; + this.txtUserCodeAdmin.Size = new System.Drawing.Size(150, 24); + this.txtUserCodeAdmin.TabIndex = 1; + // + // dgvUsers + // + this.dgvUsers.AllowUserToAddRows = false; + this.dgvUsers.AllowUserToDeleteRows = false; + this.dgvUsers.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvUsers.BackgroundColor = System.Drawing.Color.White; + this.dgvUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvUsers.Location = new System.Drawing.Point(20, 22); + this.dgvUsers.Name = "dgvUsers"; + this.dgvUsers.ReadOnly = true; + this.dgvUsers.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.dgvUsers.RowHeadersWidth = 24; + this.dgvUsers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvUsers.Size = new System.Drawing.Size(420, 240); + this.dgvUsers.TabIndex = 0; + this.dgvUsers.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUsers_CellClick); + // + // btnFirst + // + this.btnFirst.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnFirst.Location = new System.Drawing.Point(32, 346); + this.btnFirst.Name = "btnFirst"; + this.btnFirst.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.btnFirst.Size = new System.Drawing.Size(70, 24); + this.btnFirst.TabIndex = 7; + this.btnFirst.Text = "<<"; + this.btnFirst.UseVisualStyleBackColor = true; + this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click); + // + // btnPrevious + // + this.btnPrevious.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnPrevious.Location = new System.Drawing.Point(106, 346); + this.btnPrevious.Name = "btnPrevious"; + this.btnPrevious.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.btnPrevious.Size = new System.Drawing.Size(70, 24); + this.btnPrevious.TabIndex = 8; + this.btnPrevious.Text = "<"; + this.btnPrevious.UseVisualStyleBackColor = true; + this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); + // + // btnNext + // + this.btnNext.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnNext.Location = new System.Drawing.Point(182, 346); + this.btnNext.Name = "btnNext"; + this.btnNext.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.btnNext.Size = new System.Drawing.Size(70, 24); + this.btnNext.TabIndex = 9; + this.btnNext.Text = ">"; + this.btnNext.UseVisualStyleBackColor = true; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnLast + // + this.btnLast.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.btnLast.Location = new System.Drawing.Point(258, 346); + this.btnLast.Name = "btnLast"; + this.btnLast.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.btnLast.Size = new System.Drawing.Size(70, 24); + this.btnLast.TabIndex = 10; + this.btnLast.Text = ">>"; + this.btnLast.UseVisualStyleBackColor = true; + this.btnLast.Click += new System.EventHandler(this.btnLast_Click); + // + // goodsTableAdapter1 + // + this.goodsTableAdapter1.ClearBeforeFill = true; + // + // customersTableAdapter1 + // + this.customersTableAdapter1.ClearBeforeFill = true; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.WhiteSmoke; + this.ClientSize = new System.Drawing.Size(784, 386); + this.Controls.Add(this.btnLast); + this.Controls.Add(this.btnNext); + this.Controls.Add(this.btnPrevious); + this.Controls.Add(this.btnFirst); + this.Controls.Add(this.tabMain); + this.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.Name = "MainForm"; + this.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "فروشگاه"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); + this.Load += new System.EventHandler(this.MainForm_Load); + this.tabMain.ResumeLayout(false); + this.tabBuy.ResumeLayout(false); + this.tabBuy.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvFactors)).EndInit(); + this.tabProduct.ResumeLayout(false); + this.grpProductInfo.ResumeLayout(false); + this.grpProductInfo.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvGoods)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.goodsBindingSource)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.myShopDataSet1)).EndInit(); + this.grpSearch.ResumeLayout(false); + this.grpSearch.PerformLayout(); + this.tabCustomer.ResumeLayout(false); + this.grpCustomerInfo.ResumeLayout(false); + this.grpCustomerInfo.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvCustomers)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).EndInit(); + this.grpCustomerSearch.ResumeLayout(false); + this.grpCustomerSearch.PerformLayout(); + this.tabUsers.ResumeLayout(false); + this.tabUsers.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabMain; + private System.Windows.Forms.TabPage tabBuy; + private System.Windows.Forms.Label lblBasketTitle; + private System.Windows.Forms.Label lblFactorNumberCaption; + private System.Windows.Forms.Label lblFactorNumberValue; + private System.Windows.Forms.Label lblFactorDateCaption; + private System.Windows.Forms.Label lblFactorDateValue; + private System.Windows.Forms.Button btnFindCustomer; + private System.Windows.Forms.Button btnFindGoods; + private System.Windows.Forms.Button btnClearFactor; + private System.Windows.Forms.Button btnPrintFactor; + private System.Windows.Forms.Button btnAddFactor; + private System.Windows.Forms.Label lblFTotalCaption; + private System.Windows.Forms.Label lblFTotalValue; + private System.Windows.Forms.Label lblFTotalCurrency; + private System.Windows.Forms.TextBox txtFAmount; + private System.Windows.Forms.TextBox txtFGoodsCode; + private System.Windows.Forms.Button btnSaveFactor; + private System.Windows.Forms.TextBox txtFCustomerCode; + private System.Windows.Forms.Label lblFCustomerCode; + private System.Windows.Forms.Label lblFCustomerName; + private System.Windows.Forms.Label lblFCustomerNameCaption; + private System.Windows.Forms.Label lblFCustomerMobile; + private System.Windows.Forms.Label lblFCustomerMobileCaption; + private System.Windows.Forms.Label lblFStockValue; + private System.Windows.Forms.Label lblFStockCaption; + private System.Windows.Forms.Label lblPrice; + private System.Windows.Forms.Label lblFPriceCaption; + private System.Windows.Forms.Label lblGoodsName; + private System.Windows.Forms.Label lblFGoodsNameCaption; + private System.Windows.Forms.Label lblFAmount; + private System.Windows.Forms.Label lblFGoodsCode; + private System.Windows.Forms.DataGridView dgvFactors; + private System.Windows.Forms.DataGridViewImageColumn colFactorDelete; + private System.Windows.Forms.DataGridViewTextBoxColumn colFactorCode; + private System.Windows.Forms.DataGridViewTextBoxColumn colFactorName; + private System.Windows.Forms.DataGridViewTextBoxColumn colFactorAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn colFactorUnitPrice; + private System.Windows.Forms.DataGridViewTextBoxColumn colFactorTotalPrice; + private System.Windows.Forms.TabPage tabProduct; + private System.Windows.Forms.TabPage tabCustomer; + private System.Windows.Forms.TabPage tabReport; + private System.Windows.Forms.TabPage tabUsers; + private System.Windows.Forms.DataGridView dgvUsers; + private System.Windows.Forms.TextBox txtUserCodeAdmin; + private System.Windows.Forms.TextBox txtUserNameAdmin; + private System.Windows.Forms.TextBox txtUserPasswordAdmin; + private System.Windows.Forms.Label lblUserCodeAdmin; + private System.Windows.Forms.Label lblUserNameAdmin; + private System.Windows.Forms.Label lblUserPasswordAdmin; + private System.Windows.Forms.Button btnAddUser; + private System.Windows.Forms.Button btnUpdateUser; + private System.Windows.Forms.Button btnDeleteUser; + private System.Windows.Forms.GroupBox grpSearch; + private System.Windows.Forms.TextBox txtSearchProductName; + private System.Windows.Forms.TextBox txtSearchProductCode; + private System.Windows.Forms.Label lblSearchProductName; + private System.Windows.Forms.Label lblSearchProductCode; + private System.Windows.Forms.DataGridView dgvGoods; + private System.Windows.Forms.GroupBox grpProductInfo; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnShowBuyForm; + private System.Windows.Forms.Button btnClear; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.Button btnEdit; + private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.TextBox txtStock; + private System.Windows.Forms.TextBox txtUnitPrice; + private System.Windows.Forms.TextBox txtGoodsName; + private System.Windows.Forms.TextBox txtGoodsCode; + private System.Windows.Forms.Label lblStock; + private System.Windows.Forms.Label lblUnitPrice; + private System.Windows.Forms.Label lblProductName; + private System.Windows.Forms.Label lblProductCode; + private System.Windows.Forms.Button btnFirst; + private System.Windows.Forms.Button btnPrevious; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnLast; + private MyShopDataSet myShopDataSet; + private MyShopDataSetTableAdapters.GoodsTableAdapter goodsTableAdapter; + private MyShopDataSetTableAdapters.TableAdapterManager tableAdapterManager; + private System.Windows.Forms.DataGridViewTextBoxColumn goodsCodeDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn goodsNameDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn goodsUnitPriceDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn goodsStockDataGridViewTextBoxColumn; + private MyShopDataSet myShopDataSet1; + private System.Windows.Forms.BindingSource goodsBindingSource; + private MyShopDataSetTableAdapters.GoodsTableAdapter goodsTableAdapter1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; + private System.Windows.Forms.GroupBox grpCustomerInfo; + private System.Windows.Forms.Button btnCancelCustomer; + private System.Windows.Forms.Button btnShowBuyFormCustomer; + private System.Windows.Forms.Button btnClearCustomer; + private System.Windows.Forms.Button btnSaveCustomer; + private System.Windows.Forms.Button btnDeleteCustomer; + private System.Windows.Forms.Button btnEditCustomer; + private System.Windows.Forms.TextBox txtCustomerMobile; + private System.Windows.Forms.TextBox txtCustomerLastName; + private System.Windows.Forms.TextBox txtCustomerFirstName; + private System.Windows.Forms.TextBox txtCustomerCode; + private System.Windows.Forms.Label lblCustomerMobile; + private System.Windows.Forms.Label lblCustomerLastName; + private System.Windows.Forms.Label lblCustomerFirstName; + private System.Windows.Forms.Label lblCustomerCode; + private System.Windows.Forms.DataGridView dgvCustomers; + private System.Windows.Forms.DataGridViewTextBoxColumn colCustomerCode; + private System.Windows.Forms.DataGridViewTextBoxColumn colCustomerFirstName; + private System.Windows.Forms.DataGridViewTextBoxColumn colCustomerLastName; + private System.Windows.Forms.DataGridViewTextBoxColumn colCustomerMobile; + private System.Windows.Forms.BindingSource customersBindingSource; + private System.Windows.Forms.GroupBox grpCustomerSearch; + private System.Windows.Forms.TextBox txtSearchCustomerName; + private System.Windows.Forms.TextBox txtSearchCustomerCode; + private System.Windows.Forms.Label lblSearchCustomerName; + private System.Windows.Forms.Label lblSearchCustomerCode; + private MyShopDataSetTableAdapters.CustomersTableAdapter customersTableAdapter1; + } +} + diff --git a/MyShop/MainForm.cs b/MyShop/MainForm.cs new file mode 100644 index 0000000..afecf47 --- /dev/null +++ b/MyShop/MainForm.cs @@ -0,0 +1,1300 @@ +using System; +using System.Data; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +namespace MyShop +{ + public partial class MainForm : Form + { + private string currentUserName; + private bool canManageData; + private bool goodsRowSelected; + private bool customerRowSelected; + private bool adminLoginLogged; + private TextBox txtLogPath; + private Button btnReceiveLogFile; + private DataGridView dgvLibraryMembers; + private DataGridView dgvLibraryBooks; + private DataTable libraryMembersTable; + private DataTable libraryBooksTable; + + public MainForm() + { + InitializeComponent(); + InitializeUsersTabTools(); + PrepareFactorGrid(); + RegisterEditorStateEvents(); + UpdateEditorButtons(); + } + + public MainForm(string userName) + : this() + { + currentUserName = userName; + } + + private void PrepareFactorGrid() + { + colFactorDelete.Image = CreateDeleteImage(); + } + + private Bitmap CreateDeleteImage() + { + Bitmap image = new Bitmap(16, 16); + + using (Graphics graphics = Graphics.FromImage(image)) + { + graphics.Clear(Color.Transparent); + + using (Pen pen = new Pen(Color.Red, 2)) + { + graphics.DrawLine(pen, 4, 4, 12, 12); + graphics.DrawLine(pen, 12, 4, 4, 12); + } + } + + return image; + } + + private void MainForm_Load(object sender, EventArgs e) + { + ApplyAccessLevel(currentUserName); + lblFactorDateValue.Text = DateTime.Now.ToString("yyyy/MM/dd"); + + // بارگذاری فهرست کالاها پس از ورود موفق کاربر + this.goodsTableAdapter1.Fill(this.myShopDataSet1.Goods); + this.customersTableAdapter1.Fill(this.myShopDataSet1.Customers); + + } + + private void ApplyAccessLevel(string userName) + { + bool isAdmin = string.Equals(userName, "admin", StringComparison.OrdinalIgnoreCase); + + canManageData = isAdmin; + UpdateEditorButtons(); + + if (isAdmin) + { + WriteAdminLoginLog(); + LoadUsers(); + } + else + { + tabMain.TabPages.Remove(tabUsers); + } + } + + private void LoadUsers() + { + MyShopDataSetTableAdapters.UsersTableAdapter usersTableAdapter = new MyShopDataSetTableAdapters.UsersTableAdapter(); + dgvUsers.DataSource = usersTableAdapter.GetData(); + } + + private void InitializeUsersTabTools() + { + Label lblLogPath; + TabControl tabLibraryInfo; + TabPage tabMembers; + TabPage tabBooks; + Button btnDeleteMember; + Button btnEditMember; + Button btnDeleteBook; + Button btnEditBookTitle; + + dgvUsers.Location = new Point(20, 38); + dgvUsers.Size = new Size(330, 84); + + txtUserCodeAdmin.Location = new Point(556, 20); + txtUserNameAdmin.Location = new Point(556, 50); + txtUserPasswordAdmin.Location = new Point(556, 80); + lblUserCodeAdmin.Location = new Point(636, 22); + lblUserNameAdmin.Location = new Point(636, 52); + lblUserPasswordAdmin.Location = new Point(636, 82); + btnAddUser.Location = new Point(480, 112); + btnUpdateUser.Location = new Point(556, 112); + btnDeleteUser.Location = new Point(632, 112); + + lblLogPath = new Label(); + lblLogPath.Location = new Point(646, 154); + lblLogPath.Size = new Size(90, 18); + lblLogPath.Text = "مسیر ذخیره:"; + + txtLogPath = new TextBox(); + txtLogPath.Location = new Point(286, 152); + txtLogPath.Size = new Size(354, 24); + txtLogPath.RightToLeft = RightToLeft.No; + + btnReceiveLogFile = new Button(); + btnReceiveLogFile.Location = new Point(180, 150); + btnReceiveLogFile.Size = new Size(100, 26); + btnReceiveLogFile.Text = "دریافت پرونده"; + btnReceiveLogFile.UseVisualStyleBackColor = true; + btnReceiveLogFile.Click += new EventHandler(btnReceiveLogFile_Click); + + tabLibraryInfo = new TabControl(); + tabLibraryInfo.Location = new Point(20, 182); + tabLibraryInfo.Size = new Size(720, 104); + tabLibraryInfo.RightToLeft = RightToLeft.Yes; + tabLibraryInfo.RightToLeftLayout = true; + + tabMembers = new TabPage(); + tabMembers.Text = "اعضا"; + tabMembers.UseVisualStyleBackColor = true; + + tabBooks = new TabPage(); + tabBooks.Text = "کتاب‌ها"; + tabBooks.UseVisualStyleBackColor = true; + + dgvLibraryMembers = CreateLibraryGrid(); + btnEditMember = CreateSmallUserTabButton("ویرایش", new Point(548, 10), btnEditMember_Click); + btnDeleteMember = CreateSmallUserTabButton("حذف", new Point(624, 10), btnDeleteMember_Click); + + dgvLibraryBooks = CreateLibraryGrid(); + btnEditBookTitle = CreateSmallUserTabButton("ویرایش", new Point(548, 10), btnEditBookTitle_Click); + btnDeleteBook = CreateSmallUserTabButton("حذف", new Point(624, 10), btnDeleteBook_Click); + + tabMembers.Controls.Add(dgvLibraryMembers); + tabMembers.Controls.Add(btnEditMember); + tabMembers.Controls.Add(btnDeleteMember); + tabBooks.Controls.Add(dgvLibraryBooks); + tabBooks.Controls.Add(btnEditBookTitle); + tabBooks.Controls.Add(btnDeleteBook); + tabLibraryInfo.TabPages.Add(tabMembers); + tabLibraryInfo.TabPages.Add(tabBooks); + + tabUsers.Controls.Add(lblLogPath); + tabUsers.Controls.Add(txtLogPath); + tabUsers.Controls.Add(btnReceiveLogFile); + tabUsers.Controls.Add(tabLibraryInfo); + + FillLibrarySampleData(); + } + + private DataGridView CreateLibraryGrid() + { + DataGridView grid = new DataGridView(); + + grid.AllowUserToAddRows = false; + grid.AllowUserToDeleteRows = false; + grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + grid.BackgroundColor = Color.White; + grid.Location = new Point(8, 8); + grid.ReadOnly = false; + grid.RightToLeft = RightToLeft.Yes; + grid.RowHeadersWidth = 24; + grid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + grid.Size = new Size(520, 62); + + return grid; + } + + private Button CreateSmallUserTabButton(string text, Point location, EventHandler clickHandler) + { + Button button = new Button(); + + button.Location = location; + button.Size = new Size(70, 26); + button.Text = text; + button.UseVisualStyleBackColor = true; + button.Click += clickHandler; + + return button; + } + + private void FillLibrarySampleData() + { + libraryMembersTable = new DataTable(); + libraryMembersTable.Columns.Add("کد عضو"); + libraryMembersTable.Columns.Add("نام"); + libraryMembersTable.Columns.Add("نام خانوادگی"); + libraryMembersTable.Columns.Add("موبایل"); + libraryMembersTable.Rows.Add("1", "رضا", "احمدی", "09120000001"); + libraryMembersTable.Rows.Add("2", "مریم", "کریمی", "09120000002"); + dgvLibraryMembers.DataSource = libraryMembersTable; + + libraryBooksTable = new DataTable(); + libraryBooksTable.Columns.Add("کد کتاب"); + libraryBooksTable.Columns.Add("عنوان کتاب"); + libraryBooksTable.Columns.Add("نویسنده"); + libraryBooksTable.Rows.Add("1", "آموزش سی شارپ", "جعفری"); + libraryBooksTable.Rows.Add("2", "پایگاه داده Access", "محمدی"); + dgvLibraryBooks.DataSource = libraryBooksTable; + } + + private void WriteAdminLoginLog() + { + string logPath; + string logText; + + if (adminLoginLogged) + { + return; + } + + logPath = GetApplicationLogPath(); + logText = "ورود مدیر: " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + Environment.NewLine; + + try + { + File.AppendAllText(logPath, logText, System.Text.Encoding.UTF8); + adminLoginLogged = true; + } + catch + { + MessageBox.Show("خطا در ثبت زمان ورود مدیر در پرونده Log.txt", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private string GetApplicationLogPath() + { + return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log.txt"); + } + + private void btnReceiveLogFile_Click(object sender, EventArgs e) + { + string destinationPath; + string sourcePath; + string targetPath; + + destinationPath = txtLogPath.Text.Trim(); + + if (destinationPath.Length == 0) + { + MessageBox.Show("مسیر ذخیره پرونده را وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + sourcePath = GetApplicationLogPath(); + targetPath = destinationPath; + + try + { + if (Path.GetExtension(targetPath).Length == 0) + { + if (!Directory.Exists(targetPath)) + { + Directory.CreateDirectory(targetPath); + } + + targetPath = Path.Combine(targetPath, "Log.txt"); + } + + if (!File.Exists(sourcePath)) + { + File.WriteAllText(sourcePath, "", System.Text.Encoding.UTF8); + } + + File.Copy(sourcePath, targetPath, true); + MessageBox.Show("پرونده Log.txt با موفقیت ذخیره شد."); + } + catch + { + MessageBox.Show("خطا در ذخیره پرونده Log.txt", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnEditMember_Click(object sender, EventArgs e) + { + BeginGridEdit(dgvLibraryMembers); + } + + private void btnDeleteMember_Click(object sender, EventArgs e) + { + DeleteSelectedGridRow(dgvLibraryMembers); + } + + private void btnEditBookTitle_Click(object sender, EventArgs e) + { + if (dgvLibraryBooks.CurrentRow != null && dgvLibraryBooks.Columns.Contains("عنوان کتاب")) + { + dgvLibraryBooks.CurrentCell = dgvLibraryBooks.CurrentRow.Cells["عنوان کتاب"]; + } + + BeginGridEdit(dgvLibraryBooks); + } + + private void btnDeleteBook_Click(object sender, EventArgs e) + { + DeleteSelectedGridRow(dgvLibraryBooks); + } + + private void BeginGridEdit(DataGridView grid) + { + if (grid.CurrentCell == null) + { + MessageBox.Show("ابتدا یک ردیف را انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + grid.Focus(); + grid.BeginEdit(true); + } + + private void DeleteSelectedGridRow(DataGridView grid) + { + DataRowView rowView; + + if (grid.CurrentRow == null) + { + MessageBox.Show("ابتدا یک ردیف را انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + rowView = grid.CurrentRow.DataBoundItem as DataRowView; + + if (rowView != null) + { + rowView.Delete(); + } + } + + private void RegisterEditorStateEvents() + { + txtGoodsCode.TextChanged += new EventHandler(EditorTextChanged); + txtGoodsName.TextChanged += new EventHandler(EditorTextChanged); + txtUnitPrice.TextChanged += new EventHandler(EditorTextChanged); + txtStock.TextChanged += new EventHandler(EditorTextChanged); + + txtCustomerCode.TextChanged += new EventHandler(EditorTextChanged); + txtCustomerFirstName.TextChanged += new EventHandler(EditorTextChanged); + txtCustomerLastName.TextChanged += new EventHandler(EditorTextChanged); + txtCustomerMobile.TextChanged += new EventHandler(EditorTextChanged); + } + + private void EditorTextChanged(object sender, EventArgs e) + { + UpdateEditorButtons(); + } + + private void UpdateEditorButtons() + { + bool goodsComplete = txtGoodsCode.Text.Length > 0 && + txtGoodsName.Text.Length > 0 && + txtUnitPrice.Text.Length > 0 && + txtStock.Text.Length > 0; + + bool customerComplete = txtCustomerCode.Text.Length > 0 && + txtCustomerFirstName.Text.Length > 0 && + txtCustomerLastName.Text.Length > 0 && + txtCustomerMobile.Text.Length > 0; + + btnSave.Enabled = canManageData && goodsComplete; + btnEdit.Enabled = canManageData && goodsRowSelected; + btnDelete.Enabled = canManageData && goodsRowSelected; + + btnSaveCustomer.Enabled = canManageData && customerComplete; + btnEditCustomer.Enabled = canManageData && customerRowSelected; + btnDeleteCustomer.Enabled = canManageData && customerRowSelected; + } + + private void btnLast_Click(object sender, EventArgs e) + { + goodsBindingSource.MoveFirst(); + } + + private void btnNext_Click(object sender, EventArgs e) + { + goodsBindingSource.MovePrevious(); + } + + private void btnPrevious_Click(object sender, EventArgs e) + { + goodsBindingSource.MoveNext(); + } + + private void btnFirst_Click(object sender, EventArgs e) + { + goodsBindingSource.MoveLast(); + } + + private void dgvProducts_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (dgvGoods.CurrentCell == null) + { + return; + } + + int index = dgvGoods.CurrentCell.RowIndex; + + txtGoodsCode.Text = dgvGoods.Rows[index].Cells[0].Value.ToString(); + txtGoodsName.Text = dgvGoods.Rows[index].Cells[1].Value.ToString(); + txtUnitPrice.Text = dgvGoods.Rows[index].Cells[2].Value.ToString(); + txtStock.Text = dgvGoods.Rows[index].Cells[3].Value.ToString(); + goodsRowSelected = true; + UpdateEditorButtons(); + } + + private void btnAddGoods_Click(object sender, EventArgs e) + { + int goodsCode; + int unitPrice; + int stock; + + if (txtGoodsCode.Text.Length == 0 || txtGoodsName.Text.Length == 0 || txtUnitPrice.Text.Length == 0) + { + MessageBox.Show("اطلاعات کالا را کامل وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (!int.TryParse(txtGoodsCode.Text, out goodsCode) || + !int.TryParse(txtUnitPrice.Text, out unitPrice) || + !int.TryParse(txtStock.Text, out stock)) + { + MessageBox.Show("کد کالا، قیمت واحد و موجودی باید عددی باشند.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + goodsTableAdapter1.InsertQuery(goodsCode, txtGoodsName.Text, unitPrice, stock); + goodsTableAdapter1.Fill(myShopDataSet1.Goods); + goodsRowSelected = false; + UpdateEditorButtons(); + MessageBox.Show("با موفقیت ثبت شد."); + } + catch + { + MessageBox.Show("خطا در ثبت کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnDeleteGoods_Click(object sender, EventArgs e) + { + int goodsCode; + + if (txtGoodsCode.Text.Length == 0) + { + MessageBox.Show("کد کالا را وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (!int.TryParse(txtGoodsCode.Text, out goodsCode)) + { + MessageBox.Show("کد کالا باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + goodsTableAdapter1.DeleteQuery(goodsCode); + goodsTableAdapter1.Fill(myShopDataSet1.Goods); + ClearGoodsFields(); + MessageBox.Show("با موفقیت حذف شد."); + } + catch + { + MessageBox.Show("خطا در حذف کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnUpdateGoods_Click(object sender, EventArgs e) + { + int goodsCode; + int unitPrice; + int stock; + + if (txtGoodsCode.Text.Length == 0 || txtGoodsName.Text.Length == 0 || txtUnitPrice.Text.Length == 0) + { + MessageBox.Show("اطلاعات کالا را کامل وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (!int.TryParse(txtGoodsCode.Text, out goodsCode) || + !int.TryParse(txtUnitPrice.Text, out unitPrice) || + !int.TryParse(txtStock.Text, out stock)) + { + MessageBox.Show("کد کالا، قیمت واحد و موجودی باید عددی باشند.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + goodsTableAdapter1.UpdateQuery(txtGoodsName.Text, unitPrice, stock, goodsCode); + goodsTableAdapter1.Fill(myShopDataSet1.Goods); + goodsRowSelected = false; + UpdateEditorButtons(); + MessageBox.Show("با موفقیت ویرایش شد."); + } + catch + { + MessageBox.Show("خطا در ویرایش کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void txtFGoodsCode_KeyDown(object sender, KeyEventArgs e) + { + lblPrice.Text = ""; + lblGoodsName.Text = ""; + lblFStockValue.Text = ""; + + if (e.KeyCode == Keys.Enter) + { + FillSelectedGoodsInfo(); + } + } + + private void FillSelectedGoodsInfo() + { + int goodsCode; + MyShopDataSet.GoodsDataTable goodsTable = new MyShopDataSet.GoodsDataTable(); + + if (txtFGoodsCode.Text.Length == 0) + { + return; + } + + if (!int.TryParse(txtFGoodsCode.Text, out goodsCode)) + { + MessageBox.Show("کد کالا باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFGoodsCode.Focus(); + return; + } + + try + { + goodsTableAdapter1.FillByGoodsCode(goodsTable, goodsCode); + + if (goodsTable.Rows.Count > 0) + { + lblGoodsName.Text = goodsTable.Rows[0]["GoodsName"].ToString(); + lblPrice.Text = goodsTable.Rows[0]["GoodsUnitPrice"].ToString(); + lblFStockValue.Text = goodsTable.Rows[0]["GoodsStock"].ToString(); + txtFAmount.Focus(); + } + else + { + MessageBox.Show("کالایی با این کد پیدا نشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFGoodsCode.Focus(); + } + } + catch + { + MessageBox.Show("خطا در جستجوی کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnFindGoods_Click(object sender, EventArgs e) + { + Form dialog = CreateSelectDialog("انتخاب کالا"); + DataGridView grid = CreateSelectGrid(); + Button btnSelect = CreateSelectButton(); + + grid.Columns.Add(CreateTextColumn("GoodsCode", "GoodsCode", "کد کالا")); + grid.Columns.Add(CreateTextColumn("GoodsName", "GoodsName", "نام کالا")); + grid.Columns.Add(CreateTextColumn("GoodsUnitPrice", "GoodsUnitPrice", "قیمت واحد")); + grid.Columns.Add(CreateTextColumn("GoodsStock", "GoodsStock", "موجودی")); + + try + { + grid.DataSource = goodsTableAdapter1.GetData(); + } + catch + { + MessageBox.Show("خطا در دریافت فهرست کالاها", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + btnSelect.Click += delegate + { + if (grid.CurrentRow == null) + { + MessageBox.Show("ابتدا یک کالا را انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + txtFGoodsCode.Text = Convert.ToString(grid.CurrentRow.Cells["GoodsCode"].Value); + FillSelectedGoodsInfo(); + dialog.DialogResult = DialogResult.OK; + dialog.Close(); + }; + + dialog.Controls.Add(grid); + dialog.Controls.Add(btnSelect); + dialog.ShowDialog(this); + } + + private void btnFindCustomer_Click(object sender, EventArgs e) + { + Form dialog = CreateSelectDialog("انتخاب مشتری"); + DataGridView grid = CreateSelectGrid(); + Button btnSelect = CreateSelectButton(); + + grid.Columns.Add(CreateTextColumn("CustomerCode", "CustomerCode", "کد مشتری")); + grid.Columns.Add(CreateTextColumn("CustomerFirstName", "CustomerFirstName", "نام")); + grid.Columns.Add(CreateTextColumn("CustomerLastName", "CustomerLastName", "نام خانوادگی")); + grid.Columns.Add(CreateTextColumn("CustomerMobile", "CustomerMobile", "موبایل")); + + try + { + grid.DataSource = customersTableAdapter1.GetData(); + } + catch + { + MessageBox.Show("خطا در دریافت فهرست مشتری‌ها", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + btnSelect.Click += delegate + { + string firstName; + string lastName; + + if (grid.CurrentRow == null) + { + MessageBox.Show("ابتدا یک مشتری را انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + firstName = Convert.ToString(grid.CurrentRow.Cells["CustomerFirstName"].Value); + lastName = Convert.ToString(grid.CurrentRow.Cells["CustomerLastName"].Value); + + txtFCustomerCode.Text = Convert.ToString(grid.CurrentRow.Cells["CustomerCode"].Value); + lblFCustomerName.Text = firstName + " " + lastName; + lblFCustomerMobile.Text = Convert.ToString(grid.CurrentRow.Cells["CustomerMobile"].Value); + txtFGoodsCode.Focus(); + dialog.DialogResult = DialogResult.OK; + dialog.Close(); + }; + + dialog.Controls.Add(grid); + dialog.Controls.Add(btnSelect); + dialog.ShowDialog(this); + } + + private Form CreateSelectDialog(string title) + { + Form dialog = new Form(); + + dialog.Text = title; + dialog.Font = new Font("Tahoma", 8.25F); + dialog.StartPosition = FormStartPosition.CenterParent; + dialog.FormBorderStyle = FormBorderStyle.FixedDialog; + dialog.MaximizeBox = false; + dialog.MinimizeBox = false; + dialog.ClientSize = new Size(560, 360); + dialog.RightToLeft = RightToLeft.Yes; + + return dialog; + } + + private DataGridView CreateSelectGrid() + { + DataGridView grid = new DataGridView(); + + grid.AllowUserToAddRows = false; + grid.AllowUserToDeleteRows = false; + grid.AutoGenerateColumns = false; + grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + grid.BackgroundColor = Color.White; + grid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + grid.Location = new Point(12, 12); + grid.Name = "dgvSelect"; + grid.ReadOnly = true; + grid.RightToLeft = RightToLeft.Yes; + grid.RowHeadersWidth = 24; + grid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + grid.Size = new Size(536, 284); + + return grid; + } + + private Button CreateSelectButton() + { + Button button = new Button(); + + button.Location = new Point(12, 306); + button.Name = "btnSelect"; + button.Size = new Size(536, 42); + button.Text = "انتخاب"; + button.UseVisualStyleBackColor = true; + + return button; + } + + private DataGridViewTextBoxColumn CreateTextColumn(string name, string dataPropertyName, string headerText) + { + DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn(); + + column.Name = name; + column.DataPropertyName = dataPropertyName; + column.HeaderText = headerText; + column.ReadOnly = true; + + return column; + } + + private void btnInsertGoodsFactor_Click(object sender, EventArgs e) + { + tabMain.SelectedTab = tabBuy; + txtFGoodsCode.Text = txtGoodsCode.Text; + lblGoodsName.Text = txtGoodsName.Text; + lblPrice.Text = txtUnitPrice.Text; + lblFStockValue.Text = txtStock.Text; + txtFAmount.Focus(); + } + + private void btnClearGoods_Click(object sender, EventArgs e) + { + ClearGoodsFields(); + } + + private void ClearGoodsFields() + { + txtGoodsCode.Text = ""; + txtGoodsName.Text = ""; + txtUnitPrice.Text = ""; + txtStock.Text = ""; + goodsRowSelected = false; + UpdateEditorButtons(); + } + + private void btnInsertGoods_Click(object sender, EventArgs e) + { + int amount; + int price; + int rowIndex; + + if (txtFGoodsCode.Text.Length == 0) + { + MessageBox.Show("کد کالا را وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFGoodsCode.Focus(); + return; + } + + if (lblGoodsName.Text.Length == 0 || lblPrice.Text.Length == 0) + { + FillSelectedGoodsInfo(); + } + + if (lblGoodsName.Text.Length == 0 || lblPrice.Text.Length == 0) + { + return; + } + + if (!int.TryParse(txtFAmount.Text, out amount) || amount <= 0) + { + MessageBox.Show("تعداد کالا را درست وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFAmount.Focus(); + return; + } + + if (!int.TryParse(lblPrice.Text, out price)) + { + MessageBox.Show("قیمت کالا درست نیست.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + rowIndex = dgvFactors.Rows.Add(); + dgvFactors.Rows[rowIndex].Cells["colFactorCode"].Value = txtFGoodsCode.Text; + dgvFactors.Rows[rowIndex].Cells["colFactorName"].Value = lblGoodsName.Text; + dgvFactors.Rows[rowIndex].Cells["colFactorAmount"].Value = amount; + dgvFactors.Rows[rowIndex].Cells["colFactorUnitPrice"].Value = price; + dgvFactors.Rows[rowIndex].Cells["colFactorTotalPrice"].Value = amount * price; + + CalculateFactorTotal(); + } + + private void txtFCustomerCode_KeyDown(object sender, KeyEventArgs e) + { + lblFCustomerName.Text = ""; + lblFCustomerMobile.Text = ""; + + if (e.KeyCode == Keys.Enter) + { + FillSelectedCustomerInfo(); + } + } + + private void FillSelectedCustomerInfo() + { + int customerCode; + MyShopDataSet.CustomersDataTable customersTable = new MyShopDataSet.CustomersDataTable(); + MyShopDataSetTableAdapters.CustomersTableAdapter customersTableAdapter = new MyShopDataSetTableAdapters.CustomersTableAdapter(); + + if (txtFCustomerCode.Text.Length == 0) + { + return; + } + + if (!int.TryParse(txtFCustomerCode.Text, out customerCode)) + { + MessageBox.Show("کد مشتری باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFCustomerCode.Focus(); + return; + } + + try + { + customersTableAdapter.FillByCustomerCode(customersTable, customerCode); + + if (customersTable.Rows.Count > 0) + { + lblFCustomerName.Text = customersTable.Rows[0]["CustomerFirstName"].ToString() + " " + + customersTable.Rows[0]["CustomerLastName"].ToString(); + lblFCustomerMobile.Text = customersTable.Rows[0]["CustomerMobile"].ToString(); + txtFGoodsCode.Focus(); + } + else + { + MessageBox.Show("مشتری با این کد پیدا نشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFCustomerCode.Focus(); + } + } + catch + { + MessageBox.Show("خطا در جستجوی مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnSaveFactor_Click(object sender, EventArgs e) + { + int customerCode; + int factorCode; + int i; + MyShopDataSetTableAdapters.FactorsTableAdapter factorsTableAdapter = new MyShopDataSetTableAdapters.FactorsTableAdapter(); + MyShopDataSetTableAdapters.FactorItemsTableAdapter factorItemsTableAdapter = new MyShopDataSetTableAdapters.FactorItemsTableAdapter(); + + if (!int.TryParse(txtFCustomerCode.Text, out customerCode)) + { + MessageBox.Show("کد مشتری را درست وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + txtFCustomerCode.Focus(); + return; + } + + if (dgvFactors.Rows.Count == 0) + { + MessageBox.Show("سبد خرید خالی است.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + factorCode = factorsTableAdapter.InsertQuery(customerCode, DateTime.Now); + + for (i = 0; i < dgvFactors.Rows.Count; i++) + { + factorItemsTableAdapter.InsertQuery( + factorCode, + ToInt(dgvFactors.Rows[i].Cells["colFactorCode"].Value), + ToInt(dgvFactors.Rows[i].Cells["colFactorAmount"].Value)); + } + + dgvFactors.Rows.Clear(); + CalculateFactorTotal(); + MessageBox.Show("برگه خرید با موفقیت ثبت شد."); + } + catch + { + MessageBox.Show("خطا در ثبت برگه خرید", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void txtSearchProductCode_KeyDown(object sender, KeyEventArgs e) + { + int goodsCode; + + if (e.KeyCode != Keys.Enter) + { + return; + } + + if (!int.TryParse(txtSearchProductCode.Text, out goodsCode)) + { + MessageBox.Show("کد کالا باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + goodsTableAdapter1.FillByGoodsCode(myShopDataSet1.Goods, goodsCode); + } + catch + { + MessageBox.Show("خطا در جستجوی کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void txtSearchProductName_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode != Keys.Enter) + { + return; + } + + try + { + if (txtSearchProductName.Text.Length == 0) + { + goodsTableAdapter1.Fill(myShopDataSet1.Goods); + } + else + { + goodsTableAdapter1.FillByGoodsName(myShopDataSet1.Goods, txtSearchProductName.Text); + } + } + catch + { + MessageBox.Show("خطا در جستجوی کالا", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void dgvCustomers_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < 0) + { + return; + } + + txtCustomerCode.Text = Convert.ToString(dgvCustomers.Rows[e.RowIndex].Cells["colCustomerCode"].Value); + txtCustomerFirstName.Text = Convert.ToString(dgvCustomers.Rows[e.RowIndex].Cells["colCustomerFirstName"].Value); + txtCustomerLastName.Text = Convert.ToString(dgvCustomers.Rows[e.RowIndex].Cells["colCustomerLastName"].Value); + txtCustomerMobile.Text = Convert.ToString(dgvCustomers.Rows[e.RowIndex].Cells["colCustomerMobile"].Value); + customerRowSelected = true; + UpdateEditorButtons(); + } + + private void btnAddCustomer_Click(object sender, EventArgs e) + { + if (txtCustomerFirstName.Text.Length == 0 || txtCustomerLastName.Text.Length == 0 || txtCustomerMobile.Text.Length == 0) + { + MessageBox.Show("اطلاعات مشتری را کامل وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + customersTableAdapter1.InsertCustomerQuery(txtCustomerFirstName.Text, txtCustomerLastName.Text, txtCustomerMobile.Text); + customersTableAdapter1.Fill(myShopDataSet1.Customers); + customerRowSelected = false; + UpdateEditorButtons(); + MessageBox.Show("مشتری با موفقیت ثبت شد."); + } + catch + { + MessageBox.Show("خطا در ثبت مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnUpdateCustomer_Click(object sender, EventArgs e) + { + int customerCode; + + if (txtCustomerCode.Text.Length == 0 || txtCustomerFirstName.Text.Length == 0 || + txtCustomerLastName.Text.Length == 0 || txtCustomerMobile.Text.Length == 0) + { + MessageBox.Show("اطلاعات مشتری را کامل وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (!int.TryParse(txtCustomerCode.Text, out customerCode)) + { + MessageBox.Show("کد مشتری باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + customersTableAdapter1.UpdateCustomerQuery(txtCustomerFirstName.Text, txtCustomerLastName.Text, txtCustomerMobile.Text, customerCode); + customersTableAdapter1.Fill(myShopDataSet1.Customers); + customerRowSelected = false; + UpdateEditorButtons(); + MessageBox.Show("مشتری با موفقیت ویرایش شد."); + } + catch + { + MessageBox.Show("خطا در ویرایش مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnDeleteCustomer_Click(object sender, EventArgs e) + { + int customerCode; + + if (!int.TryParse(txtCustomerCode.Text, out customerCode)) + { + MessageBox.Show("کد مشتری را درست وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + customersTableAdapter1.DeleteCustomerQuery(customerCode); + customersTableAdapter1.Fill(myShopDataSet1.Customers); + ClearCustomerFields(); + MessageBox.Show("مشتری با موفقیت حذف شد."); + } + catch + { + MessageBox.Show("خطا در حذف مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnClearCustomer_Click(object sender, EventArgs e) + { + ClearCustomerFields(); + } + + private void ClearCustomerFields() + { + txtCustomerCode.Text = ""; + txtCustomerFirstName.Text = ""; + txtCustomerLastName.Text = ""; + txtCustomerMobile.Text = ""; + customerRowSelected = false; + UpdateEditorButtons(); + } + + private void btnShowBuyFormCustomer_Click(object sender, EventArgs e) + { + tabMain.SelectedTab = tabBuy; + txtFCustomerCode.Text = txtCustomerCode.Text; + lblFCustomerName.Text = txtCustomerFirstName.Text + " " + txtCustomerLastName.Text; + lblFCustomerMobile.Text = txtCustomerMobile.Text; + txtFGoodsCode.Focus(); + } + + private void txtSearchCustomerCode_KeyDown(object sender, KeyEventArgs e) + { + int customerCode; + + if (e.KeyCode != Keys.Enter) + { + return; + } + + if (!int.TryParse(txtSearchCustomerCode.Text, out customerCode)) + { + MessageBox.Show("کد مشتری باید عددی باشد.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + customersTableAdapter1.FillByCustomerCode(myShopDataSet1.Customers, customerCode); + } + catch + { + MessageBox.Show("خطا در جستجوی مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void txtSearchCustomerName_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode != Keys.Enter) + { + return; + } + + try + { + if (txtSearchCustomerName.Text.Length == 0) + { + customersTableAdapter1.Fill(myShopDataSet1.Customers); + } + else + { + customersTableAdapter1.FillByCustomerName(myShopDataSet1.Customers, txtSearchCustomerName.Text); + } + } + catch + { + MessageBox.Show("خطا در جستجوی مشتری", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void dgvFactors_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex >= 0 && e.ColumnIndex >= 0 && dgvFactors.Columns[e.ColumnIndex] is DataGridViewImageColumn) + { + dgvFactors.Rows.RemoveAt(e.RowIndex); + CalculateFactorTotal(); + } + } + + private void btnClearFactor_Click(object sender, EventArgs e) + { + dgvFactors.Rows.Clear(); + CalculateFactorTotal(); + } + + private void CalculateFactorTotal() + { + int total = 0; + int i; + + for (i = 0; i < dgvFactors.Rows.Count; i++) + { + total += ToInt(dgvFactors.Rows[i].Cells["colFactorTotalPrice"].Value); + } + + lblFTotalValue.Text = total.ToString(); + } + + private int ToInt(object value) + { + int result; + + if (value == null) + { + return 0; + } + + if (int.TryParse(value.ToString(), out result)) + { + return result; + } + + return 0; + } + + private void dgvUsers_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < 0) + { + return; + } + + txtUserCodeAdmin.Text = Convert.ToString(dgvUsers.Rows[e.RowIndex].Cells["UserCode"].Value); + txtUserNameAdmin.Text = Convert.ToString(dgvUsers.Rows[e.RowIndex].Cells["Username"].Value); + txtUserPasswordAdmin.Text = Convert.ToString(dgvUsers.Rows[e.RowIndex].Cells["Password"].Value); + } + + private void btnAddUser_Click(object sender, EventArgs e) + { + MyShopDataSetTableAdapters.UsersTableAdapter usersTableAdapter = new MyShopDataSetTableAdapters.UsersTableAdapter(); + + if (txtUserNameAdmin.Text.Length == 0 || txtUserPasswordAdmin.Text.Length == 0) + { + MessageBox.Show("نام کاربری و گذرواژه را وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + usersTableAdapter.InsertUserQuery(txtUserNameAdmin.Text, txtUserPasswordAdmin.Text); + LoadUsers(); + MessageBox.Show("کاربر با موفقیت ثبت شد."); + } + catch + { + MessageBox.Show("خطا در ثبت کاربر", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnUpdateUser_Click(object sender, EventArgs e) + { + int userCode; + MyShopDataSetTableAdapters.UsersTableAdapter usersTableAdapter = new MyShopDataSetTableAdapters.UsersTableAdapter(); + + if (!int.TryParse(txtUserCodeAdmin.Text, out userCode)) + { + MessageBox.Show("کاربر را از جدول انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (txtUserNameAdmin.Text.Length == 0 || txtUserPasswordAdmin.Text.Length == 0) + { + MessageBox.Show("نام کاربری و گذرواژه را وارد کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + usersTableAdapter.UpdateUserQuery(txtUserNameAdmin.Text, txtUserPasswordAdmin.Text, userCode); + LoadUsers(); + MessageBox.Show("کاربر با موفقیت ویرایش شد."); + } + catch + { + MessageBox.Show("خطا در ویرایش کاربر", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void btnDeleteUser_Click(object sender, EventArgs e) + { + int userCode; + MyShopDataSetTableAdapters.UsersTableAdapter usersTableAdapter = new MyShopDataSetTableAdapters.UsersTableAdapter(); + + if (!int.TryParse(txtUserCodeAdmin.Text, out userCode)) + { + MessageBox.Show("کاربر را از جدول انتخاب کنید.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + usersTableAdapter.DeleteUserQuery(userCode); + LoadUsers(); + MessageBox.Show("کاربر با موفقیت حذف شد."); + } + catch + { + MessageBox.Show("خطا در حذف کاربر", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void goodsBindingNavigatorSaveItem_Click(object sender, EventArgs e) + { + + } + + private void MainForm_FormClosed(object sender, FormClosedEventArgs e) + { + Application.Exit(); + } + + private bool CheckCustomerFormValid() + { + int CustomerCode, CustomerMobile; + if (txtCustomerCode.Text.Length <= 0 || !int.TryParse(txtCustomerCode.Text, out CustomerCode)) + return false; + if (txtCustomerMobile.Text.Length <= 0 || !int.TryParse(txtCustomerMobile.Text, out CustomerMobile)) + return false; + if (txtCustomerFirstName.Text.Length <= 0) + return false; + if (txtCustomerLastName.Text.Length <= 0) + return false; + return true; + } + + private void SetCustomerInputVisibility() + { + if (CheckCustomerFormValid()) + { + btnSaveCustomer.Enabled = true; + } + else + { + btnSaveCustomer.Enabled = false; + } + } + + private void txtCustomerCode_TextChanged(object sender, EventArgs e) + { + SetCustomerInputVisibility(); + } + + private void txtCustomerFirstName_TextChanged(object sender, EventArgs e) + { + SetCustomerInputVisibility(); + } + + private void txtCustomerLastName_TextChanged(object sender, EventArgs e) + { + SetCustomerInputVisibility(); + } + + private void txtCustomerMobile_TextChanged(object sender, EventArgs e) + { + SetCustomerInputVisibility(); + } + + private void lblFCustomerCode_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/MyShop/MainForm.resx b/MyShop/MainForm.resx new file mode 100644 index 0000000..7550a79 --- /dev/null +++ b/MyShop/MainForm.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 642, 17 + + + 468, 17 + + + 468, 17 + + + 17, 17 + + + 17, 60 + + + 242, 17 + + \ No newline at end of file diff --git a/MyShop/MyShop.csproj b/MyShop/MyShop.csproj new file mode 100644 index 0000000..7f918e3 --- /dev/null +++ b/MyShop/MyShop.csproj @@ -0,0 +1,125 @@ + + + + + Debug + AnyCPU + {0A9689AD-3745-42B7-8187-97A99CF65480} + WinExe + Properties + MyShop + MyShop + v4.5 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + LoginForm.cs + + + Form + + + MainForm.cs + + + Component + + + True + True + MyShopDataSet1.xsd + + + + + LoginForm.cs + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + MyShopDataSet1.xsd + + + MSDataSetGenerator + MyShopDataSet1.Designer.cs + Designer + + + MyShopDataSet1.xsd + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + MyShop.mdb + PreserveNewest + + + + + + \ No newline at end of file diff --git a/MyShop/MyShop.mdb b/MyShop/MyShop.mdb new file mode 100644 index 0000000..0ab5b26 Binary files /dev/null and b/MyShop/MyShop.mdb differ diff --git a/MyShop/MyShopDataSet.Designer.cs b/MyShop/MyShopDataSet.Designer.cs new file mode 100644 index 0000000..94848d2 --- /dev/null +++ b/MyShop/MyShopDataSet.Designer.cs @@ -0,0 +1,1538 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 + +namespace MyShop { + + + /// + ///Represents a strongly typed in-memory cache of data. + /// + [global::System.Serializable()] + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] + [global::System.Xml.Serialization.XmlRootAttribute("MyShopDataSet")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] + public partial class MyShopDataSet : global::System.Data.DataSet { + + private GoodsDataTable tableGoods; + + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public MyShopDataSet() { + this.BeginInit(); + this.InitClass(); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + base.Relations.CollectionChanged += schemaChangedHandler; + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected MyShopDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context, false) { + if ((this.IsBinarySerialized(info, context) == true)) { + this.InitVars(false); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + this.Tables.CollectionChanged += schemaChangedHandler1; + this.Relations.CollectionChanged += schemaChangedHandler1; + return; + } + string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); + if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + if ((ds.Tables["Goods"] != null)) { + base.Tables.Add(new GoodsDataTable(ds.Tables["Goods"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + } + this.GetSerializationData(info, context); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + this.Relations.CollectionChanged += schemaChangedHandler; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public GoodsDataTable Goods { + get { + return this.tableGoods; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.BrowsableAttribute(true)] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] + public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { + get { + return this._schemaSerializationMode; + } + set { + this._schemaSerializationMode = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataTableCollection Tables { + get { + return base.Tables; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataRelationCollection Relations { + get { + return base.Relations; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void InitializeDerivedDataSet() { + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataSet Clone() { + MyShopDataSet cln = ((MyShopDataSet)(base.Clone())); + cln.InitVars(); + cln.SchemaSerializationMode = this.SchemaSerializationMode; + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeTables() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeRelations() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { + if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + this.Reset(); + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXml(reader); + if ((ds.Tables["Goods"] != null)) { + base.Tables.Add(new GoodsDataTable(ds.Tables["Goods"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXml(reader); + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { + global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); + this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); + stream.Position = 0; + return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.InitVars(true); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars(bool initTable) { + this.tableGoods = ((GoodsDataTable)(base.Tables["Goods"])); + if ((initTable == true)) { + if ((this.tableGoods != null)) { + this.tableGoods.InitVars(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.DataSetName = "MyShopDataSet"; + this.Prefix = ""; + this.Namespace = "http://tempuri.org/MyShopDataSet.xsd"; + this.EnforceConstraints = true; + this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + this.tableGoods = new GoodsDataTable(); + base.Tables.Add(this.tableGoods); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeGoods() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { + if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + MyShopDataSet ds = new MyShopDataSet(); + 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; + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void GoodsRowChangeEventHandler(object sender, GoodsRowChangeEvent e); + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class GoodsDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnGoodsCode; + + private global::System.Data.DataColumn columnGoodsName; + + private global::System.Data.DataColumn columnGoodsUnitPrice; + + private global::System.Data.DataColumn columnGoodsStock; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsDataTable() { + this.TableName = "Goods"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GoodsDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected GoodsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsCodeColumn { + get { + return this.columnGoodsCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsNameColumn { + get { + return this.columnGoodsName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsUnitPriceColumn { + get { + return this.columnGoodsUnitPrice; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsStockColumn { + get { + return this.columnGoodsStock; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow this[int index] { + get { + return ((GoodsRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddGoodsRow(GoodsRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow AddGoodsRow(string GoodsName, int GoodsUnitPrice, int GoodsStock) { + GoodsRow rowGoodsRow = ((GoodsRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + GoodsName, + GoodsUnitPrice, + GoodsStock}; + rowGoodsRow.ItemArray = columnValuesArray; + this.Rows.Add(rowGoodsRow); + return rowGoodsRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow FindByGoodsCode(int GoodsCode) { + return ((GoodsRow)(this.Rows.Find(new object[] { + GoodsCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + GoodsDataTable cln = ((GoodsDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new GoodsDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnGoodsCode = base.Columns["GoodsCode"]; + this.columnGoodsName = base.Columns["GoodsName"]; + this.columnGoodsUnitPrice = base.Columns["GoodsUnitPrice"]; + this.columnGoodsStock = base.Columns["GoodsStock"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnGoodsCode = new global::System.Data.DataColumn("GoodsCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsCode); + this.columnGoodsName = new global::System.Data.DataColumn("GoodsName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsName); + this.columnGoodsUnitPrice = new global::System.Data.DataColumn("GoodsUnitPrice", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsUnitPrice); + this.columnGoodsStock = new global::System.Data.DataColumn("GoodsStock", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsStock); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnGoodsCode}, true)); + this.columnGoodsCode.AutoIncrement = true; + this.columnGoodsCode.AutoIncrementSeed = -1; + this.columnGoodsCode.AutoIncrementStep = -1; + this.columnGoodsCode.AllowDBNull = false; + this.columnGoodsCode.Unique = true; + this.columnGoodsName.MaxLength = 255; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow NewGoodsRow() { + return ((GoodsRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new GoodsRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(GoodsRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.GoodsRowChanged != null)) { + this.GoodsRowChanged(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.GoodsRowChanging != null)) { + this.GoodsRowChanging(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.GoodsRowDeleted != null)) { + this.GoodsRowDeleted(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.GoodsRowDeleting != null)) { + this.GoodsRowDeleting(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveGoodsRow(GoodsRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "GoodsDataTable"; + 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; + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class GoodsRow : global::System.Data.DataRow { + + private GoodsDataTable tableGoods; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GoodsRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableGoods = ((GoodsDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsCode { + get { + return ((int)(this[this.tableGoods.GoodsCodeColumn])); + } + set { + this[this.tableGoods.GoodsCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string GoodsName { + get { + try { + return ((string)(this[this.tableGoods.GoodsNameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsName\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsNameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsUnitPrice { + get { + try { + return ((int)(this[this.tableGoods.GoodsUnitPriceColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsUnitPrice\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsUnitPriceColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsStock { + get { + try { + return ((int)(this[this.tableGoods.GoodsStockColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsStock\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsStockColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsNameNull() { + return this.IsNull(this.tableGoods.GoodsNameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsNameNull() { + this[this.tableGoods.GoodsNameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsUnitPriceNull() { + return this.IsNull(this.tableGoods.GoodsUnitPriceColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsUnitPriceNull() { + this[this.tableGoods.GoodsUnitPriceColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsStockNull() { + return this.IsNull(this.tableGoods.GoodsStockColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsStockNull() { + this[this.tableGoods.GoodsStockColumn] = global::System.Convert.DBNull; + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class GoodsRowChangeEvent : global::System.EventArgs { + + private GoodsRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRowChangeEvent(GoodsRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + } +} +namespace MyShop.MyShopDataSetTableAdapters { + + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class GoodsTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Goods"; + tableMapping.ColumnMappings.Add("GoodsCode", "GoodsCode"); + tableMapping.ColumnMappings.Add("GoodsName", "GoodsName"); + tableMapping.ColumnMappings.Add("GoodsUnitPrice", "GoodsUnitPrice"); + tableMapping.ColumnMappings.Add("GoodsStock", "GoodsStock"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = "DELETE FROM `Goods` WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL)" + + " OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitP" + + "rice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `Goods` (`GoodsName`, `GoodsUnitPrice`, `GoodsStock`) VALUES (?, ?, ?" + + ")"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = @"UPDATE `Goods` SET `GoodsName` = ?, `GoodsUnitPrice` = ?, `GoodsStock` = ? WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT GoodsCode, GoodsName, GoodsUnitPrice, GoodsStock FROM Goods"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.GoodsDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.GoodsDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.GoodsDataTable dataTable = new MyShopDataSet.GoodsDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.GoodsDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "Goods"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_GoodsCode, string Original_GoodsName, global::System.Nullable Original_GoodsUnitPrice, global::System.Nullable Original_GoodsStock) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsName == null)) { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_GoodsName)); + } + if ((Original_GoodsUnitPrice.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_GoodsUnitPrice.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value; + } + if ((Original_GoodsStock.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[6].Value = ((int)(Original_GoodsStock.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(string GoodsName, global::System.Nullable GoodsUnitPrice, global::System.Nullable GoodsStock) { + if ((GoodsName == null)) { + this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(GoodsName)); + } + if ((GoodsUnitPrice.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[1].Value = ((int)(GoodsUnitPrice.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((GoodsStock.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[2].Value = ((int)(GoodsStock.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(string GoodsName, global::System.Nullable GoodsUnitPrice, global::System.Nullable GoodsStock, int Original_GoodsCode, string Original_GoodsName, global::System.Nullable Original_GoodsUnitPrice, global::System.Nullable Original_GoodsStock) { + if ((GoodsName == null)) { + this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(GoodsName)); + } + if ((GoodsUnitPrice.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(GoodsUnitPrice.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((GoodsStock.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(GoodsStock.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsName == null)) { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_GoodsName)); + } + if ((Original_GoodsUnitPrice.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Original_GoodsUnitPrice.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; + } + if ((Original_GoodsStock.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Original_GoodsStock.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + } + + /// + ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" + + "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")] + public partial class TableAdapterManager : global::System.ComponentModel.Component { + + private UpdateOrderOption _updateOrder; + + private GoodsTableAdapter _goodsTableAdapter; + + private bool _backupDataSetBeforeUpdate; + + private global::System.Data.IDbConnection _connection; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UpdateOrderOption UpdateOrder { + get { + return this._updateOrder; + } + set { + this._updateOrder = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public GoodsTableAdapter GoodsTableAdapter { + get { + return this._goodsTableAdapter; + } + set { + this._goodsTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool BackupDataSetBeforeUpdate { + get { + return this._backupDataSetBeforeUpdate; + } + set { + this._backupDataSetBeforeUpdate = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public global::System.Data.IDbConnection Connection { + get { + if ((this._connection != null)) { + return this._connection; + } + if (((this._goodsTableAdapter != null) + && (this._goodsTableAdapter.Connection != null))) { + return this._goodsTableAdapter.Connection; + } + return null; + } + set { + this._connection = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int TableAdapterInstanceCount { + get { + int count = 0; + if ((this._goodsTableAdapter != null)) { + count = (count + 1); + } + return count; + } + } + + /// + ///Update rows in top-down order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateUpdatedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allChangedRows, global::System.Collections.Generic.List allAddedRows) { + int result = 0; + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + return result; + } + + /// + ///Insert rows in top-down order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateInsertedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allAddedRows) { + int result = 0; + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + return result; + } + + /// + ///Delete rows in bottom-up order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateDeletedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allChangedRows) { + int result = 0; + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + return result; + } + + /// + ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List allAddedRows) { + if (((updatedRows == null) + || (updatedRows.Length < 1))) { + return updatedRows; + } + if (((allAddedRows == null) + || (allAddedRows.Count < 1))) { + return updatedRows; + } + global::System.Collections.Generic.List realUpdatedRows = new global::System.Collections.Generic.List(); + for (int i = 0; (i < updatedRows.Length); i = (i + 1)) { + global::System.Data.DataRow row = updatedRows[i]; + if ((allAddedRows.Contains(row) == false)) { + realUpdatedRows.Add(row); + } + } + return realUpdatedRows.ToArray(); + } + + /// + ///Update all changes to the dataset. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual int UpdateAll(MyShopDataSet dataSet) { + if ((dataSet == null)) { + throw new global::System.ArgumentNullException("dataSet"); + } + if ((dataSet.HasChanges() == false)) { + return 0; + } + if (((this._goodsTableAdapter != null) + && (this.MatchTableAdapterConnection(this._goodsTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + global::System.Data.IDbConnection workConnection = this.Connection; + if ((workConnection == null)) { + throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" + + "ger TableAdapter property to a valid TableAdapter instance."); + } + bool workConnOpened = false; + if (((workConnection.State & global::System.Data.ConnectionState.Broken) + == global::System.Data.ConnectionState.Broken)) { + workConnection.Close(); + } + if ((workConnection.State == global::System.Data.ConnectionState.Closed)) { + workConnection.Open(); + workConnOpened = true; + } + global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction(); + if ((workTransaction == null)) { + throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" + + "ctions or the current state is not allowing the transaction to begin."); + } + global::System.Collections.Generic.List allChangedRows = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.List allAddedRows = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.List adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.Dictionary revertConnections = new global::System.Collections.Generic.Dictionary(); + int result = 0; + global::System.Data.DataSet backupDataSet = null; + if (this.BackupDataSetBeforeUpdate) { + backupDataSet = new global::System.Data.DataSet(); + backupDataSet.Merge(dataSet); + } + try { + // ---- Prepare for update ----------- + // + if ((this._goodsTableAdapter != null)) { + revertConnections.Add(this._goodsTableAdapter, this._goodsTableAdapter.Connection); + this._goodsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._goodsTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._goodsTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._goodsTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._goodsTableAdapter.Adapter); + } + } + // + //---- Perform updates ----------- + // + if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) { + result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); + result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); + } + else { + result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); + result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); + } + result = (result + this.UpdateDeletedRows(dataSet, allChangedRows)); + // + //---- Commit updates ----------- + // + workTransaction.Commit(); + if ((0 < allAddedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; + allAddedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + } + } + if ((0 < allChangedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count]; + allChangedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + } + } + } + catch (global::System.Exception ex) { + workTransaction.Rollback(); + // ---- Restore the dataset ----------- + if (this.BackupDataSetBeforeUpdate) { + global::System.Diagnostics.Debug.Assert((backupDataSet != null)); + dataSet.Clear(); + dataSet.Merge(backupDataSet); + } + else { + if ((0 < allAddedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; + allAddedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + row.SetAdded(); + } + } + } + throw ex; + } + finally { + if (workConnOpened) { + workConnection.Close(); + } + if ((this._goodsTableAdapter != null)) { + this._goodsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._goodsTableAdapter])); + this._goodsTableAdapter.Transaction = null; + } + if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { + global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; + adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); + for (int i = 0; (i < adapters.Length); i = (i + 1)) { + global::System.Data.Common.DataAdapter adapter = adapters[i]; + adapter.AcceptChangesDuringUpdate = true; + } + } + } + return result; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) { + global::System.Array.Sort(rows, new SelfReferenceComparer(relation, childFirst)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) { + if ((this._connection != null)) { + return true; + } + if (((this.Connection == null) + || (inputConnection == null))) { + return true; + } + if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) { + return true; + } + return false; + } + + /// + ///Update Order Option + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public enum UpdateOrderOption { + + InsertUpdateDelete = 0, + + UpdateInsertDelete = 1, + } + + /// + ///Used to sort self-referenced table's rows + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer { + + private global::System.Data.DataRelation _relation; + + private int _childFirst; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) { + this._relation = relation; + if (childFirst) { + this._childFirst = -1; + } + else { + this._childFirst = 1; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) { + global::System.Diagnostics.Debug.Assert((row != null)); + global::System.Data.DataRow root = row; + distance = 0; + + global::System.Collections.Generic.IDictionary traversedRows = new global::System.Collections.Generic.Dictionary(); + traversedRows[row] = row; + + global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); + for ( + ; ((parent != null) + && (traversedRows.ContainsKey(parent) == false)); + ) { + distance = (distance + 1); + root = parent; + traversedRows[parent] = parent; + parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); + } + + if ((distance == 0)) { + traversedRows.Clear(); + traversedRows[row] = row; + parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); + for ( + ; ((parent != null) + && (traversedRows.ContainsKey(parent) == false)); + ) { + distance = (distance + 1); + root = parent; + traversedRows[parent] = parent; + parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); + } + } + + return root; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) { + if (object.ReferenceEquals(row1, row2)) { + return 0; + } + if ((row1 == null)) { + return -1; + } + if ((row2 == null)) { + return 1; + } + + int distance1 = 0; + global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1); + + int distance2 = 0; + global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2); + + if (object.ReferenceEquals(root1, root2)) { + return (this._childFirst * distance1.CompareTo(distance2)); + } + else { + global::System.Diagnostics.Debug.Assert(((root1.Table != null) + && (root2.Table != null))); + if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) { + return -1; + } + else { + return 1; + } + } + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/MyShop/MyShopDataSet.xsc b/MyShop/MyShopDataSet.xsc new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/MyShop/MyShopDataSet.xsc @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/MyShop/MyShopDataSet.xsd b/MyShop/MyShopDataSet.xsd new file mode 100644 index 0000000..7f1c2bd --- /dev/null +++ b/MyShop/MyShopDataSet.xsd @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + DELETE FROM `Goods` WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?))) + + + + + + + + + + + + + + INSERT INTO `Goods` (`GoodsName`, `GoodsUnitPrice`, `GoodsStock`) VALUES (?, ?, ?) + + + + + + + + + + SELECT GoodsCode, GoodsName, GoodsUnitPrice, GoodsStock FROM Goods + + + + + + UPDATE `Goods` SET `GoodsName` = ?, `GoodsUnitPrice` = ?, `GoodsStock` = ? WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/MyShopDataSet.xss b/MyShop/MyShopDataSet.xss new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/MyShop/MyShopDataSet.xss @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/MyShop/MyShopDataSet1.Designer.cs b/MyShop/MyShopDataSet1.Designer.cs new file mode 100644 index 0000000..3bf5c67 --- /dev/null +++ b/MyShop/MyShopDataSet1.Designer.cs @@ -0,0 +1,5100 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 + +namespace MyShop { + + + /// + ///Represents a strongly typed in-memory cache of data. + /// + [global::System.Serializable()] + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] + [global::System.Xml.Serialization.XmlRootAttribute("MyShopDataSet")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] + public partial class MyShopDataSet : global::System.Data.DataSet { + + private CustomersDataTable tableCustomers; + + private FactorItemsDataTable tableFactorItems; + + private FactorsDataTable tableFactors; + + private GoodsDataTable tableGoods; + + private UsersDataTable tableUsers; + + private global::System.Data.DataRelation relationFactorsFactorItems; + + private global::System.Data.DataRelation relationGoodsFactorItems; + + private global::System.Data.DataRelation relationCustomersFactors; + + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public MyShopDataSet() { + this.BeginInit(); + this.InitClass(); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + base.Relations.CollectionChanged += schemaChangedHandler; + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected MyShopDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context, false) { + if ((this.IsBinarySerialized(info, context) == true)) { + this.InitVars(false); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + this.Tables.CollectionChanged += schemaChangedHandler1; + this.Relations.CollectionChanged += schemaChangedHandler1; + return; + } + string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); + if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + if ((ds.Tables["Customers"] != null)) { + base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"])); + } + if ((ds.Tables["FactorItems"] != null)) { + base.Tables.Add(new FactorItemsDataTable(ds.Tables["FactorItems"])); + } + if ((ds.Tables["Factors"] != null)) { + base.Tables.Add(new FactorsDataTable(ds.Tables["Factors"])); + } + if ((ds.Tables["Goods"] != null)) { + base.Tables.Add(new GoodsDataTable(ds.Tables["Goods"])); + } + if ((ds.Tables["Users"] != null)) { + base.Tables.Add(new UsersDataTable(ds.Tables["Users"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + } + this.GetSerializationData(info, context); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + this.Relations.CollectionChanged += schemaChangedHandler; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public CustomersDataTable Customers { + get { + return this.tableCustomers; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public FactorItemsDataTable FactorItems { + get { + return this.tableFactorItems; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public FactorsDataTable Factors { + get { + return this.tableFactors; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public GoodsDataTable Goods { + get { + return this.tableGoods; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public UsersDataTable Users { + get { + return this.tableUsers; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.BrowsableAttribute(true)] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] + public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { + get { + return this._schemaSerializationMode; + } + set { + this._schemaSerializationMode = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataTableCollection Tables { + get { + return base.Tables; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataRelationCollection Relations { + get { + return base.Relations; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void InitializeDerivedDataSet() { + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataSet Clone() { + MyShopDataSet cln = ((MyShopDataSet)(base.Clone())); + cln.InitVars(); + cln.SchemaSerializationMode = this.SchemaSerializationMode; + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeTables() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeRelations() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { + if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + this.Reset(); + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXml(reader); + if ((ds.Tables["Customers"] != null)) { + base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"])); + } + if ((ds.Tables["FactorItems"] != null)) { + base.Tables.Add(new FactorItemsDataTable(ds.Tables["FactorItems"])); + } + if ((ds.Tables["Factors"] != null)) { + base.Tables.Add(new FactorsDataTable(ds.Tables["Factors"])); + } + if ((ds.Tables["Goods"] != null)) { + base.Tables.Add(new GoodsDataTable(ds.Tables["Goods"])); + } + if ((ds.Tables["Users"] != null)) { + base.Tables.Add(new UsersDataTable(ds.Tables["Users"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXml(reader); + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { + global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); + this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); + stream.Position = 0; + return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.InitVars(true); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars(bool initTable) { + this.tableCustomers = ((CustomersDataTable)(base.Tables["Customers"])); + if ((initTable == true)) { + if ((this.tableCustomers != null)) { + this.tableCustomers.InitVars(); + } + } + this.tableFactorItems = ((FactorItemsDataTable)(base.Tables["FactorItems"])); + if ((initTable == true)) { + if ((this.tableFactorItems != null)) { + this.tableFactorItems.InitVars(); + } + } + this.tableFactors = ((FactorsDataTable)(base.Tables["Factors"])); + if ((initTable == true)) { + if ((this.tableFactors != null)) { + this.tableFactors.InitVars(); + } + } + this.tableGoods = ((GoodsDataTable)(base.Tables["Goods"])); + if ((initTable == true)) { + if ((this.tableGoods != null)) { + this.tableGoods.InitVars(); + } + } + this.tableUsers = ((UsersDataTable)(base.Tables["Users"])); + if ((initTable == true)) { + if ((this.tableUsers != null)) { + this.tableUsers.InitVars(); + } + } + this.relationFactorsFactorItems = this.Relations["FactorsFactorItems"]; + this.relationGoodsFactorItems = this.Relations["GoodsFactorItems"]; + this.relationCustomersFactors = this.Relations["CustomersFactors"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.DataSetName = "MyShopDataSet"; + this.Prefix = ""; + this.Namespace = "http://tempuri.org/MyShopDataSet1.xsd"; + this.EnforceConstraints = true; + this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + this.tableCustomers = new CustomersDataTable(); + base.Tables.Add(this.tableCustomers); + this.tableFactorItems = new FactorItemsDataTable(); + base.Tables.Add(this.tableFactorItems); + this.tableFactors = new FactorsDataTable(); + base.Tables.Add(this.tableFactors); + this.tableGoods = new GoodsDataTable(); + base.Tables.Add(this.tableGoods); + this.tableUsers = new UsersDataTable(); + base.Tables.Add(this.tableUsers); + this.relationFactorsFactorItems = new global::System.Data.DataRelation("FactorsFactorItems", new global::System.Data.DataColumn[] { + this.tableFactors.FactorCodeColumn}, new global::System.Data.DataColumn[] { + this.tableFactorItems.FactorCodeColumn}, false); + this.Relations.Add(this.relationFactorsFactorItems); + this.relationGoodsFactorItems = new global::System.Data.DataRelation("GoodsFactorItems", new global::System.Data.DataColumn[] { + this.tableGoods.GoodsCodeColumn}, new global::System.Data.DataColumn[] { + this.tableFactorItems.GoodsCodeColumn}, false); + this.Relations.Add(this.relationGoodsFactorItems); + this.relationCustomersFactors = new global::System.Data.DataRelation("CustomersFactors", new global::System.Data.DataColumn[] { + this.tableCustomers.CustomerCodeColumn}, new global::System.Data.DataColumn[] { + this.tableFactors.CustomerCodeColumn}, false); + this.Relations.Add(this.relationCustomersFactors); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeCustomers() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeFactorItems() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeFactors() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeGoods() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeUsers() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { + if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + MyShopDataSet ds = new MyShopDataSet(); + 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; + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void CustomersRowChangeEventHandler(object sender, CustomersRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void FactorItemsRowChangeEventHandler(object sender, FactorItemsRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void FactorsRowChangeEventHandler(object sender, FactorsRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void GoodsRowChangeEventHandler(object sender, GoodsRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void UsersRowChangeEventHandler(object sender, UsersRowChangeEvent e); + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class CustomersDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnCustomerCode; + + private global::System.Data.DataColumn columnCustomerFirstName; + + private global::System.Data.DataColumn columnCustomerLastName; + + private global::System.Data.DataColumn columnCustomerMobile; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersDataTable() { + this.TableName = "Customers"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal CustomersDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected CustomersDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CustomerCodeColumn { + get { + return this.columnCustomerCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CustomerFirstNameColumn { + get { + return this.columnCustomerFirstName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CustomerLastNameColumn { + get { + return this.columnCustomerLastName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CustomerMobileColumn { + get { + return this.columnCustomerMobile; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow this[int index] { + get { + return ((CustomersRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event CustomersRowChangeEventHandler CustomersRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event CustomersRowChangeEventHandler CustomersRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event CustomersRowChangeEventHandler CustomersRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event CustomersRowChangeEventHandler CustomersRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddCustomersRow(CustomersRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow AddCustomersRow(string CustomerFirstName, string CustomerLastName, string CustomerMobile) { + CustomersRow rowCustomersRow = ((CustomersRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + CustomerFirstName, + CustomerLastName, + CustomerMobile}; + rowCustomersRow.ItemArray = columnValuesArray; + this.Rows.Add(rowCustomersRow); + return rowCustomersRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow FindByCustomerCode(int CustomerCode) { + return ((CustomersRow)(this.Rows.Find(new object[] { + CustomerCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + CustomersDataTable cln = ((CustomersDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new CustomersDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnCustomerCode = base.Columns["CustomerCode"]; + this.columnCustomerFirstName = base.Columns["CustomerFirstName"]; + this.columnCustomerLastName = base.Columns["CustomerLastName"]; + this.columnCustomerMobile = base.Columns["CustomerMobile"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnCustomerCode = new global::System.Data.DataColumn("CustomerCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCustomerCode); + this.columnCustomerFirstName = new global::System.Data.DataColumn("CustomerFirstName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCustomerFirstName); + this.columnCustomerLastName = new global::System.Data.DataColumn("CustomerLastName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCustomerLastName); + this.columnCustomerMobile = new global::System.Data.DataColumn("CustomerMobile", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCustomerMobile); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnCustomerCode}, true)); + this.columnCustomerCode.AutoIncrement = true; + this.columnCustomerCode.AutoIncrementSeed = -1; + this.columnCustomerCode.AutoIncrementStep = -1; + this.columnCustomerCode.AllowDBNull = false; + this.columnCustomerCode.Unique = true; + this.columnCustomerFirstName.MaxLength = 255; + this.columnCustomerLastName.MaxLength = 255; + this.columnCustomerMobile.MaxLength = 255; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow NewCustomersRow() { + return ((CustomersRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new CustomersRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(CustomersRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.CustomersRowChanged != null)) { + this.CustomersRowChanged(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.CustomersRowChanging != null)) { + this.CustomersRowChanging(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.CustomersRowDeleted != null)) { + this.CustomersRowDeleted(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.CustomersRowDeleting != null)) { + this.CustomersRowDeleting(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveCustomersRow(CustomersRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "CustomersDataTable"; + 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; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class FactorItemsDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnFactorCode; + + private global::System.Data.DataColumn columnGoodsCode; + + private global::System.Data.DataColumn columnGoodsAmount; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsDataTable() { + this.TableName = "FactorItems"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal FactorItemsDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected FactorItemsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FactorCodeColumn { + get { + return this.columnFactorCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsCodeColumn { + get { + return this.columnGoodsCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsAmountColumn { + get { + return this.columnGoodsAmount; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow this[int index] { + get { + return ((FactorItemsRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorItemsRowChangeEventHandler FactorItemsRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorItemsRowChangeEventHandler FactorItemsRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorItemsRowChangeEventHandler FactorItemsRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorItemsRowChangeEventHandler FactorItemsRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddFactorItemsRow(FactorItemsRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow AddFactorItemsRow(FactorsRow parentFactorsRowByFactorsFactorItems, GoodsRow parentGoodsRowByGoodsFactorItems, int GoodsAmount) { + FactorItemsRow rowFactorItemsRow = ((FactorItemsRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + null, + GoodsAmount}; + if ((parentFactorsRowByFactorsFactorItems != null)) { + columnValuesArray[0] = parentFactorsRowByFactorsFactorItems[0]; + } + if ((parentGoodsRowByGoodsFactorItems != null)) { + columnValuesArray[1] = parentGoodsRowByGoodsFactorItems[0]; + } + rowFactorItemsRow.ItemArray = columnValuesArray; + this.Rows.Add(rowFactorItemsRow); + return rowFactorItemsRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow FindByGoodsCode(int GoodsCode) { + return ((FactorItemsRow)(this.Rows.Find(new object[] { + GoodsCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + FactorItemsDataTable cln = ((FactorItemsDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new FactorItemsDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnFactorCode = base.Columns["FactorCode"]; + this.columnGoodsCode = base.Columns["GoodsCode"]; + this.columnGoodsAmount = base.Columns["GoodsAmount"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnFactorCode = new global::System.Data.DataColumn("FactorCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnFactorCode); + this.columnGoodsCode = new global::System.Data.DataColumn("GoodsCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsCode); + this.columnGoodsAmount = new global::System.Data.DataColumn("GoodsAmount", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsAmount); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnGoodsCode}, true)); + this.columnGoodsCode.AllowDBNull = false; + this.columnGoodsCode.Unique = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow NewFactorItemsRow() { + return ((FactorItemsRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new FactorItemsRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(FactorItemsRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.FactorItemsRowChanged != null)) { + this.FactorItemsRowChanged(this, new FactorItemsRowChangeEvent(((FactorItemsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.FactorItemsRowChanging != null)) { + this.FactorItemsRowChanging(this, new FactorItemsRowChangeEvent(((FactorItemsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.FactorItemsRowDeleted != null)) { + this.FactorItemsRowDeleted(this, new FactorItemsRowChangeEvent(((FactorItemsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.FactorItemsRowDeleting != null)) { + this.FactorItemsRowDeleting(this, new FactorItemsRowChangeEvent(((FactorItemsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveFactorItemsRow(FactorItemsRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "FactorItemsDataTable"; + 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; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class FactorsDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnFactorCode; + + private global::System.Data.DataColumn columnCustomerCode; + + private global::System.Data.DataColumn columnFactorDate; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsDataTable() { + this.TableName = "Factors"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal FactorsDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected FactorsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FactorCodeColumn { + get { + return this.columnFactorCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CustomerCodeColumn { + get { + return this.columnCustomerCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FactorDateColumn { + get { + return this.columnFactorDate; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow this[int index] { + get { + return ((FactorsRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorsRowChangeEventHandler FactorsRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorsRowChangeEventHandler FactorsRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorsRowChangeEventHandler FactorsRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event FactorsRowChangeEventHandler FactorsRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddFactorsRow(FactorsRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow AddFactorsRow(CustomersRow parentCustomersRowByCustomersFactors, System.DateTime FactorDate) { + FactorsRow rowFactorsRow = ((FactorsRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + null, + FactorDate}; + if ((parentCustomersRowByCustomersFactors != null)) { + columnValuesArray[1] = parentCustomersRowByCustomersFactors[0]; + } + rowFactorsRow.ItemArray = columnValuesArray; + this.Rows.Add(rowFactorsRow); + return rowFactorsRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow FindByFactorCode(int FactorCode) { + return ((FactorsRow)(this.Rows.Find(new object[] { + FactorCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + FactorsDataTable cln = ((FactorsDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new FactorsDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnFactorCode = base.Columns["FactorCode"]; + this.columnCustomerCode = base.Columns["CustomerCode"]; + this.columnFactorDate = base.Columns["FactorDate"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnFactorCode = new global::System.Data.DataColumn("FactorCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnFactorCode); + this.columnCustomerCode = new global::System.Data.DataColumn("CustomerCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCustomerCode); + this.columnFactorDate = new global::System.Data.DataColumn("FactorDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnFactorDate); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnFactorCode}, true)); + this.columnFactorCode.AutoIncrement = true; + this.columnFactorCode.AutoIncrementSeed = -1; + this.columnFactorCode.AutoIncrementStep = -1; + this.columnFactorCode.AllowDBNull = false; + this.columnFactorCode.Unique = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow NewFactorsRow() { + return ((FactorsRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new FactorsRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(FactorsRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.FactorsRowChanged != null)) { + this.FactorsRowChanged(this, new FactorsRowChangeEvent(((FactorsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.FactorsRowChanging != null)) { + this.FactorsRowChanging(this, new FactorsRowChangeEvent(((FactorsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.FactorsRowDeleted != null)) { + this.FactorsRowDeleted(this, new FactorsRowChangeEvent(((FactorsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.FactorsRowDeleting != null)) { + this.FactorsRowDeleting(this, new FactorsRowChangeEvent(((FactorsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveFactorsRow(FactorsRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "FactorsDataTable"; + 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; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class GoodsDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnGoodsCode; + + private global::System.Data.DataColumn columnGoodsName; + + private global::System.Data.DataColumn columnGoodsUnitPrice; + + private global::System.Data.DataColumn columnGoodsStock; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsDataTable() { + this.TableName = "Goods"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GoodsDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected GoodsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsCodeColumn { + get { + return this.columnGoodsCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsNameColumn { + get { + return this.columnGoodsName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsUnitPriceColumn { + get { + return this.columnGoodsUnitPrice; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn GoodsStockColumn { + get { + return this.columnGoodsStock; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow this[int index] { + get { + return ((GoodsRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GoodsRowChangeEventHandler GoodsRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddGoodsRow(GoodsRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow AddGoodsRow(string GoodsName, int GoodsUnitPrice, int GoodsStock) { + GoodsRow rowGoodsRow = ((GoodsRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + GoodsName, + GoodsUnitPrice, + GoodsStock}; + rowGoodsRow.ItemArray = columnValuesArray; + this.Rows.Add(rowGoodsRow); + return rowGoodsRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow FindByGoodsCode(int GoodsCode) { + return ((GoodsRow)(this.Rows.Find(new object[] { + GoodsCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + GoodsDataTable cln = ((GoodsDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new GoodsDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnGoodsCode = base.Columns["GoodsCode"]; + this.columnGoodsName = base.Columns["GoodsName"]; + this.columnGoodsUnitPrice = base.Columns["GoodsUnitPrice"]; + this.columnGoodsStock = base.Columns["GoodsStock"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnGoodsCode = new global::System.Data.DataColumn("GoodsCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsCode); + this.columnGoodsName = new global::System.Data.DataColumn("GoodsName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsName); + this.columnGoodsUnitPrice = new global::System.Data.DataColumn("GoodsUnitPrice", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsUnitPrice); + this.columnGoodsStock = new global::System.Data.DataColumn("GoodsStock", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnGoodsStock); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnGoodsCode}, true)); + this.columnGoodsCode.AutoIncrement = true; + this.columnGoodsCode.AutoIncrementSeed = -1; + this.columnGoodsCode.AutoIncrementStep = -1; + this.columnGoodsCode.AllowDBNull = false; + this.columnGoodsCode.Unique = true; + this.columnGoodsName.MaxLength = 255; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow NewGoodsRow() { + return ((GoodsRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new GoodsRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(GoodsRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.GoodsRowChanged != null)) { + this.GoodsRowChanged(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.GoodsRowChanging != null)) { + this.GoodsRowChanging(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.GoodsRowDeleted != null)) { + this.GoodsRowDeleted(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.GoodsRowDeleting != null)) { + this.GoodsRowDeleting(this, new GoodsRowChangeEvent(((GoodsRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveGoodsRow(GoodsRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "GoodsDataTable"; + 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; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class UsersDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnUserCode; + + private global::System.Data.DataColumn columnUsername; + + private global::System.Data.DataColumn columnPassword; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersDataTable() { + this.TableName = "Users"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal UsersDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected UsersDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn UserCodeColumn { + get { + return this.columnUserCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn UsernameColumn { + get { + return this.columnUsername; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn PasswordColumn { + get { + return this.columnPassword; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRow this[int index] { + get { + return ((UsersRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event UsersRowChangeEventHandler UsersRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event UsersRowChangeEventHandler UsersRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event UsersRowChangeEventHandler UsersRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event UsersRowChangeEventHandler UsersRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddUsersRow(UsersRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRow AddUsersRow(string Username, string Password) { + UsersRow rowUsersRow = ((UsersRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + Username, + Password}; + rowUsersRow.ItemArray = columnValuesArray; + this.Rows.Add(rowUsersRow); + return rowUsersRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRow FindByUserCode(int UserCode) { + return ((UsersRow)(this.Rows.Find(new object[] { + UserCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + UsersDataTable cln = ((UsersDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new UsersDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnUserCode = base.Columns["UserCode"]; + this.columnUsername = base.Columns["Username"]; + this.columnPassword = base.Columns["Password"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnUserCode = new global::System.Data.DataColumn("UserCode", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnUserCode); + this.columnUsername = new global::System.Data.DataColumn("Username", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnUsername); + this.columnPassword = new global::System.Data.DataColumn("Password", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnPassword); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnUserCode}, true)); + this.columnUserCode.AutoIncrement = true; + this.columnUserCode.AutoIncrementSeed = -1; + this.columnUserCode.AutoIncrementStep = -1; + this.columnUserCode.AllowDBNull = false; + this.columnUserCode.Unique = true; + this.columnUsername.MaxLength = 255; + this.columnPassword.MaxLength = 536870910; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRow NewUsersRow() { + return ((UsersRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new UsersRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(UsersRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.UsersRowChanged != null)) { + this.UsersRowChanged(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.UsersRowChanging != null)) { + this.UsersRowChanging(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.UsersRowDeleted != null)) { + this.UsersRowDeleted(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.UsersRowDeleting != null)) { + this.UsersRowDeleting(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveUsersRow(UsersRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + 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(); + MyShopDataSet ds = new MyShopDataSet(); + 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 = "UsersDataTable"; + 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; + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class CustomersRow : global::System.Data.DataRow { + + private CustomersDataTable tableCustomers; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal CustomersRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableCustomers = ((CustomersDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int CustomerCode { + get { + return ((int)(this[this.tableCustomers.CustomerCodeColumn])); + } + set { + this[this.tableCustomers.CustomerCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string CustomerFirstName { + get { + try { + return ((string)(this[this.tableCustomers.CustomerFirstNameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'CustomerFirstName\' in table \'Customers\' is DBNull.", e); + } + } + set { + this[this.tableCustomers.CustomerFirstNameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string CustomerLastName { + get { + try { + return ((string)(this[this.tableCustomers.CustomerLastNameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'CustomerLastName\' in table \'Customers\' is DBNull.", e); + } + } + set { + this[this.tableCustomers.CustomerLastNameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string CustomerMobile { + get { + try { + return ((string)(this[this.tableCustomers.CustomerMobileColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'CustomerMobile\' in table \'Customers\' is DBNull.", e); + } + } + set { + this[this.tableCustomers.CustomerMobileColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCustomerFirstNameNull() { + return this.IsNull(this.tableCustomers.CustomerFirstNameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCustomerFirstNameNull() { + this[this.tableCustomers.CustomerFirstNameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCustomerLastNameNull() { + return this.IsNull(this.tableCustomers.CustomerLastNameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCustomerLastNameNull() { + this[this.tableCustomers.CustomerLastNameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCustomerMobileNull() { + return this.IsNull(this.tableCustomers.CustomerMobileColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCustomerMobileNull() { + this[this.tableCustomers.CustomerMobileColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow[] GetFactorsRows() { + if ((this.Table.ChildRelations["CustomersFactors"] == null)) { + return new FactorsRow[0]; + } + else { + return ((FactorsRow[])(base.GetChildRows(this.Table.ChildRelations["CustomersFactors"]))); + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class FactorItemsRow : global::System.Data.DataRow { + + private FactorItemsDataTable tableFactorItems; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal FactorItemsRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableFactorItems = ((FactorItemsDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int FactorCode { + get { + try { + return ((int)(this[this.tableFactorItems.FactorCodeColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'FactorCode\' in table \'FactorItems\' is DBNull.", e); + } + } + set { + this[this.tableFactorItems.FactorCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsCode { + get { + return ((int)(this[this.tableFactorItems.GoodsCodeColumn])); + } + set { + this[this.tableFactorItems.GoodsCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsAmount { + get { + try { + return ((int)(this[this.tableFactorItems.GoodsAmountColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsAmount\' in table \'FactorItems\' is DBNull.", e); + } + } + set { + this[this.tableFactorItems.GoodsAmountColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow FactorsRow { + get { + return ((FactorsRow)(this.GetParentRow(this.Table.ParentRelations["FactorsFactorItems"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["FactorsFactorItems"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow GoodsRow { + get { + return ((GoodsRow)(this.GetParentRow(this.Table.ParentRelations["GoodsFactorItems"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["GoodsFactorItems"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFactorCodeNull() { + return this.IsNull(this.tableFactorItems.FactorCodeColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFactorCodeNull() { + this[this.tableFactorItems.FactorCodeColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsAmountNull() { + return this.IsNull(this.tableFactorItems.GoodsAmountColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsAmountNull() { + this[this.tableFactorItems.GoodsAmountColumn] = global::System.Convert.DBNull; + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class FactorsRow : global::System.Data.DataRow { + + private FactorsDataTable tableFactors; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal FactorsRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableFactors = ((FactorsDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int FactorCode { + get { + return ((int)(this[this.tableFactors.FactorCodeColumn])); + } + set { + this[this.tableFactors.FactorCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int CustomerCode { + get { + try { + return ((int)(this[this.tableFactors.CustomerCodeColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'CustomerCode\' in table \'Factors\' is DBNull.", e); + } + } + set { + this[this.tableFactors.CustomerCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public System.DateTime FactorDate { + get { + try { + return ((global::System.DateTime)(this[this.tableFactors.FactorDateColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'FactorDate\' in table \'Factors\' is DBNull.", e); + } + } + set { + this[this.tableFactors.FactorDateColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow CustomersRow { + get { + return ((CustomersRow)(this.GetParentRow(this.Table.ParentRelations["CustomersFactors"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["CustomersFactors"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCustomerCodeNull() { + return this.IsNull(this.tableFactors.CustomerCodeColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCustomerCodeNull() { + this[this.tableFactors.CustomerCodeColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFactorDateNull() { + return this.IsNull(this.tableFactors.FactorDateColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFactorDateNull() { + this[this.tableFactors.FactorDateColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow[] GetFactorItemsRows() { + if ((this.Table.ChildRelations["FactorsFactorItems"] == null)) { + return new FactorItemsRow[0]; + } + else { + return ((FactorItemsRow[])(base.GetChildRows(this.Table.ChildRelations["FactorsFactorItems"]))); + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class GoodsRow : global::System.Data.DataRow { + + private GoodsDataTable tableGoods; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GoodsRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableGoods = ((GoodsDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsCode { + get { + return ((int)(this[this.tableGoods.GoodsCodeColumn])); + } + set { + this[this.tableGoods.GoodsCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string GoodsName { + get { + try { + return ((string)(this[this.tableGoods.GoodsNameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsName\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsNameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsUnitPrice { + get { + try { + return ((int)(this[this.tableGoods.GoodsUnitPriceColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsUnitPrice\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsUnitPriceColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int GoodsStock { + get { + try { + return ((int)(this[this.tableGoods.GoodsStockColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'GoodsStock\' in table \'Goods\' is DBNull.", e); + } + } + set { + this[this.tableGoods.GoodsStockColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsNameNull() { + return this.IsNull(this.tableGoods.GoodsNameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsNameNull() { + this[this.tableGoods.GoodsNameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsUnitPriceNull() { + return this.IsNull(this.tableGoods.GoodsUnitPriceColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsUnitPriceNull() { + this[this.tableGoods.GoodsUnitPriceColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGoodsStockNull() { + return this.IsNull(this.tableGoods.GoodsStockColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGoodsStockNull() { + this[this.tableGoods.GoodsStockColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow[] GetFactorItemsRows() { + if ((this.Table.ChildRelations["GoodsFactorItems"] == null)) { + return new FactorItemsRow[0]; + } + else { + return ((FactorItemsRow[])(base.GetChildRows(this.Table.ChildRelations["GoodsFactorItems"]))); + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class UsersRow : global::System.Data.DataRow { + + private UsersDataTable tableUsers; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal UsersRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableUsers = ((UsersDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int UserCode { + get { + return ((int)(this[this.tableUsers.UserCodeColumn])); + } + set { + this[this.tableUsers.UserCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Username { + get { + try { + return ((string)(this[this.tableUsers.UsernameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Username\' in table \'Users\' is DBNull.", e); + } + } + set { + this[this.tableUsers.UsernameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Password { + get { + try { + return ((string)(this[this.tableUsers.PasswordColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Password\' in table \'Users\' is DBNull.", e); + } + } + set { + this[this.tableUsers.PasswordColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsUsernameNull() { + return this.IsNull(this.tableUsers.UsernameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetUsernameNull() { + this[this.tableUsers.UsernameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsPasswordNull() { + return this.IsNull(this.tableUsers.PasswordColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetPasswordNull() { + this[this.tableUsers.PasswordColumn] = global::System.Convert.DBNull; + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class CustomersRowChangeEvent : global::System.EventArgs { + + private CustomersRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRowChangeEvent(CustomersRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class FactorItemsRowChangeEvent : global::System.EventArgs { + + private FactorItemsRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRowChangeEvent(FactorItemsRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class FactorsRowChangeEvent : global::System.EventArgs { + + private FactorsRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRowChangeEvent(FactorsRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class GoodsRowChangeEvent : global::System.EventArgs { + + private GoodsRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRowChangeEvent(GoodsRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class UsersRowChangeEvent : global::System.EventArgs { + + private UsersRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRowChangeEvent(UsersRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + } +} +namespace MyShop.MyShopDataSetTableAdapters { + + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class CustomersTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public CustomersTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Customers"; + tableMapping.ColumnMappings.Add("CustomerCode", "CustomerCode"); + tableMapping.ColumnMappings.Add("CustomerFirstName", "CustomerFirstName"); + tableMapping.ColumnMappings.Add("CustomerLastName", "CustomerLastName"); + tableMapping.ColumnMappings.Add("CustomerMobile", "CustomerMobile"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = @"DELETE FROM `Customers` WHERE ((`CustomerCode` = ?) AND ((? = 1 AND `CustomerFirstName` IS NULL) OR (`CustomerFirstName` = ?)) AND ((? = 1 AND `CustomerLastName` IS NULL) OR (`CustomerLastName` = ?)) AND ((? = 1 AND `CustomerMobile` IS NULL) OR (`CustomerMobile` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerFirstName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerFirstName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerLastName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerLastName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerMobile", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerMobile", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `Customers` (`CustomerFirstName`, `CustomerLastName`, `CustomerMobile" + + "`) VALUES (?, ?, ?)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerFirstName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerLastName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerMobile", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = @"UPDATE `Customers` SET `CustomerFirstName` = ?, `CustomerLastName` = ?, `CustomerMobile` = ? WHERE ((`CustomerCode` = ?) AND ((? = 1 AND `CustomerFirstName` IS NULL) OR (`CustomerFirstName` = ?)) AND ((? = 1 AND `CustomerLastName` IS NULL) OR (`CustomerLastName` = ?)) AND ((? = 1 AND `CustomerMobile` IS NULL) OR (`CustomerMobile` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerFirstName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerLastName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerMobile", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerFirstName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerFirstName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerFirstName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerLastName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerLastName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerLastName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerMobile", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerMobile", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerMobile", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT CustomerCode, CustomerFirstName, CustomerLastName, CustomerMobile FROM Cus" + + "tomers"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.CustomersDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.CustomersDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.CustomersDataTable dataTable = new MyShopDataSet.CustomersDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.CustomersDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "Customers"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_CustomerCode, string Original_CustomerFirstName, string Original_CustomerLastName, string Original_CustomerMobile) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_CustomerCode)); + if ((Original_CustomerFirstName == null)) { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_CustomerFirstName)); + } + if ((Original_CustomerLastName == null)) { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_CustomerLastName)); + } + if ((Original_CustomerMobile == null)) { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_CustomerMobile)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(string CustomerFirstName, string CustomerLastName, string CustomerMobile) { + if ((CustomerFirstName == null)) { + this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(CustomerFirstName)); + } + if ((CustomerLastName == null)) { + this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = ((string)(CustomerLastName)); + } + if ((CustomerMobile == null)) { + this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = ((string)(CustomerMobile)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(string CustomerFirstName, string CustomerLastName, string CustomerMobile, int Original_CustomerCode, string Original_CustomerFirstName, string Original_CustomerLastName, string Original_CustomerMobile) { + if ((CustomerFirstName == null)) { + this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(CustomerFirstName)); + } + if ((CustomerLastName == null)) { + this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(CustomerLastName)); + } + if ((CustomerMobile == null)) { + this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(CustomerMobile)); + } + this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_CustomerCode)); + if ((Original_CustomerFirstName == null)) { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_CustomerFirstName)); + } + if ((Original_CustomerLastName == null)) { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_CustomerLastName)); + } + if ((Original_CustomerMobile == null)) { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_CustomerMobile)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + } + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class FactorItemsTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorItemsTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "FactorItems"; + tableMapping.ColumnMappings.Add("FactorCode", "FactorCode"); + tableMapping.ColumnMappings.Add("GoodsCode", "GoodsCode"); + tableMapping.ColumnMappings.Add("GoodsAmount", "GoodsAmount"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = "DELETE FROM `FactorItems` WHERE (((? = 1 AND `FactorCode` IS NULL) OR (`FactorCod" + + "e` = ?)) AND (`GoodsCode` = ?) AND ((? = 1 AND `GoodsAmount` IS NULL) OR (`Goods" + + "Amount` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `FactorItems` (`FactorCode`, `GoodsCode`, `GoodsAmount`) VALUES (?, ?" + + ", ?)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = "UPDATE `FactorItems` SET `FactorCode` = ?, `GoodsCode` = ?, `GoodsAmount` = ? WHE" + + "RE (((? = 1 AND `FactorCode` IS NULL) OR (`FactorCode` = ?)) AND (`GoodsCode` = " + + "?) AND ((? = 1 AND `GoodsAmount` IS NULL) OR (`GoodsAmount` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsAmount", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsAmount", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT FactorCode, GoodsCode, GoodsAmount FROM FactorItems"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.FactorItemsDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.FactorItemsDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.FactorItemsDataTable dataTable = new MyShopDataSet.FactorItemsDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.FactorItemsDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "FactorItems"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_FactorCode, int Original_GoodsCode, global::System.Nullable Original_GoodsAmount) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_FactorCode)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsAmount.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_GoodsAmount.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(int FactorCode, int GoodsCode, global::System.Nullable GoodsAmount) { + this.Adapter.InsertCommand.Parameters[0].Value = ((int)(FactorCode)); + this.Adapter.InsertCommand.Parameters[1].Value = ((int)(GoodsCode)); + if ((GoodsAmount.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[2].Value = ((int)(GoodsAmount.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(int FactorCode, int GoodsCode, global::System.Nullable GoodsAmount, int Original_FactorCode, int Original_GoodsCode, global::System.Nullable Original_GoodsAmount) { + this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(FactorCode)); + this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(GoodsCode)); + if ((GoodsAmount.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(GoodsAmount.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Original_FactorCode)); + this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsAmount.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Original_GoodsAmount.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(int FactorCode, global::System.Nullable GoodsAmount, int Original_FactorCode, int Original_GoodsCode, global::System.Nullable Original_GoodsAmount) { + return this.Update(FactorCode, Original_GoodsCode, GoodsAmount, Original_FactorCode, Original_GoodsCode, Original_GoodsAmount); + } + } + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class FactorsTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public FactorsTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Factors"; + tableMapping.ColumnMappings.Add("FactorCode", "FactorCode"); + tableMapping.ColumnMappings.Add("CustomerCode", "CustomerCode"); + tableMapping.ColumnMappings.Add("FactorDate", "FactorDate"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = "DELETE FROM `Factors` WHERE ((`FactorCode` = ?) AND ((? = 1 AND `CustomerCode` IS" + + " NULL) OR (`CustomerCode` = ?)) AND ((? = 1 AND `FactorDate` IS NULL) OR (`Facto" + + "rDate` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_FactorDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `Factors` (`CustomerCode`, `FactorDate`) VALUES (?, ?)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("FactorDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = "UPDATE `Factors` SET `CustomerCode` = ?, `FactorDate` = ? WHERE ((`FactorCode` = " + + "?) AND ((? = 1 AND `CustomerCode` IS NULL) OR (`CustomerCode` = ?)) AND ((? = 1 " + + "AND `FactorDate` IS NULL) OR (`FactorDate` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("FactorDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_CustomerCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "CustomerCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_FactorDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_FactorDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "FactorDate", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT FactorCode, CustomerCode, FactorDate FROM Factors"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.FactorsDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.FactorsDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.FactorsDataTable dataTable = new MyShopDataSet.FactorsDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.FactorsDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "Factors"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_FactorCode, global::System.Nullable Original_CustomerCode, global::System.Nullable Original_FactorDate) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_FactorCode)); + if ((Original_CustomerCode.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_CustomerCode.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value; + } + if ((Original_FactorDate.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[4].Value = ((System.DateTime)(Original_FactorDate.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(global::System.Nullable CustomerCode, global::System.Nullable FactorDate) { + if ((CustomerCode.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[0].Value = ((int)(CustomerCode.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value; + } + if ((FactorDate.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[1].Value = ((System.DateTime)(FactorDate.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(global::System.Nullable CustomerCode, global::System.Nullable FactorDate, int Original_FactorCode, global::System.Nullable Original_CustomerCode, global::System.Nullable Original_FactorDate) { + if ((CustomerCode.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(CustomerCode.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value; + } + if ((FactorDate.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[1].Value = ((System.DateTime)(FactorDate.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(Original_FactorCode)); + if ((Original_CustomerCode.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Original_CustomerCode.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; + } + if ((Original_FactorDate.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(Original_FactorDate.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + } + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class GoodsTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GoodsTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Goods"; + tableMapping.ColumnMappings.Add("GoodsCode", "GoodsCode"); + tableMapping.ColumnMappings.Add("GoodsName", "GoodsName"); + tableMapping.ColumnMappings.Add("GoodsUnitPrice", "GoodsUnitPrice"); + tableMapping.ColumnMappings.Add("GoodsStock", "GoodsStock"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = "DELETE FROM `Goods` WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL)" + + " OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitP" + + "rice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `Goods` (`GoodsName`, `GoodsUnitPrice`, `GoodsStock`) VALUES (?, ?, ?" + + ")"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = @"UPDATE `Goods` SET `GoodsName` = ?, `GoodsUnitPrice` = ?, `GoodsStock` = ? WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsName", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsUnitPrice", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsUnitPrice", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_GoodsStock", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "GoodsStock", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT GoodsCode, GoodsName, GoodsUnitPrice, GoodsStock FROM Goods"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.GoodsDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.GoodsDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.GoodsDataTable dataTable = new MyShopDataSet.GoodsDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.GoodsDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "Goods"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_GoodsCode, string Original_GoodsName, global::System.Nullable Original_GoodsUnitPrice, global::System.Nullable Original_GoodsStock) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsName == null)) { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_GoodsName)); + } + if ((Original_GoodsUnitPrice.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_GoodsUnitPrice.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value; + } + if ((Original_GoodsStock.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[6].Value = ((int)(Original_GoodsStock.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(string GoodsName, global::System.Nullable GoodsUnitPrice, global::System.Nullable GoodsStock) { + if ((GoodsName == null)) { + this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(GoodsName)); + } + if ((GoodsUnitPrice.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[1].Value = ((int)(GoodsUnitPrice.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((GoodsStock.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[2].Value = ((int)(GoodsStock.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(string GoodsName, global::System.Nullable GoodsUnitPrice, global::System.Nullable GoodsStock, int Original_GoodsCode, string Original_GoodsName, global::System.Nullable Original_GoodsUnitPrice, global::System.Nullable Original_GoodsStock) { + if ((GoodsName == null)) { + this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(GoodsName)); + } + if ((GoodsUnitPrice.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(GoodsUnitPrice.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((GoodsStock.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(GoodsStock.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_GoodsCode)); + if ((Original_GoodsName == null)) { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_GoodsName)); + } + if ((Original_GoodsUnitPrice.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Original_GoodsUnitPrice.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; + } + if ((Original_GoodsStock.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Original_GoodsStock.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + } + + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class UsersTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.OleDb.OleDbDataAdapter _adapter; + + private global::System.Data.OleDb.OleDbConnection _connection; + + private global::System.Data.OleDb.OleDbTransaction _transaction; + + private global::System.Data.OleDb.OleDbCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UsersTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal global::System.Data.OleDb.OleDbTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected global::System.Data.OleDb.OleDbCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.OleDb.OleDbDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Users"; + tableMapping.ColumnMappings.Add("UserCode", "UserCode"); + tableMapping.ColumnMappings.Add("Username", "Username"); + tableMapping.ColumnMappings.Add("Password", "Password"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = "DELETE FROM `Users` WHERE ((`UserCode` = ?) AND ((? = 1 AND `Username` IS NULL) O" + + "R (`Username` = ?)))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_UserCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "UserCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Username", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Username", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = "INSERT INTO `Users` (`Username`, `Password`) VALUES (?, ?)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Username", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Password", global::System.Data.OleDb.OleDbType.LongVarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Password", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = "UPDATE `Users` SET `Username` = ?, `Password` = ? WHERE ((`UserCode` = ?) AND ((?" + + " = 1 AND `Username` IS NULL) OR (`Username` = ?)))"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Username", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Password", global::System.Data.OleDb.OleDbType.LongVarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Password", global::System.Data.DataRowVersion.Current, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_UserCode", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "UserCode", global::System.Data.DataRowVersion.Original, false, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Username", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Original, true, null)); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Username", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Username", global::System.Data.DataRowVersion.Original, false, null)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.OleDb.OleDbConnection(); + this._connection.ConnectionString = global::MyShop.Properties.Settings.Default.MyShopConnectionString1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1]; + this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT UserCode, Username, [Password] FROM Users"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(MyShopDataSet.UsersDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual MyShopDataSet.UsersDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + MyShopDataSet.UsersDataTable dataTable = new MyShopDataSet.UsersDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet.UsersDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(MyShopDataSet dataSet) { + return this.Adapter.Update(dataSet, "Users"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] + public virtual int Delete(int Original_UserCode, string Original_Username) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_UserCode)); + if ((Original_Username == null)) { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_Username)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; + if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.DeleteCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.DeleteCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] + public virtual int Insert(string Username, string Password) { + if ((Username == null)) { + this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(Username)); + } + if ((Password == null)) { + this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Password)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; + if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.InsertCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.InsertCommand.Connection.Close(); + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] + public virtual int Update(string Username, string Password, int Original_UserCode, string Original_Username) { + if ((Username == null)) { + this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(Username)); + } + if ((Password == null)) { + this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Password)); + } + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(Original_UserCode)); + if ((Original_Username == null)) { + this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; + } + else { + this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_Username)); + } + global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; + if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + this.Adapter.UpdateCommand.Connection.Open(); + } + try { + int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); + return returnValue; + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + this.Adapter.UpdateCommand.Connection.Close(); + } + } + } + } + + /// + ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" + + "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")] + public partial class TableAdapterManager : global::System.ComponentModel.Component { + + private UpdateOrderOption _updateOrder; + + private CustomersTableAdapter _customersTableAdapter; + + private FactorItemsTableAdapter _factorItemsTableAdapter; + + private FactorsTableAdapter _factorsTableAdapter; + + private GoodsTableAdapter _goodsTableAdapter; + + private UsersTableAdapter _usersTableAdapter; + + private bool _backupDataSetBeforeUpdate; + + private global::System.Data.IDbConnection _connection; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public UpdateOrderOption UpdateOrder { + get { + return this._updateOrder; + } + set { + this._updateOrder = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public CustomersTableAdapter CustomersTableAdapter { + get { + return this._customersTableAdapter; + } + set { + this._customersTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public FactorItemsTableAdapter FactorItemsTableAdapter { + get { + return this._factorItemsTableAdapter; + } + set { + this._factorItemsTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public FactorsTableAdapter FactorsTableAdapter { + get { + return this._factorsTableAdapter; + } + set { + this._factorsTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public GoodsTableAdapter GoodsTableAdapter { + get { + return this._goodsTableAdapter; + } + set { + this._goodsTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public UsersTableAdapter UsersTableAdapter { + get { + return this._usersTableAdapter; + } + set { + this._usersTableAdapter = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool BackupDataSetBeforeUpdate { + get { + return this._backupDataSetBeforeUpdate; + } + set { + this._backupDataSetBeforeUpdate = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public global::System.Data.IDbConnection Connection { + get { + if ((this._connection != null)) { + return this._connection; + } + if (((this._customersTableAdapter != null) + && (this._customersTableAdapter.Connection != null))) { + return this._customersTableAdapter.Connection; + } + if (((this._factorItemsTableAdapter != null) + && (this._factorItemsTableAdapter.Connection != null))) { + return this._factorItemsTableAdapter.Connection; + } + if (((this._factorsTableAdapter != null) + && (this._factorsTableAdapter.Connection != null))) { + return this._factorsTableAdapter.Connection; + } + if (((this._goodsTableAdapter != null) + && (this._goodsTableAdapter.Connection != null))) { + return this._goodsTableAdapter.Connection; + } + if (((this._usersTableAdapter != null) + && (this._usersTableAdapter.Connection != null))) { + return this._usersTableAdapter.Connection; + } + return null; + } + set { + this._connection = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int TableAdapterInstanceCount { + get { + int count = 0; + if ((this._customersTableAdapter != null)) { + count = (count + 1); + } + if ((this._factorItemsTableAdapter != null)) { + count = (count + 1); + } + if ((this._factorsTableAdapter != null)) { + count = (count + 1); + } + if ((this._goodsTableAdapter != null)) { + count = (count + 1); + } + if ((this._usersTableAdapter != null)) { + count = (count + 1); + } + return count; + } + } + + /// + ///Update rows in top-down order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateUpdatedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allChangedRows, global::System.Collections.Generic.List allAddedRows) { + int result = 0; + if ((this._customersTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Customers.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._customersTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + if ((this._factorsTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Factors.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._factorsTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + if ((this._factorItemsTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.FactorItems.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._factorItemsTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + if ((this._usersTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Users.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._usersTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } + return result; + } + + /// + ///Insert rows in top-down order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateInsertedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allAddedRows) { + int result = 0; + if ((this._customersTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Customers.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._customersTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + if ((this._factorsTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Factors.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._factorsTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + if ((this._factorItemsTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.FactorItems.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._factorItemsTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + if ((this._usersTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Users.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._usersTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } + return result; + } + + /// + ///Delete rows in bottom-up order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private int UpdateDeletedRows(MyShopDataSet dataSet, global::System.Collections.Generic.List allChangedRows) { + int result = 0; + if ((this._usersTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Users.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._usersTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + if ((this._factorItemsTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.FactorItems.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._factorItemsTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + if ((this._goodsTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Goods.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._goodsTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + if ((this._factorsTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Factors.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._factorsTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + if ((this._customersTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Customers.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._customersTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } + return result; + } + + /// + ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List allAddedRows) { + if (((updatedRows == null) + || (updatedRows.Length < 1))) { + return updatedRows; + } + if (((allAddedRows == null) + || (allAddedRows.Count < 1))) { + return updatedRows; + } + global::System.Collections.Generic.List realUpdatedRows = new global::System.Collections.Generic.List(); + for (int i = 0; (i < updatedRows.Length); i = (i + 1)) { + global::System.Data.DataRow row = updatedRows[i]; + if ((allAddedRows.Contains(row) == false)) { + realUpdatedRows.Add(row); + } + } + return realUpdatedRows.ToArray(); + } + + /// + ///Update all changes to the dataset. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public virtual int UpdateAll(MyShopDataSet dataSet) { + if ((dataSet == null)) { + throw new global::System.ArgumentNullException("dataSet"); + } + if ((dataSet.HasChanges() == false)) { + return 0; + } + if (((this._customersTableAdapter != null) + && (this.MatchTableAdapterConnection(this._customersTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + if (((this._factorItemsTableAdapter != null) + && (this.MatchTableAdapterConnection(this._factorItemsTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + if (((this._factorsTableAdapter != null) + && (this.MatchTableAdapterConnection(this._factorsTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + if (((this._goodsTableAdapter != null) + && (this.MatchTableAdapterConnection(this._goodsTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + if (((this._usersTableAdapter != null) + && (this.MatchTableAdapterConnection(this._usersTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } + global::System.Data.IDbConnection workConnection = this.Connection; + if ((workConnection == null)) { + throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" + + "ger TableAdapter property to a valid TableAdapter instance."); + } + bool workConnOpened = false; + if (((workConnection.State & global::System.Data.ConnectionState.Broken) + == global::System.Data.ConnectionState.Broken)) { + workConnection.Close(); + } + if ((workConnection.State == global::System.Data.ConnectionState.Closed)) { + workConnection.Open(); + workConnOpened = true; + } + global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction(); + if ((workTransaction == null)) { + throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" + + "ctions or the current state is not allowing the transaction to begin."); + } + global::System.Collections.Generic.List allChangedRows = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.List allAddedRows = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.List adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List(); + global::System.Collections.Generic.Dictionary revertConnections = new global::System.Collections.Generic.Dictionary(); + int result = 0; + global::System.Data.DataSet backupDataSet = null; + if (this.BackupDataSetBeforeUpdate) { + backupDataSet = new global::System.Data.DataSet(); + backupDataSet.Merge(dataSet); + } + try { + // ---- Prepare for update ----------- + // + if ((this._customersTableAdapter != null)) { + revertConnections.Add(this._customersTableAdapter, this._customersTableAdapter.Connection); + this._customersTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._customersTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._customersTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._customersTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._customersTableAdapter.Adapter); + } + } + if ((this._factorItemsTableAdapter != null)) { + revertConnections.Add(this._factorItemsTableAdapter, this._factorItemsTableAdapter.Connection); + this._factorItemsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._factorItemsTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._factorItemsTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._factorItemsTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._factorItemsTableAdapter.Adapter); + } + } + if ((this._factorsTableAdapter != null)) { + revertConnections.Add(this._factorsTableAdapter, this._factorsTableAdapter.Connection); + this._factorsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._factorsTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._factorsTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._factorsTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._factorsTableAdapter.Adapter); + } + } + if ((this._goodsTableAdapter != null)) { + revertConnections.Add(this._goodsTableAdapter, this._goodsTableAdapter.Connection); + this._goodsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._goodsTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._goodsTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._goodsTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._goodsTableAdapter.Adapter); + } + } + if ((this._usersTableAdapter != null)) { + revertConnections.Add(this._usersTableAdapter, this._usersTableAdapter.Connection); + this._usersTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(workConnection)); + this._usersTableAdapter.Transaction = ((global::System.Data.OleDb.OleDbTransaction)(workTransaction)); + if (this._usersTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._usersTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._usersTableAdapter.Adapter); + } + } + // + //---- Perform updates ----------- + // + if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) { + result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); + result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); + } + else { + result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); + result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); + } + result = (result + this.UpdateDeletedRows(dataSet, allChangedRows)); + // + //---- Commit updates ----------- + // + workTransaction.Commit(); + if ((0 < allAddedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; + allAddedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + } + } + if ((0 < allChangedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count]; + allChangedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + } + } + } + catch (global::System.Exception ex) { + workTransaction.Rollback(); + // ---- Restore the dataset ----------- + if (this.BackupDataSetBeforeUpdate) { + global::System.Diagnostics.Debug.Assert((backupDataSet != null)); + dataSet.Clear(); + dataSet.Merge(backupDataSet); + } + else { + if ((0 < allAddedRows.Count)) { + global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; + allAddedRows.CopyTo(rows); + for (int i = 0; (i < rows.Length); i = (i + 1)) { + global::System.Data.DataRow row = rows[i]; + row.AcceptChanges(); + row.SetAdded(); + } + } + } + throw ex; + } + finally { + if (workConnOpened) { + workConnection.Close(); + } + if ((this._customersTableAdapter != null)) { + this._customersTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._customersTableAdapter])); + this._customersTableAdapter.Transaction = null; + } + if ((this._factorItemsTableAdapter != null)) { + this._factorItemsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._factorItemsTableAdapter])); + this._factorItemsTableAdapter.Transaction = null; + } + if ((this._factorsTableAdapter != null)) { + this._factorsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._factorsTableAdapter])); + this._factorsTableAdapter.Transaction = null; + } + if ((this._goodsTableAdapter != null)) { + this._goodsTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._goodsTableAdapter])); + this._goodsTableAdapter.Transaction = null; + } + if ((this._usersTableAdapter != null)) { + this._usersTableAdapter.Connection = ((global::System.Data.OleDb.OleDbConnection)(revertConnections[this._usersTableAdapter])); + this._usersTableAdapter.Transaction = null; + } + if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { + global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; + adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); + for (int i = 0; (i < adapters.Length); i = (i + 1)) { + global::System.Data.Common.DataAdapter adapter = adapters[i]; + adapter.AcceptChangesDuringUpdate = true; + } + } + } + return result; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) { + global::System.Array.Sort(rows, new SelfReferenceComparer(relation, childFirst)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) { + if ((this._connection != null)) { + return true; + } + if (((this.Connection == null) + || (inputConnection == null))) { + return true; + } + if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) { + return true; + } + return false; + } + + /// + ///Update Order Option + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public enum UpdateOrderOption { + + InsertUpdateDelete = 0, + + UpdateInsertDelete = 1, + } + + /// + ///Used to sort self-referenced table's rows + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer { + + private global::System.Data.DataRelation _relation; + + private int _childFirst; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) { + this._relation = relation; + if (childFirst) { + this._childFirst = -1; + } + else { + this._childFirst = 1; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) { + global::System.Diagnostics.Debug.Assert((row != null)); + global::System.Data.DataRow root = row; + distance = 0; + + global::System.Collections.Generic.IDictionary traversedRows = new global::System.Collections.Generic.Dictionary(); + traversedRows[row] = row; + + global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); + for ( + ; ((parent != null) + && (traversedRows.ContainsKey(parent) == false)); + ) { + distance = (distance + 1); + root = parent; + traversedRows[parent] = parent; + parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); + } + + if ((distance == 0)) { + traversedRows.Clear(); + traversedRows[row] = row; + parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); + for ( + ; ((parent != null) + && (traversedRows.ContainsKey(parent) == false)); + ) { + distance = (distance + 1); + root = parent; + traversedRows[parent] = parent; + parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); + } + } + + return root; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) { + if (object.ReferenceEquals(row1, row2)) { + return 0; + } + if ((row1 == null)) { + return -1; + } + if ((row2 == null)) { + return 1; + } + + int distance1 = 0; + global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1); + + int distance2 = 0; + global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2); + + if (object.ReferenceEquals(root1, root2)) { + return (this._childFirst * distance1.CompareTo(distance2)); + } + else { + global::System.Diagnostics.Debug.Assert(((root1.Table != null) + && (root2.Table != null))); + if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) { + return -1; + } + else { + return 1; + } + } + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/MyShop/MyShopDataSet1.xsc b/MyShop/MyShopDataSet1.xsc new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/MyShop/MyShopDataSet1.xsc @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/MyShop/MyShopDataSet1.xsd b/MyShop/MyShopDataSet1.xsd new file mode 100644 index 0000000..3d1d16e --- /dev/null +++ b/MyShop/MyShopDataSet1.xsd @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + DELETE FROM `Customers` WHERE ((`CustomerCode` = ?) AND ((? = 1 AND `CustomerFirstName` IS NULL) OR (`CustomerFirstName` = ?)) AND ((? = 1 AND `CustomerLastName` IS NULL) OR (`CustomerLastName` = ?)) AND ((? = 1 AND `CustomerMobile` IS NULL) OR (`CustomerMobile` = ?))) + + + + + + + + + + + + + + INSERT INTO `Customers` (`CustomerFirstName`, `CustomerLastName`, `CustomerMobile`) VALUES (?, ?, ?) + + + + + + + + + + SELECT CustomerCode, CustomerFirstName, CustomerLastName, CustomerMobile FROM Customers + + + + + + UPDATE `Customers` SET `CustomerFirstName` = ?, `CustomerLastName` = ?, `CustomerMobile` = ? WHERE ((`CustomerCode` = ?) AND ((? = 1 AND `CustomerFirstName` IS NULL) OR (`CustomerFirstName` = ?)) AND ((? = 1 AND `CustomerLastName` IS NULL) OR (`CustomerLastName` = ?)) AND ((? = 1 AND `CustomerMobile` IS NULL) OR (`CustomerMobile` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM `FactorItems` WHERE (((? = 1 AND `FactorCode` IS NULL) OR (`FactorCode` = ?)) AND (`GoodsCode` = ?) AND ((? = 1 AND `GoodsAmount` IS NULL) OR (`GoodsAmount` = ?))) + + + + + + + + + + + + INSERT INTO `FactorItems` (`FactorCode`, `GoodsCode`, `GoodsAmount`) VALUES (?, ?, ?) + + + + + + + + + + SELECT FactorCode, GoodsCode, GoodsAmount FROM FactorItems + + + + + + UPDATE `FactorItems` SET `FactorCode` = ?, `GoodsCode` = ?, `GoodsAmount` = ? WHERE (((? = 1 AND `FactorCode` IS NULL) OR (`FactorCode` = ?)) AND (`GoodsCode` = ?) AND ((? = 1 AND `GoodsAmount` IS NULL) OR (`GoodsAmount` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM `Factors` WHERE ((`FactorCode` = ?) AND ((? = 1 AND `CustomerCode` IS NULL) OR (`CustomerCode` = ?)) AND ((? = 1 AND `FactorDate` IS NULL) OR (`FactorDate` = ?))) + + + + + + + + + + + + INSERT INTO `Factors` (`CustomerCode`, `FactorDate`) VALUES (?, ?) + + + + + + + + + SELECT FactorCode, CustomerCode, FactorDate FROM Factors + + + + + + UPDATE `Factors` SET `CustomerCode` = ?, `FactorDate` = ? WHERE ((`FactorCode` = ?) AND ((? = 1 AND `CustomerCode` IS NULL) OR (`CustomerCode` = ?)) AND ((? = 1 AND `FactorDate` IS NULL) OR (`FactorDate` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM `Goods` WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?))) + + + + + + + + + + + + + + INSERT INTO `Goods` (`GoodsName`, `GoodsUnitPrice`, `GoodsStock`) VALUES (?, ?, ?) + + + + + + + + + + SELECT GoodsCode, GoodsName, GoodsUnitPrice, GoodsStock FROM Goods + + + + + + UPDATE `Goods` SET `GoodsName` = ?, `GoodsUnitPrice` = ?, `GoodsStock` = ? WHERE ((`GoodsCode` = ?) AND ((? = 1 AND `GoodsName` IS NULL) OR (`GoodsName` = ?)) AND ((? = 1 AND `GoodsUnitPrice` IS NULL) OR (`GoodsUnitPrice` = ?)) AND ((? = 1 AND `GoodsStock` IS NULL) OR (`GoodsStock` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM `Users` WHERE ((`UserCode` = ?) AND ((? = 1 AND `Username` IS NULL) OR (`Username` = ?))) + + + + + + + + + + INSERT INTO `Users` (`Username`, `Password`) VALUES (?, ?) + + + + + + + + + SELECT UserCode, Username, [Password] FROM Users + + + + + + UPDATE `Users` SET `Username` = ?, `Password` = ? WHERE ((`UserCode` = ?) AND ((? = 1 AND `Username` IS NULL) OR (`Username` = ?))) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/MyShopDataSet1.xss b/MyShop/MyShopDataSet1.xss new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/MyShop/MyShopDataSet1.xss @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/MyShop/MyShopDataSetExtensions.cs b/MyShop/MyShopDataSetExtensions.cs new file mode 100644 index 0000000..f92dc2d --- /dev/null +++ b/MyShop/MyShopDataSetExtensions.cs @@ -0,0 +1,472 @@ +using System.Data; +using System.Data.OleDb; + +namespace MyShop.MyShopDataSetTableAdapters +{ + public partial class CustomersTableAdapter + { + public virtual int InsertCustomerQuery(string firstName, string lastName, string mobile) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "INSERT INTO [Customers] ([CustomerFirstName], [CustomerLastName], [CustomerMobile]) VALUES (?, ?, ?)"; + command.Parameters.Add("CustomerFirstName", OleDbType.VarWChar).Value = firstName; + command.Parameters.Add("CustomerLastName", OleDbType.VarWChar).Value = lastName; + command.Parameters.Add("CustomerMobile", OleDbType.VarWChar).Value = mobile; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int UpdateCustomerQuery(string firstName, string lastName, string mobile, int customerCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "UPDATE [Customers] SET [CustomerFirstName] = ?, [CustomerLastName] = ?, [CustomerMobile] = ? WHERE ([CustomerCode] = ?)"; + command.Parameters.Add("CustomerFirstName", OleDbType.VarWChar).Value = firstName; + command.Parameters.Add("CustomerLastName", OleDbType.VarWChar).Value = lastName; + command.Parameters.Add("CustomerMobile", OleDbType.VarWChar).Value = mobile; + command.Parameters.Add("CustomerCode", OleDbType.Integer).Value = customerCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int DeleteCustomerQuery(int customerCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "DELETE FROM [Customers] WHERE ([CustomerCode] = ?)"; + command.Parameters.Add("CustomerCode", OleDbType.Integer).Value = customerCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int FillByCustomerCode(MyShopDataSet.CustomersDataTable dataTable, int customerCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "SELECT [CustomerCode], [CustomerFirstName], [CustomerLastName], [CustomerMobile] FROM [Customers] WHERE ([CustomerCode] = ?)"; + command.Parameters.Add("CustomerCode", OleDbType.Integer).Value = customerCode; + + this.Adapter.SelectCommand = command; + + if (this.ClearBeforeFill) + { + dataTable.Clear(); + } + + return this.Adapter.Fill(dataTable); + } + } + + public virtual int FillByCustomerName(MyShopDataSet.CustomersDataTable dataTable, string customerName) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "SELECT [CustomerCode], [CustomerFirstName], [CustomerLastName], [CustomerMobile] FROM [Customers] WHERE ([CustomerFirstName] LIKE ?) OR ([CustomerLastName] LIKE ?)"; + command.Parameters.Add("CustomerFirstName", OleDbType.VarWChar).Value = "%" + customerName + "%"; + command.Parameters.Add("CustomerLastName", OleDbType.VarWChar).Value = "%" + customerName + "%"; + + this.Adapter.SelectCommand = command; + + if (this.ClearBeforeFill) + { + dataTable.Clear(); + } + + return this.Adapter.Fill(dataTable); + } + } + } + + public partial class FactorsTableAdapter + { + public virtual int InsertQuery(int customerCode, System.DateTime factorDate) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "INSERT INTO [Factors] ([CustomerCode], [FactorDate]) VALUES (?, ?)"; + command.Parameters.Add("CustomerCode", OleDbType.Integer).Value = customerCode; + command.Parameters.Add("FactorDate", OleDbType.Date).Value = factorDate; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + command.ExecuteNonQuery(); + command.CommandText = "SELECT @@IDENTITY"; + command.Parameters.Clear(); + return System.Convert.ToInt32(command.ExecuteScalar()); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + } + + public partial class FactorItemsTableAdapter + { + public virtual int InsertQuery(int factorCode, int goodsCode, int goodsAmount) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "INSERT INTO [FactorItems] ([FactorCode], [GoodsCode], [GoodsAmount]) VALUES (?, ?, ?)"; + command.Parameters.Add("FactorCode", OleDbType.Integer).Value = factorCode; + command.Parameters.Add("GoodsCode", OleDbType.Integer).Value = goodsCode; + command.Parameters.Add("GoodsAmount", OleDbType.Integer).Value = goodsAmount; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + } + + public partial class GoodsTableAdapter + { + public virtual int InsertQuery(int goodsCode, string goodsName, int goodsUnitPrice, int goodsStock) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "INSERT INTO [Goods] ([GoodsCode], [GoodsName], [GoodsUnitPrice], [GoodsStock]) VALUES (?, ?, ?, ?)"; + command.Parameters.Add("GoodsCode", OleDbType.Integer).Value = goodsCode; + command.Parameters.Add("GoodsName", OleDbType.VarWChar).Value = goodsName; + command.Parameters.Add("GoodsUnitPrice", OleDbType.Integer).Value = goodsUnitPrice; + command.Parameters.Add("GoodsStock", OleDbType.Integer).Value = goodsStock; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int DeleteQuery(int goodsCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "DELETE FROM [Goods] WHERE ([GoodsCode] = ?)"; + command.Parameters.Add("GoodsCode", OleDbType.Integer).Value = goodsCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int UpdateQuery(string goodsName, int goodsUnitPrice, int goodsStock, int goodsCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "UPDATE [Goods] SET [GoodsName] = ?, [GoodsUnitPrice] = ?, [GoodsStock] = ? WHERE ([GoodsCode] = ?)"; + command.Parameters.Add("GoodsName", OleDbType.VarWChar).Value = goodsName; + command.Parameters.Add("GoodsUnitPrice", OleDbType.Integer).Value = goodsUnitPrice; + command.Parameters.Add("GoodsStock", OleDbType.Integer).Value = goodsStock; + command.Parameters.Add("GoodsCode", OleDbType.Integer).Value = goodsCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int FillByGoodsCode(MyShopDataSet.GoodsDataTable dataTable, int goodsCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "SELECT [GoodsCode], [GoodsName], [GoodsUnitPrice], [GoodsStock] FROM [Goods] WHERE ([GoodsCode] = ?)"; + command.Parameters.Add("GoodsCode", OleDbType.Integer).Value = goodsCode; + + this.Adapter.SelectCommand = command; + + if (this.ClearBeforeFill) + { + dataTable.Clear(); + } + + return this.Adapter.Fill(dataTable); + } + } + + public virtual int FillByGoodsName(MyShopDataSet.GoodsDataTable dataTable, string goodsName) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "SELECT [GoodsCode], [GoodsName], [GoodsUnitPrice], [GoodsStock] FROM [Goods] WHERE ([GoodsName] LIKE ?)"; + command.Parameters.Add("GoodsName", OleDbType.VarWChar).Value = "%" + goodsName + "%"; + + this.Adapter.SelectCommand = command; + + if (this.ClearBeforeFill) + { + dataTable.Clear(); + } + + return this.Adapter.Fill(dataTable); + } + } + } + + public partial class UsersTableAdapter + { + public virtual int InsertUserQuery(string userName, string password) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "INSERT INTO [Users] ([Username], [Password]) VALUES (?, ?)"; + command.Parameters.Add("Username", OleDbType.VarWChar).Value = userName; + command.Parameters.Add("Password", OleDbType.LongVarWChar).Value = password; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int UpdateUserQuery(string userName, string password, int userCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "UPDATE [Users] SET [Username] = ?, [Password] = ? WHERE ([UserCode] = ?)"; + command.Parameters.Add("Username", OleDbType.VarWChar).Value = userName; + command.Parameters.Add("Password", OleDbType.LongVarWChar).Value = password; + command.Parameters.Add("UserCode", OleDbType.Integer).Value = userCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int DeleteUserQuery(int userCode) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "DELETE FROM [Users] WHERE ([UserCode] = ?)"; + command.Parameters.Add("UserCode", OleDbType.Integer).Value = userCode; + + ConnectionState previousConnectionState = command.Connection.State; + + if ((command.Connection.State & ConnectionState.Open) != ConnectionState.Open) + { + command.Connection.Open(); + } + + try + { + return command.ExecuteNonQuery(); + } + finally + { + if (previousConnectionState == ConnectionState.Closed) + { + command.Connection.Close(); + } + } + } + } + + public virtual int FillByUserNameAndPass(MyShopDataSet.UsersDataTable dataTable, string userName, string password) + { + using (OleDbCommand command = new OleDbCommand()) + { + command.Connection = this.Connection; + command.CommandType = CommandType.Text; + command.CommandText = "SELECT [UserCode], [Username], [Password] FROM [Users] WHERE ([Username] = ?) AND ([Password] = ?)"; + command.Parameters.Add("Username", OleDbType.VarWChar).Value = userName; + command.Parameters.Add("Password", OleDbType.LongVarWChar).Value = password; + + this.Adapter.SelectCommand = command; + + if (this.ClearBeforeFill) + { + dataTable.Clear(); + } + + return this.Adapter.Fill(dataTable); + } + } + } +} diff --git a/MyShop/Program.cs b/MyShop/Program.cs new file mode 100644 index 0000000..23716a2 --- /dev/null +++ b/MyShop/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MyShop +{ + static class Program + { + /// + /// نقطه شروع اصلی برنامه + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new LoginForm()); + } + } +} diff --git a/MyShop/Properties/AssemblyInfo.cs b/MyShop/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d3328a9 --- /dev/null +++ b/MyShop/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyShop")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyShop")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fea5bc9d-2b8d-4b00-a5ea-4e7678077d1e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MyShop/Properties/Resources.Designer.cs b/MyShop/Properties/Resources.Designer.cs new file mode 100644 index 0000000..1c66e35 --- /dev/null +++ b/MyShop/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MyShop.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyShop.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap LoginIcon { + get { + object obj = ResourceManager.GetObject("LoginIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/MyShop/Properties/Resources.resx b/MyShop/Properties/Resources.resx new file mode 100644 index 0000000..cb55e7e --- /dev/null +++ b/MyShop/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\LoginIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/MyShop/Properties/Settings.Designer.cs b/MyShop/Properties/Settings.Designer.cs new file mode 100644 index 0000000..09e74f7 --- /dev/null +++ b/MyShop/Properties/Settings.Designer.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MyShop.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] + [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\MyShop.mdb")] + public string MyShopConnectionString { + get { + return ((string)(this["MyShopConnectionString"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] + [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\MyShop.mdb")] + public string MyShopConnectionString1 { + get { + return ((string)(this["MyShopConnectionString1"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SavedUserName { + get { + return ((string)(this["SavedUserName"])); + } + set { + this["SavedUserName"] = value; + } + } + } +} diff --git a/MyShop/Properties/Settings.settings b/MyShop/Properties/Settings.settings new file mode 100644 index 0000000..519368a --- /dev/null +++ b/MyShop/Properties/Settings.settings @@ -0,0 +1,25 @@ + + + + + + <?xml version="1.0" encoding="utf-16"?> +<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyShop.mdb</ConnectionString> + <ProviderName>System.Data.OleDb</ProviderName> +</SerializableConnectionString> + Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyShop.mdb + + + <?xml version="1.0" encoding="utf-16"?> +<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyShop.mdb</ConnectionString> + <ProviderName>System.Data.OleDb</ProviderName> +</SerializableConnectionString> + Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyShop.mdb + + + + + + diff --git a/MyShop/bin/Debug/Log.txt b/MyShop/bin/Debug/Log.txt new file mode 100644 index 0000000..ff64160 --- /dev/null +++ b/MyShop/bin/Debug/Log.txt @@ -0,0 +1,6 @@ +ورود مدیر: 2026/06/09 13:07:08 +ورود مدیر: 2026/06/09 13:19:09 +ورود مدیر: 2026/06/09 13:20:54 +ورود مدیر: 2026/06/09 13:28:28 +ورود ناموفق: 2026/06/09 13:31:40 - نام کاربری وارد شده: admin +ورود مدیر: 2026/06/09 13:31:50 diff --git a/MyShop/bin/Debug/MyShop.exe b/MyShop/bin/Debug/MyShop.exe new file mode 100644 index 0000000..731e940 Binary files /dev/null and b/MyShop/bin/Debug/MyShop.exe differ diff --git a/MyShop/bin/Debug/MyShop.exe.config b/MyShop/bin/Debug/MyShop.exe.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/bin/Debug/MyShop.exe.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/bin/Debug/MyShop.ldb b/MyShop/bin/Debug/MyShop.ldb new file mode 100644 index 0000000..6550e2d Binary files /dev/null and b/MyShop/bin/Debug/MyShop.ldb differ diff --git a/MyShop/bin/Debug/MyShop.mdb b/MyShop/bin/Debug/MyShop.mdb new file mode 100644 index 0000000..674f80f Binary files /dev/null and b/MyShop/bin/Debug/MyShop.mdb differ diff --git a/MyShop/bin/Debug/MyShop.pdb b/MyShop/bin/Debug/MyShop.pdb new file mode 100644 index 0000000..ef3f2e0 Binary files /dev/null and b/MyShop/bin/Debug/MyShop.pdb differ diff --git a/MyShop/bin/Debug/MyShop.vshost.exe b/MyShop/bin/Debug/MyShop.vshost.exe new file mode 100644 index 0000000..c0dfecc Binary files /dev/null and b/MyShop/bin/Debug/MyShop.vshost.exe differ diff --git a/MyShop/bin/Debug/MyShop.vshost.exe.config b/MyShop/bin/Debug/MyShop.vshost.exe.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/bin/Debug/MyShop.vshost.exe.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/bin/Debug/MyShop.vshost.exe.manifest b/MyShop/bin/Debug/MyShop.vshost.exe.manifest new file mode 100644 index 0000000..f96b1d6 --- /dev/null +++ b/MyShop/bin/Debug/MyShop.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/MyShop/bin/Release/Log.txt b/MyShop/bin/Release/Log.txt new file mode 100644 index 0000000..f19b5e8 --- /dev/null +++ b/MyShop/bin/Release/Log.txt @@ -0,0 +1,2 @@ +ورود ناموفق: 2026/06/09 13:47:15 - نام کاربری وارد شده: admin +ورود مدیر: 2026/06/09 13:47:56 diff --git a/MyShop/bin/Release/MyShop.exe b/MyShop/bin/Release/MyShop.exe new file mode 100644 index 0000000..a14b78b Binary files /dev/null and b/MyShop/bin/Release/MyShop.exe differ diff --git a/MyShop/bin/Release/MyShop.exe.config b/MyShop/bin/Release/MyShop.exe.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/bin/Release/MyShop.exe.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/bin/Release/MyShop.mdb b/MyShop/bin/Release/MyShop.mdb new file mode 100644 index 0000000..c6cd338 Binary files /dev/null and b/MyShop/bin/Release/MyShop.mdb differ diff --git a/MyShop/bin/Release/MyShop.pdb b/MyShop/bin/Release/MyShop.pdb new file mode 100644 index 0000000..e9efacf Binary files /dev/null and b/MyShop/bin/Release/MyShop.pdb differ diff --git a/MyShop/bin/Release/MyShop.vshost.exe b/MyShop/bin/Release/MyShop.vshost.exe new file mode 100644 index 0000000..c0dfecc Binary files /dev/null and b/MyShop/bin/Release/MyShop.vshost.exe differ diff --git a/MyShop/bin/Release/MyShop.vshost.exe.config b/MyShop/bin/Release/MyShop.vshost.exe.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/bin/Release/MyShop.vshost.exe.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/bin/Release/MyShop.vshost.exe.manifest b/MyShop/bin/Release/MyShop.vshost.exe.manifest new file mode 100644 index 0000000..f96b1d6 --- /dev/null +++ b/MyShop/bin/Release/MyShop.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/MyShop/db/MyShop.accdb b/MyShop/db/MyShop.accdb new file mode 100644 index 0000000..04d768e Binary files /dev/null and b/MyShop/db/MyShop.accdb differ diff --git a/MyShop/db/MyShop.mdb b/MyShop/db/MyShop.mdb new file mode 100644 index 0000000..11f260b Binary files /dev/null and b/MyShop/db/MyShop.mdb differ diff --git a/MyShop/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/MyShop/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..54e47b4 Binary files /dev/null and b/MyShop/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/MyShop/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/MyShop/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..9be6229 Binary files /dev/null and b/MyShop/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/MyShop/obj/Debug/MyShop.LoginForm.resources b/MyShop/obj/Debug/MyShop.LoginForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.LoginForm.resources differ diff --git a/MyShop/obj/Debug/MyShop.MainForm.resources b/MyShop/obj/Debug/MyShop.MainForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.MainForm.resources differ diff --git a/MyShop/obj/Debug/MyShop.Properties.Resources.resources b/MyShop/obj/Debug/MyShop.Properties.Resources.resources new file mode 100644 index 0000000..3e1b0da Binary files /dev/null and b/MyShop/obj/Debug/MyShop.Properties.Resources.resources differ diff --git a/MyShop/obj/Debug/MyShop.csproj.FileListAbsolute.txt b/MyShop/obj/Debug/MyShop.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5e5f0e4 --- /dev/null +++ b/MyShop/obj/Debug/MyShop.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +c:\users\arshia e\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Debug\MyShop.exe.config +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\bin\Debug\MyShop.exe +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.csprojResolveAssemblyReference.cache +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.Properties.Resources.resources +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.csproj.GenerateResource.Cache +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.exe +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.pdb +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Verify\MyShop.exe.config +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Verify\MyShop.exe +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Verify\MyShop.pdb +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Debug\MyShop.pdb +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.MainForm.resources +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Debug\MyShop.mdb +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Debug\MyShop.LoginForm.resources +C:\Users\Arshia E\Documents\Visual Studio 2013\Projects\MyShop\MyShop\obj\Verify\MyShop.mdb diff --git a/MyShop/obj/Debug/MyShop.csproj.GenerateResource.Cache b/MyShop/obj/Debug/MyShop.csproj.GenerateResource.Cache new file mode 100644 index 0000000..af4dd12 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.csproj.GenerateResource.Cache differ diff --git a/MyShop/obj/Debug/MyShop.csprojResolveAssemblyReference.cache b/MyShop/obj/Debug/MyShop.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..b2e5cd7 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.csprojResolveAssemblyReference.cache differ diff --git a/MyShop/obj/Debug/MyShop.exe b/MyShop/obj/Debug/MyShop.exe new file mode 100644 index 0000000..731e940 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.exe differ diff --git a/MyShop/obj/Debug/MyShop.pdb b/MyShop/obj/Debug/MyShop.pdb new file mode 100644 index 0000000..ef3f2e0 Binary files /dev/null and b/MyShop/obj/Debug/MyShop.pdb differ diff --git a/MyShop/obj/Debug/TempPE/MyShopDataSet.Designer.cs.dll b/MyShop/obj/Debug/TempPE/MyShopDataSet.Designer.cs.dll new file mode 100644 index 0000000..c1afaa5 Binary files /dev/null and b/MyShop/obj/Debug/TempPE/MyShopDataSet.Designer.cs.dll differ diff --git a/MyShop/obj/Debug/TempPE/MyShopDataSet1.Designer.cs.dll b/MyShop/obj/Debug/TempPE/MyShopDataSet1.Designer.cs.dll new file mode 100644 index 0000000..df72a0c Binary files /dev/null and b/MyShop/obj/Debug/TempPE/MyShopDataSet1.Designer.cs.dll differ diff --git a/MyShop/obj/Debug/TempPE/MyShopMainDataSet.Designer.cs.dll b/MyShop/obj/Debug/TempPE/MyShopMainDataSet.Designer.cs.dll new file mode 100644 index 0000000..0250c18 Binary files /dev/null and b/MyShop/obj/Debug/TempPE/MyShopMainDataSet.Designer.cs.dll differ diff --git a/MyShop/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/MyShop/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..4e7ebfe Binary files /dev/null and b/MyShop/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/MyShop/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/MyShop/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/MyShop/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/MyShop/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/MyShop/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..9e30de5 Binary files /dev/null and b/MyShop/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/MyShop/obj/Release/MyShop.LoginForm.resources b/MyShop/obj/Release/MyShop.LoginForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MyShop/obj/Release/MyShop.LoginForm.resources differ diff --git a/MyShop/obj/Release/MyShop.MainForm.resources b/MyShop/obj/Release/MyShop.MainForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MyShop/obj/Release/MyShop.MainForm.resources differ diff --git a/MyShop/obj/Release/MyShop.Properties.Resources.resources b/MyShop/obj/Release/MyShop.Properties.Resources.resources new file mode 100644 index 0000000..3e1b0da Binary files /dev/null and b/MyShop/obj/Release/MyShop.Properties.Resources.resources differ diff --git a/MyShop/obj/Release/MyShop.csproj.FileListAbsolute.txt b/MyShop/obj/Release/MyShop.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..285b3f7 --- /dev/null +++ b/MyShop/obj/Release/MyShop.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Release\MyShop.exe.config +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Release\MyShop.mdb +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Release\MyShop.exe +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\bin\Release\MyShop.pdb +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.LoginForm.resources +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.MainForm.resources +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.Properties.Resources.resources +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.csproj.GenerateResource.Cache +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.exe +C:\Users\Arshia E\documents\visual studio 2013\Projects\MyShop\MyShop\obj\Release\MyShop.pdb diff --git a/MyShop/obj/Release/MyShop.csproj.GenerateResource.Cache b/MyShop/obj/Release/MyShop.csproj.GenerateResource.Cache new file mode 100644 index 0000000..af4dd12 Binary files /dev/null and b/MyShop/obj/Release/MyShop.csproj.GenerateResource.Cache differ diff --git a/MyShop/obj/Release/MyShop.exe b/MyShop/obj/Release/MyShop.exe new file mode 100644 index 0000000..a14b78b Binary files /dev/null and b/MyShop/obj/Release/MyShop.exe differ diff --git a/MyShop/obj/Release/MyShop.pdb b/MyShop/obj/Release/MyShop.pdb new file mode 100644 index 0000000..e9efacf Binary files /dev/null and b/MyShop/obj/Release/MyShop.pdb differ diff --git a/MyShop/obj/Release/TempPE/MyShopDataSet1.Designer.cs.dll b/MyShop/obj/Release/TempPE/MyShopDataSet1.Designer.cs.dll new file mode 100644 index 0000000..628467a Binary files /dev/null and b/MyShop/obj/Release/TempPE/MyShopDataSet1.Designer.cs.dll differ diff --git a/MyShop/obj/Release/TempPE/Properties.Resources.Designer.cs.dll b/MyShop/obj/Release/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..c1acf97 Binary files /dev/null and b/MyShop/obj/Release/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/MyShop/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/MyShop/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/MyShop/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/MyShop/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/MyShop/obj/Verify/MyShop.exe b/MyShop/obj/Verify/MyShop.exe new file mode 100644 index 0000000..e0a7319 Binary files /dev/null and b/MyShop/obj/Verify/MyShop.exe differ diff --git a/MyShop/obj/Verify/MyShop.exe.config b/MyShop/obj/Verify/MyShop.exe.config new file mode 100644 index 0000000..dd10de0 --- /dev/null +++ b/MyShop/obj/Verify/MyShop.exe.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MyShop/obj/Verify/MyShop.mdb b/MyShop/obj/Verify/MyShop.mdb new file mode 100644 index 0000000..0ab5b26 Binary files /dev/null and b/MyShop/obj/Verify/MyShop.mdb differ diff --git a/MyShop/obj/Verify/MyShop.pdb b/MyShop/obj/Verify/MyShop.pdb new file mode 100644 index 0000000..b3a64ff Binary files /dev/null and b/MyShop/obj/Verify/MyShop.pdb differ