using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Constraints
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class MainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage tabPage1;
        private C1.Data.C1DataSet c1DataSet1;
        private System.Windows.Forms.Button btnRefresh;
        private System.Windows.Forms.Button btnClose;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.TabPage tabPage2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.Label label11;
        private C1.Win.C1TrueDBGrid.C1TrueDBGrid c1TrueDBGrid1;
        private C1.Win.C1TrueDBGrid.C1TrueDBGrid c1TrueDBGrid2;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public MainForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPage2 = new System.Windows.Forms.TabPage();
            this.c1TrueDBGrid2 = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.c1DataSet1 = new C1.Data.C1DataSet();
            this.label11 = new System.Windows.Forms.Label();
            this.label15 = new System.Windows.Forms.Label();
            this.label14 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.c1TrueDBGrid1 = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.label8 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.btnRefresh = new System.Windows.Forms.Button();
            this.btnClose = new System.Windows.Forms.Button();
            this.tabControl1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.c1TrueDBGrid2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.c1DataSet1)).BeginInit();
            this.tabPage1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.c1TrueDBGrid1)).BeginInit();
            this.SuspendLayout();
            // 
            // tabControl1
            // 
            this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                      this.tabPage2,
                                                                                      this.tabPage1});
            this.tabControl1.Location = new System.Drawing.Point(8, 8);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(468, 352);
            this.tabControl1.TabIndex = 0;
            // 
            // tabPage2
            // 
            this.tabPage2.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                   this.c1TrueDBGrid2,
                                                                                   this.label11,
                                                                                   this.label15,
                                                                                   this.label14,
                                                                                   this.label13,
                                                                                   this.label12,
                                                                                   this.label10,
                                                                                   this.label9,
                                                                                   this.label1});
            this.tabPage2.Location = new System.Drawing.Point(4, 22);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Size = new System.Drawing.Size(460, 326);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "Table Constraints";
            // 
            // c1TrueDBGrid2
            // 
            this.c1TrueDBGrid2.AllowFilter = true;
            this.c1TrueDBGrid2.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.AllRows;
            this.c1TrueDBGrid2.AllowSort = true;
            this.c1TrueDBGrid2.CaptionHeight = 17;
            this.c1TrueDBGrid2.CollapseColor = System.Drawing.Color.Black;
            this.c1TrueDBGrid2.DataChanged = false;
            this.c1TrueDBGrid2.DataMember = "CustomersOrders";
            this.c1TrueDBGrid2.DataSource = this.c1DataSet1;
            this.c1TrueDBGrid2.BackColor = System.Drawing.Color.Empty;
            this.c1TrueDBGrid2.ExpandColor = System.Drawing.Color.Black;
            this.c1TrueDBGrid2.Images.Add(((System.Drawing.Bitmap)(resources.GetObject("resource.Images"))));
            this.c1TrueDBGrid2.Location = new System.Drawing.Point(12, 146);
            this.c1TrueDBGrid2.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.c1TrueDBGrid2.Name = "c1TrueDBGrid2";
            this.c1TrueDBGrid2.PreviewInfo.Location = new System.Drawing.Point(0, 0);
            this.c1TrueDBGrid2.PreviewInfo.Size = new System.Drawing.Size(0, 0);
            this.c1TrueDBGrid2.PreviewInfo.ZoomFactor = 75;
            this.c1TrueDBGrid2.RecordSelectorWidth = 16;
            this.c1TrueDBGrid2.RowHeight = 15;
            this.c1TrueDBGrid2.RowSubDividerColor = System.Drawing.Color.DarkGray;
            this.c1TrueDBGrid2.ScrollTips = false;
            this.c1TrueDBGrid2.Size = new System.Drawing.Size(436, 168);
            this.c1TrueDBGrid2.TabIndex = 10;
            this.c1TrueDBGrid2.Text = "c1TrueDBGrid2";
            this.c1TrueDBGrid2.PropBag = ((string)(resources.GetObject("c1TrueDBGrid2.PropBag")));
            // 
            // c1DataSet1
            // 
            this.c1DataSet1.BindingContextCtrl = null;
            this.c1DataSet1.DataLibrary = "DataLibrary";
            this.c1DataSet1.DataLibraryUrl = "";
            this.c1DataSet1.DataSetDef = "DataSet1";
            this.c1DataSet1.Locale = new System.Globalization.CultureInfo("en-US");
            this.c1DataSet1.SchemaClassName = "DataLibrary.DataClass";
            this.c1DataSet1.SchemaDef = null;
            this.c1DataSet1.SuppressNotifications = false;
            // 
            // label11
            // 
            this.label11.Location = new System.Drawing.Point(12, 120);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(424, 16);
            this.label11.TabIndex = 9;
            this.label11.Text = "Country<>\'Venezuela\' OR RequiredDate>=#3/1/2002#, if OrderDate>#1/1/2002#";
            // 
            // label15
            // 
            this.label15.Location = new System.Drawing.Point(12, 32);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(212, 16);
            this.label15.TabIndex = 8;
            this.label15.Text = "1. SUBSTRING(CompanyName,1,1)<>\'@\'";
            // 
            // label14
            // 
            this.label14.Location = new System.Drawing.Point(184, 76);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(156, 16);
            this.label14.TabIndex = 7;
            this.label14.Text = "2. OrderDate < ShippedDate";
            // 
            // label13
            // 
            this.label13.Location = new System.Drawing.Point(12, 76);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(160, 16);
            this.label13.TabIndex = 6;
            this.label13.Text = "1. OrderDate < RequiredDate";
            // 
            // label12
            // 
            this.label12.Location = new System.Drawing.Point(232, 32);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(216, 16);
            this.label12.TabIndex = 5;
            this.label12.Text = "2. Country<>\'Cuba\'";
            // 
            // label10
            // 
            this.label10.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label10.Location = new System.Drawing.Point(12, 100);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(372, 16);
            this.label10.TabIndex = 3;
            this.label10.Text = "Record level constraints for composite table CustomersOrders:";
            // 
            // label9
            // 
            this.label9.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label9.Location = new System.Drawing.Point(12, 56);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(288, 16);
            this.label9.TabIndex = 2;
            this.label9.Text = "Record level constraints for simple table Orders:";
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label1.Location = new System.Drawing.Point(8, 12);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(300, 16);
            this.label1.TabIndex = 1;
            this.label1.Text = "Field level constraints for simple table Customers:";
            // 
            // tabPage1
            // 
            this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                   this.c1TrueDBGrid1,
                                                                                   this.label8,
                                                                                   this.label7,
                                                                                   this.label6,
                                                                                   this.label5,
                                                                                   this.label4,
                                                                                   this.label3,
                                                                                   this.label2});
            this.tabPage1.Location = new System.Drawing.Point(4, 22);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Size = new System.Drawing.Size(460, 326);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "TableView Constraints";
            // 
            // c1TrueDBGrid1
            // 
            this.c1TrueDBGrid1.AllowFilter = true;
            this.c1TrueDBGrid1.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.AllRows;
            this.c1TrueDBGrid1.AllowSort = true;
            this.c1TrueDBGrid1.CaptionHeight = 17;
            this.c1TrueDBGrid1.CollapseColor = System.Drawing.Color.Black;
            this.c1TrueDBGrid1.DataChanged = false;
            this.c1TrueDBGrid1.DataMember = "Products";
            this.c1TrueDBGrid1.DataSource = this.c1DataSet1;
            this.c1TrueDBGrid1.BackColor = System.Drawing.Color.Empty;
            this.c1TrueDBGrid1.ExpandColor = System.Drawing.Color.Black;
            this.c1TrueDBGrid1.Images.Add(((System.Drawing.Bitmap)(resources.GetObject("resource.Images1"))));
            this.c1TrueDBGrid1.Location = new System.Drawing.Point(12, 130);
            this.c1TrueDBGrid1.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.c1TrueDBGrid1.Name = "c1TrueDBGrid1";
            this.c1TrueDBGrid1.PreviewInfo.Location = new System.Drawing.Point(0, 0);
            this.c1TrueDBGrid1.PreviewInfo.Size = new System.Drawing.Size(0, 0);
            this.c1TrueDBGrid1.PreviewInfo.ZoomFactor = 75;
            this.c1TrueDBGrid1.RecordSelectorWidth = 16;
            this.c1TrueDBGrid1.RowHeight = 15;
            this.c1TrueDBGrid1.RowSubDividerColor = System.Drawing.Color.DarkGray;
            this.c1TrueDBGrid1.ScrollTips = false;
            this.c1TrueDBGrid1.Size = new System.Drawing.Size(436, 184);
            this.c1TrueDBGrid1.TabIndex = 9;
            this.c1TrueDBGrid1.Text = "c1TrueDBGrid1";
            this.c1TrueDBGrid1.PropBag = ((string)(resources.GetObject("c1TrueDBGrid1.PropBag")));
            // 
            // label8
            // 
            this.label8.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label8.Location = new System.Drawing.Point(12, 12);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(212, 16);
            this.label8.TabIndex = 8;
            this.label8.Text = "TableView record level constraints:";
            // 
            // label7
            // 
            this.label7.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label7.Location = new System.Drawing.Point(12, 80);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(344, 16);
            this.label7.TabIndex = 7;
            this.label7.Text = "TableView field level constraints (belong to certain fields):";
            // 
            // label6
            // 
            this.label6.Location = new System.Drawing.Point(12, 32);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(392, 16);
            this.label6.TabIndex = 6;
            this.label6.Text = "1. (UnitsInStock+UnitsOnOrder)*UnitPrice < 100000, when UnitPrice >= 100";
            // 
            // label5
            // 
            this.label5.Location = new System.Drawing.Point(176, 100);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(96, 16);
            this.label5.TabIndex = 5;
            this.label5.Text = "2. UnitPrice > 0";
            // 
            // label4
            // 
            this.label4.Location = new System.Drawing.Point(12, 52);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(248, 16);
            this.label4.TabIndex = 4;
            this.label4.Text = "2. UnitsOnOrder = 0, when Discontinued = true";
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(296, 100);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(120, 16);
            this.label3.TabIndex = 3;
            this.label3.Text = "3. ReorderLevel >= 0";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(12, 100);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(144, 16);
            this.label2.TabIndex = 2;
            this.label2.Text = "1. LEN(ProductName) > 2";
            // 
            // btnRefresh
            // 
            this.btnRefresh.Location = new System.Drawing.Point(316, 368);
            this.btnRefresh.Name = "btnRefresh";
            this.btnRefresh.TabIndex = 1;
            this.btnRefresh.Text = "Refresh";
            this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
            // 
            // btnClose
            // 
            this.btnClose.Location = new System.Drawing.Point(400, 368);
            this.btnClose.Name = "btnClose";
            this.btnClose.TabIndex = 2;
            this.btnClose.Text = "Close";
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            // 
            // MainForm
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
            this.ClientSize = new System.Drawing.Size(484, 399);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.btnClose,
                                                                          this.btnRefresh,
                                                                          this.tabControl1});
            this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "MainForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Constraints";
            this.tabControl1.ResumeLayout(false);
            this.tabPage2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.c1TrueDBGrid2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.c1DataSet1)).EndInit();
            this.tabPage1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.c1TrueDBGrid1)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }

        private void btnRefresh_Click(object sender, System.EventArgs e)
        {
            c1DataSet1.Fill();
        }

        private void btnClose_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }
}
