示例#1
0
        public void Read(string s)
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("SELECT *FROM Vw_EmployeeDatebaseWIthPhoto WHERE CompanyName = @CompanyName ORDER BY EmployeeID", conn);
            //comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@CompanyName", SqlDbType.VarChar, 30);
            comm.Parameters["@CompanyName"].Value = comboBox5.Text;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
               DatabaseCrystalReport1 crp = new DatabaseCrystalReport1();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer1.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
示例#2
0
        public void Read()
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("SELECT *FROM Vw_EmployeeDatebaseWIthPhoto ORDER BY EmployeeID", conn);
            //comm.CommandType = CommandType.StoredProcedure;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
            DatabaseCrystalReport1 crp = new DatabaseCrystalReport1();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer2.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
示例#3
0
        public void Read(string srr)
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("SELECT *FROM TbEmployeeDatabase WHERE EmployeeID = @EmployeeID", conn);

            comm.Parameters.Add("@EmployeeID", SqlDbType.VarChar, 50);
            comm.Parameters["@EmployeeID"].Value = comboBox1.Text;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
            JobPromotionLetterCrystalReport crp = new JobPromotionLetterCrystalReport();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer2.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
        public void Read()
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("dbo.UspSalarySheetHoldReport", conn);
            comm.CommandType = CommandType.StoredProcedure;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
            SalarySheetHoldListCrystalReport crp = new SalarySheetHoldListCrystalReport();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer2.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
        public void Read(string addgroup, string mon)
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("dbo.UspSalarySheetPaySlipAllReport", conn);
            comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@SalaryMonth", SqlDbType.VarChar, 50);
            comm.Parameters["@SalaryMonth"].Value = comboBox4.Text;

            comm.Parameters.Add("@SalaryYear", SqlDbType.VarChar, 50);
            comm.Parameters["@SalaryYear"].Value = comboBox2.Text;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
            SalarySheetNewIndividualReport crp = new SalarySheetNewIndividualReport();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer2.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
示例#6
0
        public override global::System.Data.DataSet Clone()
        {
            DatabaseDataSet cln = ((DatabaseDataSet)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
示例#7
0
        public void FormatData(string packet, DatabaseDataSet db)
        {
            string[] newContent = packet.Split(',');
            string   reader_mac;
            string   readings;

            if (newContent.LastOrDefault().Length > 2)          // to check that sensors return
            {
                reader_mac = newContent[newContent.Length - 2]; // to get the reader mac (R1)
                readings   = string.Join(",", newContent, 1, newContent.Length - 3);
                string sensors = newContent[newContent.Length - 1];
                readings += "," + sensors;
            }
            else if (newContent.LastOrDefault().Length < 2)
            {
                reader_mac = newContent[newContent.Length - 2];
                readings   = string.Join(",", newContent, 1, newContent.Length - 3);
            }
            else
            {
                reader_mac = newContent[newContent.Length - 1];
                readings   = string.Join(",", newContent, 1, newContent.Length - 2);
            }
            string        readingbefore = readings;
            List <string> RSSI_string   = readingbefore.Split(',').ToList();
            //  Sensors go here.....
            //  SensorsFromBeacon = RSSI_string[RSSI_string.Count-1];
            //  RSSI_string.RemoveAt(RSSI_string.Count - 1);
            EntityCommand db = new EntityCommand();

            if (RSSI_string.Count() != 0)
            {
                string Beacon_mac   = newContent[0];
                var    beacon_found = db.pcptgs006.FirstOrDefault(b => b.pcptgs006002 == Beacon_mac);

                if (beacon_found != null)
                {
                    using (pcptgs014 pcptgs014 = new pcptgs014())
                    {
                        TimeSpan TodayTime = DateTime.Now.TimeOfDay;
                        DateTime today     = DateTime.Now;
                        pcptgs014.pcptgs014001 = today;
                        pcptgs014.pcptgs014002 = TodayTime;
                        pcptgs014.pcptgs014003 = reader_mac;
                        pcptgs014.pcptgs014004 = Beacon_mac;
                        pcptgs014.pcptgs014005 = readings;
                        db.pcptgs014.Add(pcptgs014);
                        try
                        {
                            db.SaveChanges();
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="filterData">The data to be filtered</param>
        /// <param name="filterCollection">The filtercollectio to be applied to</param>
        /// <param name="filterMethod">The filtermethod</param>
        /// <param name="callback">The callback for successfull filtering</param>
        public FilterCommand(DatabaseDataSet filterData, FilterCollection filterCollection, FilterMethod filterMethod, CommandFinishedDelegate callback)
            : base(Priority.Low, callback)
        {
            this.filterData = filterData;
            this.filterCollection = filterCollection;
            this.filterMethod = filterMethod;

            this.description = "Filter file " + this.filterData.AbsoluteFileName;
        }
 public Examenoverzicht(int rowIndex, int opleidingColumnIndex, DatabaseDataSet dc)
 {
     data = dc;
     InitializeComponent();
     maakElementen();
     this.rowIndex = rowIndex;
     this.opleidingColumnIndex = opleidingColumnIndex;
     LeesGegevens();
 }
示例#10
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DatabaseDataSet ds = new DatabaseDataSet();

            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);
        }
示例#11
0
        public void load_metroGrid()
        {
            DataSet        ds  = new DatabaseDataSet();
            SqlDataAdapter sda = new SqlDataAdapter("Select * from Client", Conteneur.conn);

            sda.Fill(ds, "Client");
            this.metroGrid.DataSource = ds;
            this.metroGrid.DataMember = "Client";
            this.metroGrid.ClearSelection();
            this.buttonModifier.BackColor  = Color.LightGray;
            this.buttonSupprimer.BackColor = Color.LightGray;
            ds.Dispose();
        }
示例#12
0
        private void _05Facture_Load(object sender, EventArgs e)
        {
            facture f = new facture();


            CultureInfo  c   = new CultureInfo("fr");
            SqlCeCommand cmd = new SqlCeCommand("select * from Facture", Services.con);

            DatabaseDataSet s = new DatabaseDataSet();

            Services.con.Open();

            SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);

            da.Fill(s, "Facture");
            Services.con.Close();



            f.SetDataSource(s);
            f.SetParameterValue("date", DateTime.Now.Day + " " + c.DateTimeFormat.GetMonthName(DateTime.Now.Month) + " " + DateTime.Now.Year);
            f.SetParameterValue("client", FicheInfo.client.ToUpper());
            f.SetParameterValue("ville", FicheInfo.ville.ToUpper());
            //f.SetParameterValue("modele", FicheInfo.serie);
            set(f, "totalht", FactureInfo.totalht);
            set(f, "tva7", FactureInfo.tva7);
            set(f, "tva20", FactureInfo.tva20);
            set(f, "pttc", FactureInfo.prixttc);
            set(f, "fww", FactureInfo.ww);
            set(f, "net", FactureInfo.net);
            set(f, "remiseTotal", FactureInfo.remiseTotal);
            f.SetParameterValue("netword", " Dirhams");
            if (FactureInfo.net != "")
            {
                float  aa = float.Parse(FactureInfo.net);
                string x  = aa.ToString("#.");
                aa = float.Parse(x);
                int a = (int)aa;

                string r = a.ToWords(new CultureInfo("fr"));

                f.SetParameterValue("netword", toUpperfirst(r) + " Dirhams");
            }
            if (FactureInfo.net == "")
            {
                int a = int.Parse("0");
                f.SetParameterValue("netword", a.ToWords(new CultureInfo("fr")) + " Dirhams");
            }
            crystalReportViewer1.ReportSource = f;
            // crystalReportViewer1.RefreshReport();
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="data">The model to show all entrys of</param>
        public ShowParsedFileContent(DatabaseDataSet data)
        {
            // set bindinglist for gridview
            this.data = data;
            DataTable dt = new DataTable();
            if (!data.isFiltered)
            {
                dt.Load(data.getData());
            }

            InitializeComponent();

            #region Custom Init

            // Display filename in title
            this.Text += " " + data.FileName;

            // prepare for custom data-source and columns
            this.fileContentDataGrid.AutoGenerateColumns = false;
            if (data.isFiltered)
            {
                this.fileContentDataGrid.DataSource = data.getData();
            }
            else
            {
                this.fileContentDataGrid.DataSource = dt;
            }
            // add columns supported by data
            foreach (SensorData t in Enum.GetValues(typeof(SensorData)))
            {
                FieldInfo fi = t.GetType().GetField(t.ToString());
                DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);

                if(data.SupportedValues.Contains(t)) {
                    DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
                    col.DataPropertyName = t.ToString();
                    col.HeaderText = attributes[0].Description;
                    this.fileContentDataGrid.Columns.Add(col);
                }
            }

            #endregion
        }
示例#14
0
        public void load_metroGrid()
        {
            this.buttonSupprimer.Enabled   = false;
            this.buttonModifier.Enabled    = false;
            this.buttonImprimer.Enabled    = false;
            this.buttonModifier.BackColor  = Color.LightGray;
            this.buttonSupprimer.BackColor = Color.LightGray;
            this.buttonImprimer.BackColor  = Color.LightGray;

            DataSet        ds  = new DatabaseDataSet();
            SqlDataAdapter sda = new SqlDataAdapter("select * from Devis", Conteneur.conn);

            sda.Fill(ds, "Devis");
            this.metroGrid.DataSource = ds;
            this.metroGrid.DataMember = "Devis";

            this.metroGrid.ClearSelection();
            ds.Dispose();
        }
        public static DatabaseDataSet filter(DatabaseDataSet data, 
            Filter.FilterCollection filterCollection,
            Filter.FilterMethod method)
        {
            FilteredDatabaseDataSet model = new FilteredDatabaseDataSet(data.SupportedValues);

            // set filename and supported values
            model.AbsoluteFileName = data.AbsoluteFileName;
            model.SupportedValues = data.SupportedValues;
            model.ID = data.ID;

            // do the filtering
            filterCollection.filter(data, model, method);

            // finish model
            model.finishImport();

            return model;
        }
示例#16
0
        public void load_metroGrid()
        {
            this.buttonModifier.Enabled    = false;
            this.buttonSupprimer.Enabled   = false;
            this.buttonModifier.BackColor  = Color.LightGray;
            this.buttonSupprimer.BackColor = Color.LightGray;
            this.totalTTC.Text             = "";
            this.totalHT.Text = "";
            this.TVAText.Text = "";

            DataSet        ds  = new DatabaseDataSet();
            SqlDataAdapter sda = new SqlDataAdapter("select * from Facture", Conteneur.conn);

            sda.Fill(ds, "Facture");
            this.metroGrid.DataSource = ds;
            this.metroGrid.DataMember = "Facture";

            this.metroGrid.ClearSelection();
            this.searchTextBox.Text = "";
            ds.Dispose();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">The model used for calculations</param>
        public DatabaseActivityLevelsCalculator(DatabaseDataSet model)
        {
            this.model = model;
            this.activityValueSupported = this.model.SupportedValues.Contains(SensorData.Activity);
            this.vmuValueSupported = this.model.SupportedValues.Contains(SensorData.Vmu);

            // set array of activity levels depending of the enum
            this.activityLevels = new ActivityLevel[Enum.GetNames(typeof(ActivityLevels)).Length];

            // set structures and set them to zero.
            int position = 0;
            foreach (ActivityLevels level in Enum.GetValues(typeof(ActivityLevels)))
            {
                ActivityLevel l = new ActivityLevel();
                l.Level = level;
                l.Count = 0;
                l.Percent = 0.0;

                this.activityLevels[position] = l;
                position++;
            }
            calculate();
        }
示例#18
0
        public void BindReport(int devisN)
        {
            DatabaseDataSet ds     = new DatabaseDataSet();
            var             table1 = ds.Produit;
            var             adp    = new ProduitTableAdapter();

            adp.Fill(table1);
            DataView dv1      = new DataView(table1, $"DevisN={devisN}", "", DataViewRowState.CurrentRows);
            var      produits = dv1.ToTable();

            var table3 = ds.Devis;
            var adp3   = new DevisTableAdapter();

            adp3.Fill(table3);
            DataView dv3   = new DataView(table3, $"DevisN={devisN}", "", DataViewRowState.CurrentRows);
            var      devis = dv3.ToTable();

            var table2 = ds.Client;
            var adp2   = new ClientTableAdapter();

            adp2.Fill(table2);
            DataView dv2    = new DataView(table2, $"IdClient={devis.Rows[0]["IdClient"]}", "", DataViewRowState.CurrentRows);
            var      client = dv2.ToTable();

            DataSet n_ds = new DataSet();

            n_ds.Tables.Add(produits);
            n_ds.Tables.Add(devis);
            n_ds.Tables.Add(client);

            CrystalReport cr = new CrystalReport();

            cr.SetDataSource(n_ds);
            this.crystalReportViewer.ReportSource = cr;
            this.crystalReportViewer.RefreshReport();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="data">The model</param>
        public ShowParsedFileDailyStartEndTimes(DatabaseDataSet data)
        {
            this.data = new DatabaseDayStartEndCalculator(data).DayStartEndList;

            InitializeComponent();

            #region Custom Init
            this.Text += " " + data.FileName;

            this.fileContentDataGrid.AutoGenerateColumns = false;
            this.fileContentDataGrid.DataSource = this.data;

            DataGridViewTextBoxColumn dateTimeColumn = new DataGridViewTextBoxColumn();
            dateTimeColumn.DataPropertyName = "Date";
            dateTimeColumn.HeaderText = "Date";
            this.fileContentDataGrid.Columns.Add(dateTimeColumn);

            DataGridViewTextBoxColumn startTimeColumn = new DataGridViewTextBoxColumn();
            startTimeColumn.DataPropertyName = "StartTime";
            startTimeColumn.HeaderText = "Start";
            startTimeColumn.DefaultCellStyle.Format = "HH:mm:ss";
            this.fileContentDataGrid.Columns.Add(startTimeColumn);

            DataGridViewTextBoxColumn endTimeColumn = new DataGridViewTextBoxColumn();
            endTimeColumn.DataPropertyName = "EndTime";
            endTimeColumn.HeaderText = "End";
            endTimeColumn.DefaultCellStyle.Format = "HH:mm:ss";
            this.fileContentDataGrid.Columns.Add(endTimeColumn);

            DataGridViewTextBoxColumn activeTimeColumn = new DataGridViewTextBoxColumn();
            activeTimeColumn.DataPropertyName = "ActiveTime";
            activeTimeColumn.HeaderText = "Active Time";
            this.fileContentDataGrid.Columns.Add(activeTimeColumn);

            #endregion
        }
示例#20
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();
     DatabaseDataSet ds = new DatabaseDataSet();
     xs.Add(ds.GetSchemaSerializable());
     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 = "transDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     return type;
 }
示例#21
0
 public virtual int Fill(DatabaseDataSet.transDataTable dataTable) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
示例#22
0
 public virtual int Update(DatabaseDataSet.transDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
示例#23
0
 public virtual int Update(DatabaseDataSet dataSet) {
     return this.Adapter.Update(dataSet, "trans");
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="model">The model</param>
 public DatabaseActiveTimeCalculator(DatabaseDataSet model)
 {
     this.model = model;
     this.Days = new DatabaseDayStartEndCalculator(this.model);
 }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     DatabaseDataSet ds = new DatabaseDataSet();
     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;
 }
示例#26
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.outputLabel = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.lineTextbox = new System.Windows.Forms.TextBox();
     this.addLineButton = new System.Windows.Forms.Button();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.outputLabelStation = new System.Windows.Forms.Label();
     this.stationTextbox = new System.Windows.Forms.TextBox();
     this.label2 = new System.Windows.Forms.Label();
     this.addStationButton = new System.Windows.Forms.Button();
     this.groupBox3 = new System.Windows.Forms.GroupBox();
     this.deleteStationButton = new System.Windows.Forms.Button();
     this.updateStationTextBox = new System.Windows.Forms.TextBox();
     this.updateStationbutton = new System.Windows.Forms.Button();
     this.stationGridView = new System.Windows.Forms.DataGridView();
     this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.stationBindingSource = new System.Windows.Forms.BindingSource(this.components);
     this.stationDataSet = new Coursework.DatabaseDataSet();
     this.groupBox4 = new System.Windows.Forms.GroupBox();
     this.deleteLineButton = new System.Windows.Forms.Button();
     this.updateLineTextBox = new System.Windows.Forms.TextBox();
     this.updateLineButton = new System.Windows.Forms.Button();
     this.lineDataGridView = new System.Windows.Forms.DataGridView();
     this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.lineBindingSource = new System.Windows.Forms.BindingSource(this.components);
     this.lineDataset = new Coursework.LineDataset();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.groupBox3.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.stationGridView)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.stationBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.stationDataSet)).BeginInit();
     this.groupBox4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lineDataGridView)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lineBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lineDataset)).BeginInit();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.outputLabel);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Controls.Add(this.lineTextbox);
     this.groupBox1.Controls.Add(this.addLineButton);
     this.groupBox1.Location = new System.Drawing.Point(16, 15);
     this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
     this.groupBox1.Size = new System.Drawing.Size(355, 156);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "Add Train Line";
     //
     // outputLabel
     //
     this.outputLabel.AutoSize = true;
     this.outputLabel.Location = new System.Drawing.Point(8, 111);
     this.outputLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.outputLabel.Name = "outputLabel";
     this.outputLabel.Size = new System.Drawing.Size(0, 17);
     this.outputLabel.TabIndex = 5;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(8, 46);
     this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(72, 17);
     this.label1.TabIndex = 4;
     this.label1.Text = "Train Line";
     //
     // lineTextbox
     //
     this.lineTextbox.Location = new System.Drawing.Point(12, 65);
     this.lineTextbox.Margin = new System.Windows.Forms.Padding(4);
     this.lineTextbox.Name = "lineTextbox";
     this.lineTextbox.Size = new System.Drawing.Size(211, 22);
     this.lineTextbox.TabIndex = 3;
     //
     // addLineButton
     //
     this.addLineButton.AutoSize = true;
     this.addLineButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.addLineButton.Location = new System.Drawing.Point(232, 65);
     this.addLineButton.Margin = new System.Windows.Forms.Padding(4);
     this.addLineButton.Name = "addLineButton";
     this.addLineButton.Size = new System.Drawing.Size(111, 27);
     this.addLineButton.TabIndex = 2;
     this.addLineButton.Text = "Add Train Line";
     this.addLineButton.UseVisualStyleBackColor = true;
     this.addLineButton.Click += new System.EventHandler(this.addLineButton_Click);
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.outputLabelStation);
     this.groupBox2.Controls.Add(this.stationTextbox);
     this.groupBox2.Controls.Add(this.label2);
     this.groupBox2.Controls.Add(this.addStationButton);
     this.groupBox2.Location = new System.Drawing.Point(379, 15);
     this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
     this.groupBox2.Size = new System.Drawing.Size(355, 156);
     this.groupBox2.TabIndex = 1;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "Add Train Station";
     //
     // outputLabelStation
     //
     this.outputLabelStation.AutoSize = true;
     this.outputLabelStation.Location = new System.Drawing.Point(8, 111);
     this.outputLabelStation.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.outputLabelStation.Name = "outputLabelStation";
     this.outputLabelStation.Size = new System.Drawing.Size(0, 17);
     this.outputLabelStation.TabIndex = 6;
     //
     // stationTextbox
     //
     this.stationTextbox.Location = new System.Drawing.Point(8, 69);
     this.stationTextbox.Margin = new System.Windows.Forms.Padding(4);
     this.stationTextbox.Name = "stationTextbox";
     this.stationTextbox.Size = new System.Drawing.Size(197, 22);
     this.stationTextbox.TabIndex = 5;
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(8, 49);
     this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(89, 17);
     this.label2.TabIndex = 5;
     this.label2.Text = "Train Station";
     //
     // addStationButton
     //
     this.addStationButton.AutoSize = true;
     this.addStationButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.addStationButton.Location = new System.Drawing.Point(215, 69);
     this.addStationButton.Margin = new System.Windows.Forms.Padding(4);
     this.addStationButton.Name = "addStationButton";
     this.addStationButton.Size = new System.Drawing.Size(128, 27);
     this.addStationButton.TabIndex = 3;
     this.addStationButton.Text = "Add Train Station";
     this.addStationButton.UseVisualStyleBackColor = true;
     this.addStationButton.Click += new System.EventHandler(this.addStationButton_Click);
     //
     // groupBox3
     //
     this.groupBox3.Controls.Add(this.deleteStationButton);
     this.groupBox3.Controls.Add(this.updateStationTextBox);
     this.groupBox3.Controls.Add(this.updateStationbutton);
     this.groupBox3.Controls.Add(this.stationGridView);
     this.groupBox3.Location = new System.Drawing.Point(379, 178);
     this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
     this.groupBox3.Name = "groupBox3";
     this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
     this.groupBox3.Size = new System.Drawing.Size(355, 289);
     this.groupBox3.TabIndex = 2;
     this.groupBox3.TabStop = false;
     this.groupBox3.Text = "Edit / Delete Stations";
     //
     // deleteStationButton
     //
     this.deleteStationButton.Location = new System.Drawing.Point(116, 253);
     this.deleteStationButton.Margin = new System.Windows.Forms.Padding(4);
     this.deleteStationButton.Name = "deleteStationButton";
     this.deleteStationButton.Size = new System.Drawing.Size(100, 28);
     this.deleteStationButton.TabIndex = 8;
     this.deleteStationButton.Text = "Delete";
     this.deleteStationButton.UseVisualStyleBackColor = true;
     this.deleteStationButton.Click += new System.EventHandler(this.deleteStationButton_Click);
     //
     // updateStationTextBox
     //
     this.updateStationTextBox.Location = new System.Drawing.Point(8, 223);
     this.updateStationTextBox.Margin = new System.Windows.Forms.Padding(4);
     this.updateStationTextBox.Name = "updateStationTextBox";
     this.updateStationTextBox.Size = new System.Drawing.Size(211, 22);
     this.updateStationTextBox.TabIndex = 7;
     //
     // updateStationbutton
     //
     this.updateStationbutton.Location = new System.Drawing.Point(8, 253);
     this.updateStationbutton.Margin = new System.Windows.Forms.Padding(4);
     this.updateStationbutton.Name = "updateStationbutton";
     this.updateStationbutton.Size = new System.Drawing.Size(100, 28);
     this.updateStationbutton.TabIndex = 2;
     this.updateStationbutton.Text = "Update";
     this.updateStationbutton.UseVisualStyleBackColor = true;
     this.updateStationbutton.Click += new System.EventHandler(this.updateStationbutton_Click);
     //
     // stationGridView
     //
     this.stationGridView.AutoGenerateColumns = false;
     this.stationGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.stationGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     this.idDataGridViewTextBoxColumn,
     this.nameDataGridViewTextBoxColumn});
     this.stationGridView.DataSource = this.stationBindingSource;
     this.stationGridView.Location = new System.Drawing.Point(9, 25);
     this.stationGridView.Margin = new System.Windows.Forms.Padding(4);
     this.stationGridView.Name = "stationGridView";
     this.stationGridView.ReadOnly = true;
     this.stationGridView.Size = new System.Drawing.Size(323, 185);
     this.stationGridView.TabIndex = 0;
     this.stationGridView.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.stationGridView_RowHeaderMouseClick);
     //
     // idDataGridViewTextBoxColumn
     //
     this.idDataGridViewTextBoxColumn.DataPropertyName = "Id";
     this.idDataGridViewTextBoxColumn.HeaderText = "Id";
     this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
     this.idDataGridViewTextBoxColumn.ReadOnly = true;
     //
     // nameDataGridViewTextBoxColumn
     //
     this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
     this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
     this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
     this.nameDataGridViewTextBoxColumn.ReadOnly = true;
     //
     // stationBindingSource
     //
     this.stationBindingSource.DataMember = "Station";
     this.stationBindingSource.DataSource = this.stationDataSet;
     //
     // stationDataSet
     //
     this.stationDataSet.DataSetName = "StationDataSet";
     this.stationDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // groupBox4
     //
     this.groupBox4.Controls.Add(this.deleteLineButton);
     this.groupBox4.Controls.Add(this.updateLineTextBox);
     this.groupBox4.Controls.Add(this.updateLineButton);
     this.groupBox4.Controls.Add(this.lineDataGridView);
     this.groupBox4.Location = new System.Drawing.Point(16, 178);
     this.groupBox4.Margin = new System.Windows.Forms.Padding(4);
     this.groupBox4.Name = "groupBox4";
     this.groupBox4.Padding = new System.Windows.Forms.Padding(4);
     this.groupBox4.Size = new System.Drawing.Size(355, 289);
     this.groupBox4.TabIndex = 3;
     this.groupBox4.TabStop = false;
     this.groupBox4.Text = "Edit / Delete Line";
     //
     // deleteLineButton
     //
     this.deleteLineButton.Location = new System.Drawing.Point(116, 253);
     this.deleteLineButton.Margin = new System.Windows.Forms.Padding(4);
     this.deleteLineButton.Name = "deleteLineButton";
     this.deleteLineButton.Size = new System.Drawing.Size(100, 28);
     this.deleteLineButton.TabIndex = 7;
     this.deleteLineButton.Text = "Delete";
     this.deleteLineButton.UseVisualStyleBackColor = true;
     this.deleteLineButton.Click += new System.EventHandler(this.deleteLineButton_Click);
     //
     // updateLineTextBox
     //
     this.updateLineTextBox.Location = new System.Drawing.Point(8, 223);
     this.updateLineTextBox.Margin = new System.Windows.Forms.Padding(4);
     this.updateLineTextBox.Name = "updateLineTextBox";
     this.updateLineTextBox.Size = new System.Drawing.Size(211, 22);
     this.updateLineTextBox.TabIndex = 6;
     //
     // updateLineButton
     //
     this.updateLineButton.Location = new System.Drawing.Point(8, 253);
     this.updateLineButton.Margin = new System.Windows.Forms.Padding(4);
     this.updateLineButton.Name = "updateLineButton";
     this.updateLineButton.Size = new System.Drawing.Size(100, 28);
     this.updateLineButton.TabIndex = 1;
     this.updateLineButton.Text = "Update";
     this.updateLineButton.UseVisualStyleBackColor = true;
     this.updateLineButton.Click += new System.EventHandler(this.updateLineButton_Click);
     //
     // lineDataGridView
     //
     this.lineDataGridView.AutoGenerateColumns = false;
     this.lineDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.lineDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     this.dataGridViewTextBoxColumn1,
     this.dataGridViewTextBoxColumn2});
     this.lineDataGridView.DataSource = this.lineBindingSource;
     this.lineDataGridView.Location = new System.Drawing.Point(8, 25);
     this.lineDataGridView.Margin = new System.Windows.Forms.Padding(4);
     this.lineDataGridView.Name = "lineDataGridView";
     this.lineDataGridView.ReadOnly = true;
     this.lineDataGridView.Size = new System.Drawing.Size(323, 185);
     this.lineDataGridView.TabIndex = 0;
     this.lineDataGridView.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.lineDataGridView_RowHeaderMouseClick);
     //
     // dataGridViewTextBoxColumn1
     //
     this.dataGridViewTextBoxColumn1.DataPropertyName = "Id";
     this.dataGridViewTextBoxColumn1.HeaderText = "Id";
     this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
     this.dataGridViewTextBoxColumn1.ReadOnly = true;
     //
     // dataGridViewTextBoxColumn2
     //
     this.dataGridViewTextBoxColumn2.DataPropertyName = "Name";
     this.dataGridViewTextBoxColumn2.HeaderText = "Name";
     this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
     this.dataGridViewTextBoxColumn2.ReadOnly = true;
     //
     // lineBindingSource
     //
     this.lineBindingSource.DataMember = "Line";
     this.lineBindingSource.DataSource = this.lineDataset;
     //
     // lineDataset
     //
     this.lineDataset.DataSetName = "LineDataset";
     this.lineDataset.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // AddLineandStation
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(756, 488);
     this.Controls.Add(this.groupBox4);
     this.Controls.Add(this.groupBox3);
     this.Controls.Add(this.groupBox2);
     this.Controls.Add(this.groupBox1);
     this.Margin = new System.Windows.Forms.Padding(4);
     this.Name = "AddLineandStation";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "AddLineandStation";
     this.Load += new System.EventHandler(this.AddLineandStation_Load);
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.groupBox2.ResumeLayout(false);
     this.groupBox2.PerformLayout();
     this.groupBox3.ResumeLayout(false);
     this.groupBox3.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.stationGridView)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.stationBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.stationDataSet)).EndInit();
     this.groupBox4.ResumeLayout(false);
     this.groupBox4.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lineDataGridView)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lineBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lineDataset)).EndInit();
     this.ResumeLayout(false);
 }
示例#27
0
 public AddOfficerForm(DataRow newofficer, DatabaseDataSet dataset)
 {
     InitializeComponent();
     NewOfficer   = newofficer;
     this.dataset = dataset;
 }
示例#28
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     DatabaseDataSet ds = new DatabaseDataSet();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     xs.Add(ds.GetSchemaSerializable());
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     return type;
 }