Example #1
0
        /// <summary>
        ///  增加设备
        /// </summary>
        public void Add(Neusoft.HISFC.Models.Terminal.TerminalCarrier terminalCarrier)
        {
            try
            {
                //增加一行

                this.neuSpread1_Sheet1.Rows.Add(this.neuSpread1_Sheet1.RowCount, 1);
                //设置当前行

                this.neuSpread1_Sheet1.ActiveRowIndex = this.neuSpread1_Sheet1.RowCount - 1;
                int row = this.neuSpread1_Sheet1.ActiveRowIndex;

                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.ItemCode, terminalCarrier.CarrierCode, false);
                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.ItemName, terminalCarrier.CarrierName, false);
                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.UnitFlag, this.GetUnitNameByID(terminalCarrier.CarrierType), false);
                this.neuSpread1_Sheet1.Cells [row, ( int )cols.BookLmt].Text        = "0";
                this.neuSpread1_Sheet1.Cells [row, ( int )cols.SpecialBookLmt].Text = "0";
                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.Remark, " ", false);
                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.Valid, "有效", false);
                this.neuSpread1_Sheet1.SetValue(row, ( int )cols.TmpFlag, "2", false);
                //{5A111831-190D-4187-8076-83E220BC97B2}
                this.neuSpread1_Sheet1.Cells[row, (int)cols.StartTime].Text = "00:00:00";
                this.neuSpread1_Sheet1.Cells[row, (int)cols.EndTime].Text   = "00:00:00";
                this.neuSpread1.Focus( );
                this.neuSpread1_Sheet1.SetActiveCell(this.neuSpread1_Sheet1.ActiveRowIndex, ( int )cols.BookLmt, false);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "提示信息");
                return;
            }
        }
        public new TerminalCarrier Clone()
        {
            TerminalCarrier terminalCarrier = base.Clone() as TerminalCarrier;

            terminalCarrier.dept        = this.dept.Clone();
            terminalCarrier.validOper   = this.validOper.Clone();
            terminalCarrier.invalidOper = this.invalidOper.Clone();

            return(terminalCarrier);
        }
        /// <summary>
        /// 增加
        /// </summary>
        private void Add()
        {
            int tabIndex = this.neuTabControl1.SelectedIndex;

            if (this.neuTreeView1.SelectedNode.Tag.GetType( ).FullName.Equals("Neusoft.HISFC.Models.Terminal.MedTechItem"))
            {
                this.medTechItem = (Neusoft.HISFC.Models.Terminal.MedTechItem) this.neuTreeView1.SelectedNode.Tag;
                if (this.medTechItem == null)
                {
                    return;
                }
                else
                {
                    try
                    {
                        this.controls [tabIndex].Add(this.medTechItem);
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message, "提示信息");
                        return;
                    }
                }
            }
            else if (this.neuTreeView1.SelectedNode.Tag.GetType( ).FullName.Equals("Neusoft.HISFC.Models.Terminal.TerminalCarrier"))
            {
                this.terminalCarrier = (Neusoft.HISFC.Models.Terminal.TerminalCarrier) this.neuTreeView1.SelectedNode.Tag;
                if (this.terminalCarrier == null)
                {
                    return;
                }
                else
                {
                    try
                    {
                        this.controls [tabIndex].Add(this.terminalCarrier);
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message, "提示信息");
                        return;
                    }
                }
            }
            this.JudgeTmpFlag(tabIndex);
        }