コード例 #1
0
ファイル: dlgyardsection.cs プロジェクト: jpheary/Argix08
        //Interface
        public dlgYardSectionDetail(string terminalName, string yardName, bool parentIsActive, ref YardSectionDS yardSection)
        {
            //Constructor
            try {
                //
                InitializeComponent();
                this.btnOk.Text     = CMD_OK;
                this.btnCancel.Text = CMD_CANCEL;

                //Set mediator service, data, and titlebar caption
                this.lblTerminal.Text = terminalName;
                this.lblYard.Text     = yardName;
                this.mParentIsActive  = parentIsActive;
                this.mYardSectionDS   = yardSection;
                if (this.mYardSectionDS.YardSectionDetailTable.Count > 0)
                {
                    this.mYardSectionID = this.mYardSectionDS.YardSectionDetailTable[0].SectionID;
                    this.Text           = (this.mYardSectionID > 0) ? "Yard Section (" + this.mYardSectionID + ")" : "Yard Section (New)";
                }
                else
                {
                    this.Text = "Yard Section (Data Unavailable)";
                }
            }
            catch (Exception ex) { throw ex; }
        }
コード例 #2
0
        public override DataSet Clone()
        {
            YardSectionDS cln = ((YardSectionDS)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
コード例 #3
0
        public static YardSectionDS GetYardSection(int yardID, int yardSectionID)
        {
            //Get a new or existing yard section
            YardSectionDS yardSection = new YardSectionDS();

            try {
                if (yardSectionID == 0)
                {
                    //New
                    YardSectionDS.YardSectionDetailTableRow row = yardSection.YardSectionDetailTable.NewYardSectionDetailTableRow();
                    row.SectionID     = 0;
                    row.SectionNumber = "";
                    row.Description   = "";
                    row.YardID        = yardID;
                    row.IsActive      = true;
                    row.LastUpdated   = DateTime.Now;
                    row.UserID        = System.Environment.UserName;
                    row.RowVersion    = "";
                    yardSection.YardSectionDetailTable.AddYardSectionDetailTableRow(row);
                }
                else
                {
                    //Existing
                    DataSet ds = Mediator.FillDataset("", "YardSectionDetailTable", new object[] { yardID, yardSectionID });
                    if (ds != null)
                    {
                        yardSection.Merge(ds);
                    }
                }
            }
            catch (Exception ex) { throw ex; }
            return(yardSection);
        }
コード例 #4
0
        public static bool UpdateYardSection(YardSectionDS yardSection)
        {
            //Update an existing yard section
            bool result = false;

            try {
                result = Mediator.ExecuteNonQuery("", new object[] { yardSection });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
コード例 #5
0
        public static int CreateYardSection(YardSectionDS yardSection)
        {
            //Create a new yard section
            int result = 0;

            try {
                result = (int)Mediator.ExecuteNonQueryWithReturn("", new object[] { yardSection });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
コード例 #6
0
        public static YardSectionDS ViewYardSections(int yardID)
        {
            //Get a list of yard sections
            YardSectionDS sections = new YardSectionDS();

            try {
                DataSet ds = Mediator.FillDataset("", "YardSectionListTable", new object[] { yardID });
                if (ds != null)
                {
                    sections.Merge(ds.Tables["YardSectionListTable"].Select("", "SectionNumber", DataViewRowState.CurrentRows));
                }
            }
            catch (Exception ex) { throw ex; }
            return(sections);
        }
コード例 #7
0
ファイル: dlgyardsection.cs プロジェクト: jpheary/Argix08
 /// <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(dlgYardSectionDetail));
     this._lblTerminal           = new System.Windows.Forms.Label();
     this._lblYard               = new System.Windows.Forms.Label();
     this.btnOk                  = new System.Windows.Forms.Button();
     this.btnCancel              = new System.Windows.Forms.Button();
     this._lblSectionID          = new System.Windows.Forms.Label();
     this._lblSectionDescription = new System.Windows.Forms.Label();
     this.txtSection             = new System.Windows.Forms.TextBox();
     this.txtSectionDescripton   = new System.Windows.Forms.TextBox();
     this.lblTerminal            = new System.Windows.Forms.Label();
     this.lblYard                = new System.Windows.Forms.Label();
     this.grpDetails             = new System.Windows.Forms.GroupBox();
     this.chkStatus              = new System.Windows.Forms.CheckBox();
     this.mYardSectionDS         = new Tsort.Transportation.YardSectionDS();
     this.tabDialog              = new System.Windows.Forms.TabControl();
     this.tabGeneral             = new System.Windows.Forms.TabPage();
     this.grpDetails.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.mYardSectionDS)).BeginInit();
     this.tabDialog.SuspendLayout();
     this.tabGeneral.SuspendLayout();
     this.SuspendLayout();
     //
     // _lblTerminal
     //
     this._lblTerminal.Location  = new System.Drawing.Point(12, 12);
     this._lblTerminal.Name      = "_lblTerminal";
     this._lblTerminal.Size      = new System.Drawing.Size(96, 18);
     this._lblTerminal.TabIndex  = 1;
     this._lblTerminal.Text      = "Terminal: ";
     this._lblTerminal.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // _lblYard
     //
     this._lblYard.Location  = new System.Drawing.Point(12, 30);
     this._lblYard.Name      = "_lblYard";
     this._lblYard.Size      = new System.Drawing.Size(96, 18);
     this._lblYard.TabIndex  = 3;
     this._lblYard.Text      = "Yard: ";
     this._lblYard.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnOk
     //
     this.btnOk.BackColor = System.Drawing.SystemColors.Control;
     this.btnOk.Enabled   = false;
     this.btnOk.Location  = new System.Drawing.Point(174, 234);
     this.btnOk.Name      = "btnOk";
     this.btnOk.Size      = new System.Drawing.Size(96, 24);
     this.btnOk.TabIndex  = 2;
     this.btnOk.Text      = "&OK";
     this.btnOk.Click    += new System.EventHandler(this.OnCmdClick);
     //
     // btnCancel
     //
     this.btnCancel.BackColor    = System.Drawing.SystemColors.Control;
     this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancel.Location     = new System.Drawing.Point(276, 234);
     this.btnCancel.Name         = "btnCancel";
     this.btnCancel.Size         = new System.Drawing.Size(96, 24);
     this.btnCancel.TabIndex     = 0;
     this.btnCancel.Text         = "&Cancel";
     this.btnCancel.Click       += new System.EventHandler(this.OnCmdClick);
     //
     // _lblSectionID
     //
     this._lblSectionID.Font      = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this._lblSectionID.Location  = new System.Drawing.Point(6, 24);
     this._lblSectionID.Name      = "_lblSectionID";
     this._lblSectionID.Size      = new System.Drawing.Size(96, 18);
     this._lblSectionID.TabIndex  = 3;
     this._lblSectionID.Text      = "ID";
     this._lblSectionID.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // _lblSectionDescription
     //
     this._lblSectionDescription.Location  = new System.Drawing.Point(6, 48);
     this._lblSectionDescription.Name      = "_lblSectionDescription";
     this._lblSectionDescription.Size      = new System.Drawing.Size(96, 18);
     this._lblSectionDescription.TabIndex  = 4;
     this._lblSectionDescription.Text      = "Description";
     this._lblSectionDescription.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtSection
     //
     this.txtSection.ForeColor    = System.Drawing.SystemColors.ControlText;
     this.txtSection.Location     = new System.Drawing.Point(108, 24);
     this.txtSection.Name         = "txtSection";
     this.txtSection.Size         = new System.Drawing.Size(72, 21);
     this.txtSection.TabIndex     = 0;
     this.txtSection.Text         = "";
     this.txtSection.TextChanged += new System.EventHandler(this.ValidateForm);
     //
     // txtSectionDescripton
     //
     this.txtSectionDescripton.ForeColor    = System.Drawing.SystemColors.ControlText;
     this.txtSectionDescripton.Location     = new System.Drawing.Point(108, 48);
     this.txtSectionDescripton.Name         = "txtSectionDescripton";
     this.txtSectionDescripton.Size         = new System.Drawing.Size(228, 21);
     this.txtSectionDescripton.TabIndex     = 1;
     this.txtSectionDescripton.Text         = "";
     this.txtSectionDescripton.TextChanged += new System.EventHandler(this.ValidateForm);
     //
     // lblTerminal
     //
     this.lblTerminal.Location  = new System.Drawing.Point(114, 12);
     this.lblTerminal.Name      = "lblTerminal";
     this.lblTerminal.Size      = new System.Drawing.Size(186, 18);
     this.lblTerminal.TabIndex  = 2;
     this.lblTerminal.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblYard
     //
     this.lblYard.Location  = new System.Drawing.Point(114, 30);
     this.lblYard.Name      = "lblYard";
     this.lblYard.Size      = new System.Drawing.Size(186, 18);
     this.lblYard.TabIndex  = 4;
     this.lblYard.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // grpDetails
     //
     this.grpDetails.Controls.Add(this.chkStatus);
     this.grpDetails.Controls.Add(this.txtSection);
     this.grpDetails.Controls.Add(this.txtSectionDescripton);
     this.grpDetails.Controls.Add(this._lblSectionID);
     this.grpDetails.Controls.Add(this._lblSectionDescription);
     this.grpDetails.Location = new System.Drawing.Point(6, 72);
     this.grpDetails.Name     = "grpDetails";
     this.grpDetails.Size     = new System.Drawing.Size(348, 120);
     this.grpDetails.TabIndex = 0;
     this.grpDetails.TabStop  = false;
     this.grpDetails.Text     = "Yard Section";
     //
     // chkStatus
     //
     this.chkStatus.Checked         = true;
     this.chkStatus.CheckState      = System.Windows.Forms.CheckState.Checked;
     this.chkStatus.Font            = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.chkStatus.Location        = new System.Drawing.Point(108, 90);
     this.chkStatus.Name            = "chkStatus";
     this.chkStatus.Size            = new System.Drawing.Size(96, 18);
     this.chkStatus.TabIndex        = 2;
     this.chkStatus.Text            = "Active";
     this.chkStatus.CheckedChanged += new System.EventHandler(this.ValidateForm);
     //
     // mYardSectionDS
     //
     this.mYardSectionDS.DataSetName = "YardSectionDS";
     this.mYardSectionDS.Locale      = new System.Globalization.CultureInfo("en-US");
     //
     // tabDialog
     //
     this.tabDialog.Controls.Add(this.tabGeneral);
     this.tabDialog.Location      = new System.Drawing.Point(3, 3);
     this.tabDialog.Name          = "tabDialog";
     this.tabDialog.SelectedIndex = 0;
     this.tabDialog.Size          = new System.Drawing.Size(369, 225);
     this.tabDialog.TabIndex      = 1;
     //
     // tabGeneral
     //
     this.tabGeneral.Controls.Add(this._lblTerminal);
     this.tabGeneral.Controls.Add(this._lblYard);
     this.tabGeneral.Controls.Add(this.lblYard);
     this.tabGeneral.Controls.Add(this.grpDetails);
     this.tabGeneral.Controls.Add(this.lblTerminal);
     this.tabGeneral.Location    = new System.Drawing.Point(4, 22);
     this.tabGeneral.Name        = "tabGeneral";
     this.tabGeneral.Size        = new System.Drawing.Size(361, 199);
     this.tabGeneral.TabIndex    = 0;
     this.tabGeneral.Text        = "General";
     this.tabGeneral.ToolTipText = "General information";
     //
     // dlgYardSectionDetail
     //
     this.AcceptButton      = this.btnOk;
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.CancelButton      = this.btnCancel;
     this.ClientSize        = new System.Drawing.Size(378, 263);
     this.Controls.Add(this.tabDialog);
     this.Controls.Add(this.btnCancel);
     this.Controls.Add(this.btnOk);
     this.Font            = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.ForeColor       = System.Drawing.SystemColors.ControlText;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "dlgYardSectionDetail";
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text            = "Yard Section Details";
     this.Load           += new System.EventHandler(this.OnFormLoad);
     this.grpDetails.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.mYardSectionDS)).EndInit();
     this.tabDialog.ResumeLayout(false);
     this.tabGeneral.ResumeLayout(false);
     this.ResumeLayout(false);
 }