Exemple #1
0
        public override DataSet Clone()
        {
            SwitcherDS cln = ((SwitcherDS)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
        public static SwitcherDS GetSwitcher(int switcherID)
        {
            //Get a new or existing switcher
            SwitcherDS switcher = new SwitcherDS();

            try {
                if (switcherID == 0)
                {
                    //New
                    SwitcherDS.SwitcherDetailTableRow row = switcher.SwitcherDetailTable.NewSwitcherDetailTableRow();
                    row.SwitcherID  = switcherID;
                    row.LastName    = "";
                    row.FirstName   = "";
                    row.Phone       = "";
                    row.TerminalID  = 0;
                    row.IsActive    = true;
                    row.LastUpdated = DateTime.Now;
                    row.UserID      = System.Environment.UserName;
                    row.RowVersion  = "";
                    switcher.SwitcherDetailTable.AddSwitcherDetailTableRow(row);
                }
                else
                {
                    //Existing
                    DataSet ds = Mediator.FillDataset("", "SwitcherDetailTable", new object[] { switcherID });
                    if (ds != null)
                    {
                        switcher.Merge(ds);
                    }
                }
            }
            catch (Exception ex) { throw ex; }
            return(switcher);
        }
        public static bool UpdateSwitcher(SwitcherDS switcher)
        {
            //Update an existing switcher
            bool result = false;

            try {
                result = Mediator.ExecuteNonQuery("", new object[] { switcher });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
        public static int CreateSwitcher(SwitcherDS switcher)
        {
            //Create a new switcher
            int result = 0;

            try {
                result = (int)Mediator.ExecuteNonQueryWithReturn("", new object[] { switcher });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
        public static SwitcherDS ViewSwitchers(int terminalID)
        {
            //Get a list of switchers
            SwitcherDS switchers = new SwitcherDS();

            try {
                DataSet ds = Mediator.FillDataset("", "SwitcherViewTable", new object[] { terminalID });
                if (ds != null)
                {
                    switchers.Merge(ds.Tables["SwitcherViewTable"].Select("TerminalID=" + terminalID, "LastName", DataViewRowState.CurrentRows));
                }
            }
            catch (Exception ex) { throw ex; }
            return(switchers);
        }
Exemple #6
0
        //Interface
        public dlgSwitcherDetail(ref SwitcherDS switcher)
        {
            //Constructor
            try {
                //Required designer support
                InitializeComponent();
                this.btnOk.Text     = CMD_OK;
                this.btnCancel.Text = CMD_CANCEL;

                //Set mediator service, data, and titlebar caption
                this.mSwitcherDS = switcher;
                if (this.mSwitcherDS.SwitcherDetailTable.Count > 0)
                {
                    this.mSwitcherID = this.mSwitcherDS.SwitcherDetailTable[0].SwitcherID;
                    this.Text        = (this.mSwitcherID > 0) ? "Switcher (" + this.mSwitcherID + ")" : "Switcher (New)";
                }
                else
                {
                    this.Text = "Switcher (Data Unavailable)";
                }
            }
            catch (Exception ex) { throw ex; }
        }
Exemple #7
0
 /// <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(dlgSwitcherDetail));
     this.cboTerminal   = new System.Windows.Forms.ComboBox();
     this.mTerminalsDS  = new Tsort.Windows.SelectionList();
     this._lblTerminal  = new System.Windows.Forms.Label();
     this._lblNameFirst = new System.Windows.Forms.Label();
     this.btnCancel     = new System.Windows.Forms.Button();
     this.btnOk         = new System.Windows.Forms.Button();
     this.grpDetails    = new System.Windows.Forms.GroupBox();
     this.chkStatus     = new System.Windows.Forms.CheckBox();
     this._lblNameLast  = new System.Windows.Forms.Label();
     this.txtNameLast   = new System.Windows.Forms.TextBox();
     this.txtNameFirst  = new System.Windows.Forms.TextBox();
     this._lblPhone     = new System.Windows.Forms.Label();
     this.mskPhone      = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
     this.mSwitcherDS   = new Tsort.Transportation.SwitcherDS();
     this.tabDialog     = new System.Windows.Forms.TabControl();
     this.tabGeneral    = new System.Windows.Forms.TabPage();
     ((System.ComponentModel.ISupportInitialize)(this.mTerminalsDS)).BeginInit();
     this.grpDetails.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.mSwitcherDS)).BeginInit();
     this.tabDialog.SuspendLayout();
     this.tabGeneral.SuspendLayout();
     this.SuspendLayout();
     //
     // cboTerminal
     //
     this.cboTerminal.DataSource            = this.mTerminalsDS;
     this.cboTerminal.DisplayMember         = "SelectionListTable.Description";
     this.cboTerminal.DropDownStyle         = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cboTerminal.ForeColor             = System.Drawing.SystemColors.ControlText;
     this.cboTerminal.Location              = new System.Drawing.Point(108, 84);
     this.cboTerminal.Name                  = "cboTerminal";
     this.cboTerminal.Size                  = new System.Drawing.Size(174, 21);
     this.cboTerminal.TabIndex              = 2;
     this.cboTerminal.ValueMember           = "SelectionListTable.ID";
     this.cboTerminal.SelectedIndexChanged += new System.EventHandler(this.ValidateForm);
     //
     // mTerminalsDS
     //
     this.mTerminalsDS.DataSetName = "SelectionList";
     this.mTerminalsDS.Locale      = new System.Globalization.CultureInfo("en-US");
     //
     // _lblTerminal
     //
     this._lblTerminal.Font      = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this._lblTerminal.Location  = new System.Drawing.Point(6, 84);
     this._lblTerminal.Name      = "_lblTerminal";
     this._lblTerminal.Size      = new System.Drawing.Size(96, 18);
     this._lblTerminal.TabIndex  = 2;
     this._lblTerminal.Text      = "Terminal";
     this._lblTerminal.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // _lblNameFirst
     //
     this._lblNameFirst.Font       = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this._lblNameFirst.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
     this._lblNameFirst.Location   = new System.Drawing.Point(6, 24);
     this._lblNameFirst.Name       = "_lblNameFirst";
     this._lblNameFirst.Size       = new System.Drawing.Size(96, 18);
     this._lblNameFirst.TabIndex   = 13;
     this._lblNameFirst.Text       = "First Name";
     this._lblNameFirst.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
     //
     // 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);
     //
     // 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);
     //
     // grpDetails
     //
     this.grpDetails.Controls.Add(this.chkStatus);
     this.grpDetails.Controls.Add(this._lblTerminal);
     this.grpDetails.Controls.Add(this.cboTerminal);
     this.grpDetails.Controls.Add(this._lblNameLast);
     this.grpDetails.Controls.Add(this.txtNameLast);
     this.grpDetails.Controls.Add(this._lblNameFirst);
     this.grpDetails.Controls.Add(this.txtNameFirst);
     this.grpDetails.Controls.Add(this._lblPhone);
     this.grpDetails.Controls.Add(this.mskPhone);
     this.grpDetails.Location = new System.Drawing.Point(6, 6);
     this.grpDetails.Name     = "grpDetails";
     this.grpDetails.Size     = new System.Drawing.Size(348, 186);
     this.grpDetails.TabIndex = 0;
     this.grpDetails.TabStop  = false;
     this.grpDetails.Text     = "Switcher";
     //
     // 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, 156);
     this.chkStatus.Name            = "chkStatus";
     this.chkStatus.Size            = new System.Drawing.Size(96, 21);
     this.chkStatus.TabIndex        = 4;
     this.chkStatus.Text            = "Active";
     this.chkStatus.CheckedChanged += new System.EventHandler(this.ValidateForm);
     //
     // _lblNameLast
     //
     this._lblNameLast.Font       = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this._lblNameLast.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
     this._lblNameLast.Location   = new System.Drawing.Point(6, 54);
     this._lblNameLast.Name       = "_lblNameLast";
     this._lblNameLast.Size       = new System.Drawing.Size(96, 18);
     this._lblNameLast.TabIndex   = 15;
     this._lblNameLast.Text       = "Last Name";
     this._lblNameLast.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtNameLast
     //
     this.txtNameLast.ForeColor    = System.Drawing.SystemColors.ControlText;
     this.txtNameLast.Location     = new System.Drawing.Point(108, 54);
     this.txtNameLast.Name         = "txtNameLast";
     this.txtNameLast.Size         = new System.Drawing.Size(228, 21);
     this.txtNameLast.TabIndex     = 1;
     this.txtNameLast.Text         = "";
     this.txtNameLast.TextChanged += new System.EventHandler(this.ValidateForm);
     //
     // txtNameFirst
     //
     this.txtNameFirst.ForeColor    = System.Drawing.SystemColors.ControlText;
     this.txtNameFirst.Location     = new System.Drawing.Point(108, 24);
     this.txtNameFirst.Name         = "txtNameFirst";
     this.txtNameFirst.Size         = new System.Drawing.Size(228, 21);
     this.txtNameFirst.TabIndex     = 0;
     this.txtNameFirst.Text         = "";
     this.txtNameFirst.TextChanged += new System.EventHandler(this.ValidateForm);
     //
     // _lblPhone
     //
     this._lblPhone.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
     this._lblPhone.Location   = new System.Drawing.Point(6, 114);
     this._lblPhone.Name       = "_lblPhone";
     this._lblPhone.Size       = new System.Drawing.Size(96, 18);
     this._lblPhone.TabIndex   = 17;
     this._lblPhone.Text       = "Phone #";
     this._lblPhone.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
     //
     // mskPhone
     //
     this.mskPhone.EditAs        = Infragistics.Win.UltraWinMaskedEdit.EditAsType.UseSpecifiedMask;
     this.mskPhone.Location      = new System.Drawing.Point(108, 114);
     this.mskPhone.Name          = "mskPhone";
     this.mskPhone.TabIndex      = 3;
     this.mskPhone.ValueChanged += new System.EventHandler(this.ValidateForm);
     //
     // mSwitcherDS
     //
     this.mSwitcherDS.DataSetName = "SwitcherDS";
     this.mSwitcherDS.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.grpDetails);
     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";
     //
     // dlgSwitcherDetail
     //
     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            = "dlgSwitcherDetail";
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text            = "Switcher Details";
     this.Load           += new System.EventHandler(this.OnFormLoad);
     ((System.ComponentModel.ISupportInitialize)(this.mTerminalsDS)).EndInit();
     this.grpDetails.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.mSwitcherDS)).EndInit();
     this.tabDialog.ResumeLayout(false);
     this.tabGeneral.ResumeLayout(false);
     this.ResumeLayout(false);
 }