Esempio n. 1
0
        /// <summary>
        /// 设置控件位置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FpEnter_EditModeOn(object sender, EventArgs e)
        {
            try
            {
                this.noVisible();

                Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = this.getCurrentList(this.ActiveSheet,
                                                                                               this.ActiveSheet.ActiveColumnIndex);

                if (current == null)
                {
                    return;
                }

                //设置位置
                this.setLocal(current);

                if (this.showListWhenOfFocus && current.Visible == false)
                {
                    current.Filter(this.ActiveSheet.ActiveCell.Text);
                    current.Visible = true;
                }
            }
            catch { }
        }
Esempio n. 2
0
        /// <summary>
        /// 设置控件位置
        /// </summary>
        /// <param name="obj">弹出列表控件</param>
        private void SetListLocation(Neusoft.FrameWork.WinForms.Controls.PopUpListBox obj)
        {
            Control _cell = base.EditingControl;

            if (_cell == null)
            {
                return;
            }
            int y = _cell.Top + _cell.Height + obj.Height;

            if (y <= this.Height)
            {
                obj.Location = new System.Drawing.Point(_cell.Left, y - obj.Height);
            }
            else
            {
                if (_cell.Top > obj.Height)
                {
                    obj.Location = new System.Drawing.Point(_cell.Left, _cell.Top - obj.Height);
                }
                else
                {
                    obj.Location = new System.Drawing.Point(_cell.Left, _cell.Top + _cell.Height);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 设置控件位置
        /// </summary>
        /// <param name="obj"></param>
        private void setLocal(Neusoft.FrameWork.WinForms.Controls.PopUpListBox obj)
        {
            Control _cell = base.EditingControl;

            if (_cell == null)
            {
                return;
            }

            //int y = _cell.Top + _cell.Height + obj.Height;//+SystemInformation.Border3DSize.Height*2;
            //if (y <= this.Height)
            //    obj.Location = new System.Drawing.Point(_cell.Left, y - obj.Height);
            //else
            //    obj.Location = new System.Drawing.Point(_cell.Left, _cell.Top - obj.Height);

            int topHeight    = _cell.Top;
            int bottomHeight = this.Height - _cell.Top - _cell.Height;

            if (bottomHeight > obj.Height)        //可显示在下部
            {
                obj.Location = new Point(_cell.Left + 20, _cell.Top + _cell.Height + 5);
            }
            else if (topHeight > obj.Height)      //可显示在上部
            {
                obj.Location = new Point(_cell.Left + 20, _cell.Top - obj.Height - 5);
            }
            else                                               //平行显示
            {
                obj.Location = new Point(_cell.Left + _cell.Width + 10, _cell.Top);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 对于有项目列表的,自动进行过滤
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FpEnter_EditChange(object sender, EditorNotifyEventArgs e)
        {
            try
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = this.getCurrentList(this.ActiveSheet,
                                                                                               this.ActiveSheet.ActiveColumnIndex);

                if (current == null)
                {
                    return;
                }

                string Text = e.EditingControl.Text.Trim();

                current.Filter(Text);

                this.ActiveSheet.SetTag(this.ActiveSheet.ActiveRowIndex, this.ActiveSheet.ActiveColumnIndex, null);

                if (current.Visible == false)
                {
                    current.Visible = true;
                }
            }
            catch { }
        }
Esempio n. 5
0
        /// <summary>
        /// 选择项目列表
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        private int FpEnter_SelectItem(Keys key)
        {
            FrameWork.Models.NeuObject obj = new FrameWork.Models.NeuObject();
            Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = this.getCurrentList(this.ActiveSheet,
                                                                                           this.ActiveSheet.ActiveColumnIndex);

            if (current == null)
            {
                return(-1);
            }

            if (current.GetSelectedItem(out obj) == -1)
            {
                return(-1);
            }
            if (obj == null)
            {
                return(-1);
            }

            if (this.SetItem != null)
            {
                this.SetItem(obj);
            }

            current.Visible = false;

            return(0);
        }
Esempio n. 6
0
        private int fpEnter1_KeyEnter(Keys key)
        {
            if (key == Keys.Enter)
            {
                if (this.fpEnter1_Sheet1.ActiveColumnIndex == 1)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox list = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 1);
                    if (list == null)
                    {
                        return(-1);
                    }

                    Neusoft.FrameWork.Models.NeuObject obj = null;
                    if (list.GetSelectedItem(out obj) == -1)
                    {
                        return(-1);
                    }

                    if (obj == null)
                    {
                        return(-1);
                    }

                    this.fpEnter1_Sheet1.SetText(this.fpEnter1_Sheet1.ActiveRowIndex, 1, obj.Name);
                    this.fpEnter1_Sheet1.SetTag(this.fpEnter1_Sheet1.ActiveRowIndex, 1, obj.ID);

                    list.Visible = false;
                    this.fpEnter1_Sheet1.SetActiveCell(this.fpEnter1_Sheet1.ActiveRowIndex, 2, false);
                }
            }
            return(0);
        }
Esempio n. 7
0
        /// <summary>
        /// 设置 在当前活动SheetView内 简单下拉列表显示
        /// </summary>
        /// <param name="sheetView">欲显示的SheetView</param>
        /// <param name="al">列表数组</param>
        /// <param name="iColumnIndex">需显示本列表的列</param>
        public void SetColumnList(FarPoint.Win.Spread.SheetView sheetView, ArrayList al, params int[] iColumnIndex)
        {
            if (this.Lists == null)
            {
                this.Lists = new ArrayList();
            }

            int iListIndex = this.Lists.Count;

            this.listBoxEnabled = true;

            InputMap im;

            im = base.GetInputMap(InputMapMode.WhenAncestorOfFocused);
            im.Put(new Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.None);

            Neusoft.FrameWork.WinForms.Controls.PopUpListBox obj = new Neusoft.FrameWork.WinForms.Controls.PopUpListBox();
            obj.AddItems(al);
            this.Controls.Add(obj);
            obj.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            obj.Size        = new System.Drawing.Size(this.intWidth, this.intHeight);
            obj.Visible     = false;

            this.Lists.Add(obj);

            string str = "";

            foreach (int i in iColumnIndex)
            {
                str = string.Format("{0}|{1}{2}", iListIndex.ToString(), sheetView.SheetName, i.ToString());
                if (this.sheetList == null)
                {
                    this.sheetList = new ArrayList();
                }
                else
                {
                    if (this.JudgeListRow(i))   //原来在该列设置过弹出列表 则覆盖原有实现
                    {
                        string tempStr     = sheetView.SheetName + i.ToString();
                        string tempListStr = "";
                        foreach (string info in this.sheetList)
                        {
                            if (info.Substring(info.IndexOf("|") + 1) == tempStr)
                            {
                                tempListStr = info;
                                break;
                            }
                        }

                        if (tempListStr != "")
                        {
                            this.sheetList.Remove(tempListStr);
                        }
                    }
                }
                this.sheetList.Add(str);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 处理回车操作 ,并且取出数据
        /// </summary>
        /// <returns></returns>
        private int ProcessDept()
        {
            int CurrentRow = fpEnter1_Sheet1.ActiveRowIndex;

            if (CurrentRow < 0)
            {
                return(0);
            }

            if (fpEnter1_Sheet1.ActiveColumnIndex == 0)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 0);
                //获取选中的信息
                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                //科室编码
                fpEnter1_Sheet1.ActiveCell.Text = item.ID;
                //科室名称
                fpEnter1_Sheet1.Cells[CurrentRow, 1].Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 2);
                return(0);
            }

            else if (fpEnter1_Sheet1.ActiveColumnIndex == 1)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 1);
                //获取选中的信息
                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                //科室名称
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                //科室编码
                fpEnter1_Sheet1.Cells[CurrentRow, 0].Text = item.ID;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 2);
                return(0);
            }
            return(0);
        }
Esempio n. 9
0
 private int neuFpEnter1_KeyEnter(Keys key)
 {
     if (key != Keys.Enter)
     {
         return(1);
     }
     if (this.neuFpEnter1_Sheet1.ActiveColumnIndex == 2)
     {
         Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.neuFpEnter1.getCurrentList(this.neuFpEnter1_Sheet1, 2);
         Neusoft.FrameWork.Models.NeuObject obj = listBox.GetSelectedItem() as Neusoft.FrameWork.Models.NeuObject;
         this.neuFpEnter1_SetItem(obj);
         listBox.Visible = false;
     }
     return(1);
 }
Esempio n. 10
0
        protected override void OnEditModeOn(EventArgs e)
        {
            if (this.phaListEnabled && this.ucItemList1 != null && this.ActiveSheet.ActiveRowIndex == this.phaListColumnIndex)
            {
                this.SetListLocation();

                if (this.ActiveSheet.ActiveColumnIndex != this.phaListColumnIndex)
                {
                    this.ucItemList1.Visible = false;
                }
            }
            if (this.listBoxEnabled && this.Lists != null && this.Lists.Count > 0)
            {
                this.VisibleAllList();

                if (this.JudgeListRow(this.ActiveSheet.ActiveRowIndex))
                {
                    if (this.ActiveSheet.ActiveColumn.Visible)
                    {
                        #region 当前列为显示状态时 才进行处理
                        string str    = this.ActiveSheet.SheetName + this.ActiveSheet.ActiveColumnIndex.ToString();
                        int    iIndex = this.GetListIndex(str);
                        if (iIndex != -1)
                        {
                            Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = null;
                            current = this.Lists[iIndex] as Neusoft.FrameWork.WinForms.Controls.PopUpListBox;
                            if (current != null)
                            {
                                //设置位置
                                this.SetListLocation(current);
                                if (current.Visible == false)
                                {
                                    current.Visible = true;
                                }
                            }
                        }
                        #endregion
                    }
                }
            }
            base.OnEditModeOn(e);
        }
Esempio n. 11
0
        /// <summary>
        /// 设置cell下来列表
        /// </summary>
        /// <param name="view"></param>
        /// <param name="col"></param>
        /// <param name="al"></param>
        public void SetColumnList(FarPoint.Win.Spread.SheetView view, int col, ArrayList al)
        {
            string name = view.SheetName + "_" + col.ToString();

            for (int i = 0; i < this.Lists.Length - 1; i++)
            {
                if (this.Lists[i] != null && (this.Lists[i] as Neusoft.FrameWork.WinForms.Controls.PopUpListBox).Name == name)
                {
                    //MessageBox.Show("cell["+row.ToString()+","+col.ToString()+"]已经存在下拉列表!","提示");
                    return;
                }
            }

            Neusoft.FrameWork.WinForms.Controls.PopUpListBox obj = new Neusoft.FrameWork.WinForms.Controls.PopUpListBox();
            obj.Name = name;
            obj.AddItems(al);
            //得到最大列表数
            int Index = -1;

            for (int i = 0; i < this.Lists.Length; i++)
            {
                if (this.Lists[i] == null)
                {
                    Index = i;
                    break;
                }
            }
            if (Index == -1)
            {
                MessageBox.Show("列表已经超过最大数10", "提示");
                return;
            }

            this.Lists[Index]             = obj;
            this.Lists[Index].SelectItem += new Neusoft.FrameWork.WinForms.Controls.PopUpListBox.MyDelegate(FpEnter_SelectItem);
            this.Controls.Add(this.Lists[Index]);
            this.Lists[Index].BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Lists[Index].Cursor      = Cursors.Hand;
            this.Lists[Index].Size        = new System.Drawing.Size(intWidth, intHeight);
            this.Lists[Index].Visible     = false;
            this.Lists[Index].SelectNone  = selectNone;
        }
Esempio n. 12
0
        protected override void OnEditChange(FarPoint.Win.Spread.EditorNotifyEventArgs e)
        {
            if (this.phaListEnabled && this.ucItemList1 != null)
            {
                if (e.Column == this.phaListColumnIndex && this.ucItemList1 != null)
                {
                    this.SetListLocation();

                    this.ucItemList1.BringToFront();
                    if (!this.ucItemList1.Visible)
                    {
                        this.ucItemList1.Visible = true;
                    }

                    this.ucItemList1.Filter(this.ActiveSheet.ActiveCell.Text);
                }
            }
            if (this.listBoxEnabled && this.Lists != null && this.Lists.Count > 0)
            {
                if (this.JudgeListRow(e.Row))
                {
                    string str    = this.ActiveSheet.SheetName + e.Column.ToString();
                    int    iIndex = this.GetListIndex(str);
                    if (iIndex != -1)
                    {
                        Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = null;
                        current = this.Lists[iIndex] as Neusoft.FrameWork.WinForms.Controls.PopUpListBox;
                        if (current != null)
                        {
                            current.Filter(e.EditingControl.Text.Trim());
                            if (current.Visible == false)
                            {
                                current.Visible = true;
                            }
                        }
                    }
                }
            }
            base.OnEditChange(e);
        }
Esempio n. 13
0
        /// <summary>
        /// 由列表获取所选择项目
        /// </summary>
        /// <returns>成功返回1 出错返回-1</returns>
        protected int GetSelectItem()
        {
            int currentRow = this.fpEnter1_Sheet1.ActiveRowIndex;

            if (currentRow < 0)
            {
                return(0);
            }
            if (this.fpEnter1_Sheet1.ActiveColumnIndex == (int)ColumnSet.ColTradeName)
            {
                //获取选中的信息
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)ColumnSet.ColTradeName);
                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                if (item == null)
                {
                    return(-1);
                }
                this.SetSelectItem(item);
                return(0);
            }
            if (this.fpEnter1_Sheet1.ActiveColumnIndex == (int)ColumnSet.ColUsage)
            {
                //获取选中的信息
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)ColumnSet.ColUsage);
                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                if (item == null)
                {
                    return(-1);
                }
                this.SetSelectItem(item);
                return(0);
            }
            return(0);
        }
Esempio n. 14
0
        /// <summary>
        /// 从下拉列表获取所选择项目
        /// </summary>
        private Neusoft.FrameWork.Models.NeuObject GetItemFormList()
        {
            Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject();

            string str    = this.ActiveSheet.SheetName + this.ActiveSheet.ActiveColumnIndex.ToString();
            int    iIndex = this.GetListIndex(str);

            if (iIndex == -1 || iIndex >= this.Lists.Count)
            {
                return(null);
            }
            Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = null;
            current = this.Lists[iIndex] as Neusoft.FrameWork.WinForms.Controls.PopUpListBox;
            if (current != null && current.Visible)
            {
                if (current.GetSelectedItem(out obj) == -1)
                {
                    return(null);
                }
                current.Visible = false;
                return(obj);
            }
            return(null);
        }
Esempio n. 15
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (this.phaListEnabled && this.ucItemList1 != null && this.ucItemList1.Visible && this.ContainsFocus && this.ActiveSheet.ActiveColumnIndex == this.phaListColumnIndex)
            {
                #region 处理药品列表
                if (keyData == Keys.Escape)
                {
                    base.ProcessCmdKey(ref msg, keyData);

                    this.ucItemList1.Key(keyData);

                    return(true);
                }
                if (keyData == Keys.Enter)
                {
                    this.ucItemList1.Key(keyData);
                }
                else if (keyData == Keys.Up || keyData == Keys.Down)
                {
                    if (this.ucItemList1.Visible)
                    {
                        this.ucItemList1.Key(keyData);
                        return(true);
                    }
                }
                #endregion
            }
            else if (this.listBoxEnabled && this.Lists != null && this.Lists.Count > 0)
            {
                #region  拉列表
                if (keyData == Keys.Up || keyData == Keys.Down)
                {
                    #region   键
                    string str    = this.ActiveSheet.SheetName + this.ActiveSheet.ActiveColumnIndex.ToString();
                    int    iIndex = this.GetListIndex(str);
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = null;
                    if (iIndex != -1)
                    {
                        current = this.Lists[iIndex] as Neusoft.FrameWork.WinForms.Controls.PopUpListBox;
                    }
                    if (current != null && current.Visible)
                    {
                    }
                    else
                    {
                        if (keyData == Keys.Up)
                        {
                            this.ActiveSheet.ActiveRowIndex--;
                        }
                        else
                        {
                            this.ActiveSheet.ActiveRowIndex++;
                        }
                    }
                    #endregion
                }
                else if (keyData == Keys.Enter)
                {
                    this.obj_SelectItem(keyData);
                }
                #endregion
            }
            if (this.Key != null)
            {
                this.Key(keyData, System.EventArgs.Empty);
            }

            return(base.ProcessCmdKey(ref msg, keyData));
        }
Esempio n. 16
0
        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。

        /// </summary>
        private void InitializeComponent()
        {
            FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType2 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType3 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType4 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType5 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType6 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType7 = new FarPoint.Win.Spread.CellType.TextCellType();
            FarPoint.Win.Spread.CellType.TextCellType textCellType8 = new FarPoint.Win.Spread.CellType.TextCellType();
            this.fpSpread1        = new FarPoint.Win.Spread.FpSpread();
            this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
            this.lbTitle          = new Neusoft.FrameWork.WinForms.Controls.NeuLabel();
            this.lbDate           = new Neusoft.FrameWork.WinForms.Controls.NeuLabel();
            this.panelList        = new Neusoft.FrameWork.WinForms.Controls.NeuPanel();
            this.groupBox1        = new Neusoft.FrameWork.WinForms.Controls.NeuGroupBox();
            this.lbType           = new Neusoft.FrameWork.WinForms.Controls.PopUpListBox();
            this.label1           = new Neusoft.FrameWork.WinForms.Controls.NeuLabel();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();
            this.panelList.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // fpSpread1
            //
            this.fpSpread1.AllowDragDrop = true;
            this.fpSpread1.AllowDrop     = true;
            this.fpSpread1.Anchor        = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                                  | System.Windows.Forms.AnchorStyles.Left)
                                                                                 | System.Windows.Forms.AnchorStyles.Right)));
            this.fpSpread1.BackColor         = System.Drawing.SystemColors.Window;
            this.fpSpread1.BorderStyle       = System.Windows.Forms.BorderStyle.FixedSingle;
            this.fpSpread1.ButtonDrawMode    = FarPoint.Win.Spread.ButtonDrawModes.CurrentCell;
            this.fpSpread1.EditModePermanent = true;
            this.fpSpread1.EditModeReplace   = true;
            this.fpSpread1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
            this.fpSpread1.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
            this.fpSpread1.Location = new System.Drawing.Point(8, 52);
            this.fpSpread1.Name     = "fpSpread1";
            this.fpSpread1.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
                this.fpSpread1_Sheet1
            });
            this.fpSpread1.Size                    = new System.Drawing.Size(642, 372);
            this.fpSpread1.TabIndex                = 0;
            this.fpSpread1.TextTipPolicy           = FarPoint.Win.Spread.TextTipPolicy.Fixed;
            this.fpSpread1.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
            this.fpSpread1.DragOver               += new System.Windows.Forms.DragEventHandler(this.fpSpread1_DragOver);
            this.fpSpread1.EditModeOn             += new System.EventHandler(this.fpSpread1_EditModeOn);
            this.fpSpread1.MouseMove              += new System.Windows.Forms.MouseEventHandler(this.fpSpread1_MouseMove);
            this.fpSpread1.MouseDown              += new System.Windows.Forms.MouseEventHandler(this.fpSpread1_MouseDown);
            this.fpSpread1.MouseUp                += new System.Windows.Forms.MouseEventHandler(this.fpSpread1_MouseUp);
            this.fpSpread1.EditModeOff            += new System.EventHandler(this.fpSpread1_EditModeOff);
            this.fpSpread1.DragDrop               += new System.Windows.Forms.DragEventHandler(this.fpSpread1_DragDrop);
            this.fpSpread1.CellClick              += new FarPoint.Win.Spread.CellClickEventHandler(this.fpSpread1_CellClick);
            this.fpSpread1.EditChange             += new FarPoint.Win.Spread.EditorNotifyEventHandler(this.fpSpread1_EditChange);
            //
            // fpSpread1_Sheet1
            //
            this.fpSpread1_Sheet1.Reset();
            this.fpSpread1_Sheet1.ColumnCount                         = 10;
            this.fpSpread1_Sheet1.RowCount                            = 0;
            this.fpSpread1_Sheet1.RowHeader.ColumnCount               = 0;
            this.fpSpread1_Sheet1.ActiveSkin                          = new FarPoint.Win.Spread.SheetSkin("CustomSkin2", System.Drawing.SystemColors.Window, System.Drawing.Color.Empty, System.Drawing.Color.Empty, System.Drawing.SystemColors.WindowText, FarPoint.Win.Spread.GridLines.Both, System.Drawing.Color.White, System.Drawing.Color.Empty, System.Drawing.Color.Empty, System.Drawing.Color.Empty, System.Drawing.Color.Empty, System.Drawing.Color.Empty, true, false, false, true, false);
            this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 0).Text   = "序号";
            this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 1).Text   = "姓名";
            this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.BackColor = System.Drawing.Color.White;
            this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.Parent    = "HeaderDefault";
            this.fpSpread1_Sheet1.Columns.Get(0).Label                = "序号";
            this.fpSpread1_Sheet1.Columns.Get(0).Width                = 42F;
            this.fpSpread1_Sheet1.Columns.Get(1).CellType             = textCellType1;
            this.fpSpread1_Sheet1.Columns.Get(1).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.General;
            this.fpSpread1_Sheet1.Columns.Get(1).Label                = "姓名";
            this.fpSpread1_Sheet1.Columns.Get(1).Width                = 98F;
            this.fpSpread1_Sheet1.Columns.Get(2).CellType             = textCellType2;
            this.fpSpread1_Sheet1.Columns.Get(2).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(2).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(3).CellType             = textCellType3;
            this.fpSpread1_Sheet1.Columns.Get(3).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(3).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(4).CellType             = textCellType4;
            this.fpSpread1_Sheet1.Columns.Get(4).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(4).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(5).CellType             = textCellType5;
            this.fpSpread1_Sheet1.Columns.Get(5).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(5).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(6).CellType             = textCellType6;
            this.fpSpread1_Sheet1.Columns.Get(6).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(6).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(7).CellType             = textCellType7;
            this.fpSpread1_Sheet1.Columns.Get(7).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(7).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(8).CellType             = textCellType8;
            this.fpSpread1_Sheet1.Columns.Get(8).HorizontalAlignment  = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
            this.fpSpread1_Sheet1.Columns.Get(8).Width                = 85F;
            this.fpSpread1_Sheet1.Columns.Get(9).Visible              = false;
            this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false;
            this.fpSpread1_Sheet1.RowHeader.DefaultStyle.BackColor    = System.Drawing.Color.White;
            this.fpSpread1_Sheet1.RowHeader.DefaultStyle.Parent       = "HeaderDefault";
            this.fpSpread1_Sheet1.RowHeader.Visible                   = false;
            this.fpSpread1_Sheet1.SheetCornerStyle.BackColor          = System.Drawing.Color.White;
            this.fpSpread1_Sheet1.SheetCornerStyle.Parent             = "HeaderDefault";
            this.fpSpread1_Sheet1.SheetName                           = "Sheet1";
            //
            // lbTitle
            //
            this.lbTitle.Font      = new System.Drawing.Font("黑体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
            this.lbTitle.Location  = new System.Drawing.Point(230, 13);
            this.lbTitle.Name      = "lbTitle";
            this.lbTitle.Size      = new System.Drawing.Size(238, 26);
            this.lbTitle.TabIndex  = 0;
            this.lbTitle.Text      = "科室排班表";
            this.lbTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // lbDate
            //
            this.lbDate.Location = new System.Drawing.Point(472, 28);
            this.lbDate.Name     = "lbDate";
            this.lbDate.Size     = new System.Drawing.Size(176, 19);
            this.lbDate.TabIndex = 1;
            this.lbDate.Text     = "排班时间:";
            //
            // panelList
            //
            this.panelList.BackColor = System.Drawing.SystemColors.Control;
            this.panelList.Controls.Add(this.groupBox1);
            this.panelList.Location = new System.Drawing.Point(334, 169);
            this.panelList.Name     = "panelList";
            this.panelList.Size     = new System.Drawing.Size(184, 230);
            this.panelList.TabIndex = 2;
            //
            // groupBox1
            //
            this.groupBox1.BackColor = System.Drawing.Color.Silver;
            this.groupBox1.Controls.Add(this.lbType);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.groupBox1.Font     = new System.Drawing.Font("宋体", 1F);
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Name     = "groupBox1";
            this.groupBox1.Size     = new System.Drawing.Size(184, 230);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop  = false;
            //
            // lbType
            //
            this.lbType.BackColor           = System.Drawing.Color.Silver;
            this.lbType.BorderStyle         = System.Windows.Forms.BorderStyle.None;
            this.lbType.Cursor              = System.Windows.Forms.Cursors.Hand;
            this.lbType.Font                = new System.Drawing.Font("宋体", 11F);
            this.lbType.HorizontalScrollbar = true;
            this.lbType.InputCode           = 0;
            this.lbType.IsShowID            = true;
            this.lbType.ItemHeight          = 15;
            this.lbType.Location            = new System.Drawing.Point(5, 22);
            this.lbType.Name                = "lbType";
            this.lbType.SelectNone          = false;
            this.lbType.Size                = new System.Drawing.Size(174, 195);
            this.lbType.TabIndex            = 1;
            //
            // label1
            //
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.label1.Location    = new System.Drawing.Point(4, 21);
            this.label1.Name        = "label1";
            this.label1.Size        = new System.Drawing.Size(176, 205);
            this.label1.TabIndex    = 0;
            //
            // ucTabular
            //
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.panelList);
            this.Controls.Add(this.lbDate);
            this.Controls.Add(this.lbTitle);
            this.Controls.Add(this.fpSpread1);
            this.Name = "ucTabular";
            this.Size = new System.Drawing.Size(658, 431);
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
            this.panelList.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.ResumeLayout(false);
        }
Esempio n. 17
0
        /// <summary>
        /// 响应按键事件
        /// </summary>
        /// <param name="keyData"></param>
        /// <returns></returns>
        protected override bool ProcessDialogKey(Keys keyData)
        {
            if (this.ContainsFocus)
            {
                if (keyData == Keys.Enter)
                {
                    if (this.KeyEnter != null)
                    {
                        this.KeyEnter(Keys.Enter);
                    }
                }
                else if (keyData == Keys.Up)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = this.getCurrentList(this.ActiveSheet, this.ActiveSheet.ActiveColumnIndex);
                    if (current != null && current.Visible)
                    {
                        current.PriorRow();
                    }
                    else
                    {
                        if (!hs.Contains(ActiveSheet.ActiveColumnIndex))
                        {
                            if (this.ActiveSheet.ActiveRowIndex > 0)
                            {
                                this.ActiveSheet.ActiveRowIndex--;
                            }
                        }
                    }

                    if (this.KeyEnter != null)
                    {
                        this.KeyEnter(Keys.Up);
                    }
                }
                else if (keyData == Keys.Down)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox current = this.getCurrentList(this.ActiveSheet, this.ActiveSheet.ActiveColumnIndex);
                    if (current != null && current.Visible)
                    {
                        current.NextRow();
                    }
                    else
                    {
                        if (!hs.Contains(ActiveSheet.ActiveColumnIndex))
                        {
                            if (this.ActiveSheet.ActiveRowIndex < this.ActiveSheet.RowCount - 1)
                            {
                                this.ActiveSheet.ActiveRowIndex++;
                            }
                        }
                    }

                    if (this.KeyEnter != null)
                    {
                        this.KeyEnter(Keys.Down);
                    }
                }
                else if (keyData == Keys.Escape)
                {
                    this.noVisible();

                    if (this.KeyEnter != null)
                    {
                        this.KeyEnter(Keys.Escape);
                    }
                }
            }
            return(base.ProcessDialogKey(keyData));
        }
Esempio n. 18
0
        /// <summary>
        /// 处理回车操作 ,并且取出数据
        /// </summary>
        /// <returns></returns>
        private int ProcessDept()
        {
            try
            {
                int CurrentRow = fpEnter1_Sheet1.ActiveRowIndex;
                if (CurrentRow < 0)
                {
                    return(0);
                }

                if (fpEnter1_Sheet1.ActiveColumnIndex == 0)
                {
                    //获取选中的信息
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 0);
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    //性别
                    fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 1);
                    return(0);
                }
                else if (fpEnter1_Sheet1.ActiveColumnIndex == 1)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 1);
                    //获取选中的信息
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    // 分娩结果
                    fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 2);
                    return(0);
                }
                else if (fpEnter1_Sheet1.ActiveColumnIndex == 3)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 3);
                    //获取选中的信息
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    //转归
                    fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 4);
                    return(0);
                }
                else if (fpEnter1_Sheet1.ActiveColumnIndex == 4)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 4);
                    //获取选中的信息
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    //分期
                    fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 5);
                    return(0);
                }
                else if (fpEnter1_Sheet1.ActiveColumnIndex == 6)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 6);
                    //获取选中的信息
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    //ICD诊断名称
                    fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                    //ICD诊断编码
                    fpEnter1_Sheet1.Cells[CurrentRow, 7].Text = item.ID;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 8);
                    return(0);
                }
                else if (fpEnter1_Sheet1.ActiveColumnIndex == 7)
                {
                    Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, 7);
                    //获取选中的信息
                    Neusoft.FrameWork.Models.NeuObject item = null;
                    int rtn = listBox.GetSelectedItem(out item);
                    //					if(rtn==-1)return -1;
                    if (item == null)
                    {
                        return(-1);
                    }
                    //ICD编码
                    fpEnter1_Sheet1.ActiveCell.Text = item.ID;
                    //ICD名称
                    fpEnter1_Sheet1.Cells[CurrentRow, 6].Text = item.Name;
                    fpEnter1.Focus();
                    fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, 8);
                    return(0);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(0);
        }
Esempio n. 19
0
        /// <summary>
        /// 处理回车操作 ,并且取出数据

        /// </summary>
        /// <returns></returns>
        private int ProcessDept()
        {
            int CurrentRow = fpEnter1_Sheet1.ActiveRowIndex;

            if (CurrentRow < 0)
            {
                return(0);
            }

            if (fpEnter1_Sheet1.ActiveColumnIndex == (int)EnumCol.DiagKind) //诊断类型
            {
                //获取选中的信息

                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)EnumCol.DiagKind);
                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                //诊断类别
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, (int)EnumCol.Icd10Code);
                return(0);
            }
            else if (fpEnter1_Sheet1.ActiveColumnIndex == (int)EnumCol.OutState)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)EnumCol.OutState);
                //获取选中的信息

                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                // 出院信息
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, (int)EnumCol.OperationFlag);
                return(0);
            }
            else if (fpEnter1_Sheet1.ActiveColumnIndex == (int)EnumCol.OperationFlag)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)EnumCol.OperationFlag);
                //获取选中的信息

                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                // 出院信息
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, (int)EnumCol.Disease);
                return(0);
            }
            else if (fpEnter1_Sheet1.ActiveColumnIndex == (int)EnumCol.Perior)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)EnumCol.Perior);
                //获取选中的信息

                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                //分期
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, (int)EnumCol.Level);
                return(0);
            }
            else if (fpEnter1_Sheet1.ActiveColumnIndex == (int)EnumCol.Level)
            {
                Neusoft.FrameWork.WinForms.Controls.PopUpListBox listBox = this.fpEnter1.getCurrentList(this.fpEnter1_Sheet1, (int)EnumCol.Level);
                //获取选中的信息

                Neusoft.FrameWork.Models.NeuObject item = null;
                int rtn = listBox.GetSelectedItem(out item);
                //				if(rtn==-1)return -1;
                if (item == null)
                {
                    return(-1);
                }
                //分期
                fpEnter1_Sheet1.ActiveCell.Text = item.Name;
                fpEnter1.Focus();
                fpEnter1_Sheet1.SetActiveCell(fpEnter1_Sheet1.ActiveRowIndex, (int)EnumCol.DubDiag);
                return(0);
            }

            return(0);
        }