Пример #1
0
        private void tvItemLevel1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (this.tvItemLevel1.SelectedNode.Tag == null)
            {
                return;
            }
            this.neuSpread1_Sheet1.RowCount = 0;
            ArrayList alItemLevel = new ArrayList();

            Neusoft.HISFC.Models.Fee.Item.ItemLevel myItemLevel = this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
            if ((this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel).ID == "ROOT")
            {
                alItemLevel = this.itemLevelManager.GetAllItemByFolderAndItemClass(myItemLevel.ID, myItemLevel.LevelClass.ID);
            }
            else
            {
                alItemLevel = this.itemLevelManager.GetAllItemByFolderID(myItemLevel.ID);
            }
            if (alItemLevel != null)
            {
                foreach (Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel in alItemLevel)
                {
                    this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1);
                    int lastRowIndex = this.neuSpread1_Sheet1.RowCount - 1;
                    this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColCode].Text   = itemLevel.ID;
                    this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColName].Text   = itemLevel.Name;
                    this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColSortID].Text = itemLevel.SortID.ToString();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 插入或更新组套文件夹
        /// </summary>
        /// <param name="itemLevelFolder"></param>
        /// <returns></returns>
        public int SetNewFolder(Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevelFolder)
        {
            //如果为空--获得
            if (itemLevelFolder.ID == "")
            {
                itemLevelFolder.ID = this.GetNewFolderID();
                if (itemLevelFolder.ID == "")
                {
                    return(-1);
                }
            }
            //先更新
            int iRet = this.updateFolder(itemLevelFolder);

            if (iRet < 0)//出错
            {
                return(-1);
            }
            else if (iRet == 0)//没有更新到
            {
                //插入
                int iReturn = this.insertFolder(itemLevelFolder);
                if (iReturn < 0)//出错
                {
                    return(-1);
                }
                return(iReturn);
            }
            //返回
            return(iRet);
        }
Пример #3
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void deleteItem_Click(object sender, EventArgs e)
 {
     try
     {
         Neusoft.HISFC.Models.Fee.Item.ItemLevel info = this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
         if (info.UserCode == "F")//文件夹
         {
             if (MessageBox.Show("是否删除文件夹" + info.Name, "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 if (this.itemLevelManager.deleteFolder(info) < 0)
                 {
                     MessageBox.Show(this.itemLevelManager.Err);
                 }
                 this.RefreshGroupByClass();
             }
         }
         //else
         //{
         //    if (MessageBox.Show("是否删除组套" + info.Name, "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
         //    {
         //        if (this.itemLevelManager.DeleteGroup(info) == -1)
         //        {
         //            MessageBox.Show(this.groupManager.Err);
         //        }
         //        this.RefreshGroupByClass();
         //    }
         //}
     }
     catch { }
 }
Пример #4
0
        private ArrayList GetFolder(string strSql)
        {
            if (this.ExecQuery(strSql) < 0)
            {
                return(null);
            }
            ArrayList al = new ArrayList();

            while (this.Reader.Read())
            {
                Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel = new Neusoft.HISFC.Models.Fee.Item.ItemLevel();
                itemLevel.ID            = this.Reader[0].ToString(); //编码
                itemLevel.Name          = this.Reader[1].ToString(); //名称
                itemLevel.InOutType     = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[2].ToString());
                itemLevel.Dept.ID       = this.Reader[3].ToString(); //科室代码
                itemLevel.Owner.ID      = this.Reader[4].ToString(); //所属人代码
                itemLevel.SpellCode     = this.Reader[5].ToString();
                itemLevel.WBCode        = this.Reader[6].ToString();
                itemLevel.IsShared      = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[7].ToString());
                itemLevel.Memo          = this.Reader[8].ToString(); //备注
                itemLevel.UserCode      = "F";                       //代表是文件夹
                itemLevel.ParentID      = this.Reader[9].ToString(); //上级文件夹编码
                itemLevel.LevelClass.ID = this.Reader[10].ToString();
                itemLevel.SortID        = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[11]);

                al.Add(itemLevel);
            }
            this.Reader.Close();
            return(al);
        }
Пример #5
0
        /// <summary>
        /// 删除文件夹,同时更新其所属组套为没有文件夹
        /// </summary>
        /// <param name="groupFolder"></param>
        /// <returns></returns>
        public int deleteFolder(Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevelFolder)
        {
            string strSql  = "";
            string strSql1 = "";

            if (this.Sql.GetSql("Manager.ItemLevel.deleteFolder", ref strSql) == -1)
            {
                return(-1);
            }
            if (this.Sql.GetSql("Manager.ItemLevel.updateFolderIDNull", ref strSql1) == -1)
            {
                return(-1);
            }
            strSql = System.String.Format(strSql, itemLevelFolder.ID);

            if (this.ExecNoQuery(strSql) < 0)
            {
                return(-1);
            }
            strSql1 = System.String.Format(strSql1, itemLevelFolder.ID);

            //if (this.ExecNoQuery(strSql1) < 0)
            //{
            //    return -1;
            //}

            return(1);
        }
Пример #6
0
        public void RefreshGroupByClass()
        {
            if (string.IsNullOrEmpty(levelClass.ID))
            {
                return;
            }
            this.Nodes.Clear();
            TreeNode rootNode = new TreeNode(levelClass.Name);

            rootNode.ImageIndex         = 0;
            rootNode.SelectedImageIndex = 1;
            Neusoft.HISFC.Models.Fee.Item.ItemLevel rootLevel = new Neusoft.HISFC.Models.Fee.Item.ItemLevel();
            rootLevel.ID         = "ROOT";
            rootLevel.LevelClass = this.levelClass;
            rootLevel.UserCode   = "F";
            rootNode.Tag         = rootLevel;
            this.Nodes.Add(rootNode);

            #region "获得组套 获取当前科室的科室组套 当前操作员的个人组套  全院组套"
            ArrayList alFolder = this.itemLevelManager.GetAllFirstLVFolder(this.inOutType, levelClass.ID);

            if (alFolder == null)
            {
                return;
            }

            #endregion

            try
            {
                TreeNode node;

                Neusoft.HISFC.Models.Fee.Item.ItemLevel info;
                for (int i = 0; i < alFolder.Count; i++)
                {
                    info = alFolder[i] as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
                    if (info == null)
                    {
                        continue;
                    }
                    node                    = new TreeNode(info.Name);
                    node.ImageIndex         = 2;
                    node.SelectedImageIndex = 3;
                    node.Tag                = info;

                    this.Nodes[0].Nodes.Add(node);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            this.Nodes[0].ExpandAll();
            this.Nodes[0].Expand();
        }
Пример #7
0
        protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            if (!isEdit)
            {
                return;
            }

            if (e.Label == null)
            {
                this.LabelEdit = false;
                return;
            }

            #region 更改组套名称权限控制 --2007-11-21 zhangqi

            Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel = this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;

            DialogResult r = MessageBox.Show("节点名称已经修改,是否保存?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (r == DialogResult.Cancel)
            {
                this.LabelEdit = false;
                //{3E29ADED-FB2D-4243-B525-BBDD79D85C2B}
                this.SelectedNode.Text = this.labelName;
                this.RefreshGroupByClass();
                return;
            }

            if ((this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel).UserCode == "F")
            {
                Neusoft.HISFC.Models.Fee.Item.ItemLevel tem = this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
                tem.Name       = e.Label;
                tem.LevelClass = this.levelClass;
                if (this.itemLevelManager.updateFolder(tem) <= 0)
                {
                    MessageBox.Show("文件夹名称更新失败·", "提示");
                }
                else
                {
                    MessageBox.Show("文件夹名称更新成功!", "提示");
                }
            }
            //else
            //{
            //    string GroupId = (this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel).ID;
            //    if (groupManager.UpdateGroupName(GroupId, e.Label) > 0)
            //        MessageBox.Show("组套名称更新成功", "提示");
            //    else
            //    {
            //        MessageBox.Show("更新失败", "提示");
            //    }
            //}
            #endregion

            this.LabelEdit = false;
        }
Пример #8
0
 private void neuSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
 {
     if (e.Column == (int)Col.ColUpdate)
     {
         int sort = Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Cells[e.Row, (int)Col.ColSortID].Text);
         if (sort >= 0)
         {
             Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
             if (this.itemLevelManager.UpdateItemSortID(sort.ToString(), this.neuSpread1_Sheet1.Cells[e.Row, (int)Col.ColCode].Text, (this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel).ID) < 0)
             {
                 Neusoft.FrameWork.Management.PublicTrans.RollBack();
                 MessageBox.Show("更新排序号失败!" + this.itemLevelManager.Err);
                 return;
             }
             Neusoft.FrameWork.Management.PublicTrans.Commit();
             MessageBox.Show("更新排序号成功");
         }
     }
     if (e.Column == (int)Col.ColDel)
     {
         Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
         if (this.itemLevelManager.deleteItem(this.neuSpread1_Sheet1.Cells[e.Row, (int)Col.ColCode].Text, (this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel).ID) < 0)
         {
             Neusoft.FrameWork.Management.PublicTrans.RollBack();
             MessageBox.Show("删除失败!" + this.itemLevelManager.Err);
             return;
         }
         Neusoft.FrameWork.Management.PublicTrans.Commit();
         MessageBox.Show("删除成功!");
         this.neuSpread1_Sheet1.RowCount = 0;
         ArrayList alItemLevel = new ArrayList();
         Neusoft.HISFC.Models.Fee.Item.ItemLevel myItemLevel = this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
         if (myItemLevel.ID == "ROOT")
         {
             alItemLevel = this.itemLevelManager.GetAllItemByFolderAndItemClass(myItemLevel.ID, myItemLevel.LevelClass.ID);
         }
         else
         {
             alItemLevel = this.itemLevelManager.GetAllItemByFolderID(myItemLevel.ID);
         }
         if (alItemLevel != null)
         {
             foreach (Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel in alItemLevel)
             {
                 this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1);
                 int lastRowIndex = this.neuSpread1_Sheet1.RowCount - 1;
                 this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColCode].Text   = itemLevel.ID;
                 this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColName].Text   = itemLevel.Name;
                 this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColSortID].Text = itemLevel.SortID.ToString();
             }
         }
     }
 }
Пример #9
0
 public void Init(ArrayList list)
 {
     this.neuSpread1_Sheet1.Columns[0].Visible = false;
     this.drugName.Text = DrugItem;
     for (int i = 0; i < list.Count; i++)
     {
         this.neuSpread1_Sheet1.RowCount++;
         Neusoft.HISFC.Models.Fee.Item.ItemLevel itemObj = list[i] as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
         this.neuSpread1_Sheet1.Cells[i, 0].Text = itemObj.ID;
         this.neuSpread1_Sheet1.Cells[i, 1].Text = itemObj.Name;
     }
 }
Пример #10
0
        /// <summary>
        /// 插入一个项目
        /// </summary>
        /// <param name="itemLevel"></param>
        /// <returns></returns>
        public int insertItem(Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel)
        {
            string strSql = "";

            if (this.Sql.GetSql("Manager.ItemLevel.InsertItem", ref strSql) == -1)
            {
                return(-1);
            }
            strSql = System.String.Format(strSql, itemLevel.ID, itemLevel.Name, itemLevel.SpellCode, itemLevel.WBCode,
                                          itemLevel.InOutType,
                                          itemLevel.Dept.ID, itemLevel.Owner.ID, Neusoft.FrameWork.Function.NConvert.ToInt32(itemLevel.IsShared),
                                          itemLevel.Memo, this.Operator.ID,
                                          itemLevel.ParentID, //上级目录ID  {C2922531-DEE7-43a0-AB7A-CDD7C58691BD}
                                          itemLevel.LevelClass.ID,
                                          itemLevel.SortID
                                          );
            return(this.ExecNoQuery(strSql));
        }
Пример #11
0
        void AddItem_Click(object sender, EventArgs e)
        {
            TreeNode node = new TreeNode();

            node.ImageIndex         = 2;
            node.SelectedImageIndex = 3;
            Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel = new Neusoft.HISFC.Models.Fee.Item.ItemLevel();
            itemLevel.ID        = this.itemLevelManager.GetNewFolderID();
            itemLevel.Name      = "新建文件夹";
            itemLevel.InOutType = this.inOutType;
            if (this.SelectedNode == this.Nodes[0])
            {
                itemLevel.Dept.ID    = (this.itemLevelManager.Operator as Neusoft.HISFC.Models.Base.Employee).Dept.ID;
                itemLevel.Owner      = this.itemLevelManager.Operator;
                itemLevel.ParentID   = "ROOT";              //{C2922531-DEE7-43a0-AB7A-CDD7C58691BD} 多级组套 yangw 20100916
                itemLevel.LevelClass = this.levelClass;
            }
            else
            {//{C2922531-DEE7-43a0-AB7A-CDD7C58691BD} 多级组套 yangw 20100916
                Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevelSelected = this.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;

                itemLevel.Dept = itemLevelSelected.Dept;

                itemLevel.Owner      = this.itemLevelManager.Operator;
                itemLevel.ParentID   = itemLevelSelected.ID;
                itemLevel.LevelClass = this.levelClass;
            }
            itemLevel.UserCode = "F";
            if (this.itemLevelManager.SetNewFolder(itemLevel) < 0)
            {
                MessageBox.Show("增加文件夹失败!");
                return;
            }
            node.Text = itemLevel.Name;
            node.Tag  = itemLevel;
            this.SelectedNode.Nodes.Add(node);
        }
Пример #12
0
        private void ucInputItem1_SelectedItem(Neusoft.FrameWork.Models.NeuObject sender)
        {
            if (this.tvItemLevel1.SelectedNode == null)
            {
                return;
            }
            if (sender is Neusoft.HISFC.Models.Pharmacy.Item)
            {
                //Neusoft.HISFC.Models.Fee.Item.Undrug undrugTmp = sender as Neusoft.HISFC.Models.Fee.Item.Undrug;
                Neusoft.HISFC.Models.Pharmacy.Item durgTmp = sender as Neusoft.HISFC.Models.Pharmacy.Item;
                if (durgTmp.Type.ID.ToString() == "C")
                {
                    MessageBox.Show("不能添加草药");
                    return;
                }
                Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevel = new Neusoft.HISFC.Models.Fee.Item.ItemLevel();
                itemLevel.ID        = durgTmp.ID;
                itemLevel.Name      = durgTmp.Name;
                itemLevel.InOutType = this.tvItemLevel1.InOutType;
                if (this.tvItemLevel1.SelectedNode == this.tvItemLevel1.Nodes[0])
                {
                    itemLevel.Dept.ID    = (this.itemLevelManager.Operator as Neusoft.HISFC.Models.Base.Employee).Dept.ID;
                    itemLevel.Owner      = this.itemLevelManager.Operator;
                    itemLevel.ParentID   = "ROOT";
                    itemLevel.LevelClass = this.tvItemLevel1.LevelClass;
                    itemLevel.SpellCode  = durgTmp.SpellCode;
                    itemLevel.WBCode     = durgTmp.WBCode;
                }
                else
                {
                    Neusoft.HISFC.Models.Fee.Item.ItemLevel itemLevelSelected = this.tvItemLevel1.SelectedNode.Tag as Neusoft.HISFC.Models.Fee.Item.ItemLevel;

                    itemLevel.Dept = itemLevelSelected.Dept;

                    itemLevel.Owner      = this.itemLevelManager.Operator;
                    itemLevel.ParentID   = itemLevelSelected.ID;
                    itemLevel.LevelClass = this.tvItemLevel1.LevelClass;
                    itemLevel.SpellCode  = durgTmp.SpellCode;
                    itemLevel.WBCode     = durgTmp.WBCode;
                }
                itemLevel.UserCode = "Y";
                Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
                if (this.itemLevelManager.insertItem(itemLevel) < 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    if (this.itemLevelManager.DBErrCode == 1)
                    {
                        MessageBox.Show(itemLevel.Name + "  已存在,不能重复维护");
                    }
                    else
                    {
                        MessageBox.Show("增加项目失败!" + this.itemLevelManager.Err);
                    }

                    return;
                }
                Neusoft.FrameWork.Management.PublicTrans.Commit();

                this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1);
                int lastRowIndex = this.neuSpread1_Sheet1.RowCount - 1;
                this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColCode].Text  = durgTmp.ID;
                this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColName].Text  = durgTmp.Name;
                this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColSpec].Text  = durgTmp.Specs;
                this.neuSpread1_Sheet1.Cells[lastRowIndex, (int)Col.ColPrice].Text = durgTmp.Price.ToString();

                MessageBox.Show("增加项目成功!");
            }
        }
Пример #13
0
        //{C2922531-DEE7-43a0-AB7A-CDD7C58691BD} 多级组套 yangw 20100916
        protected override void OnAfterSelect(TreeViewEventArgs e)
        {
            object o = this.SelectedNode.Tag;

            if (o != null)
            {
                if (o.GetType() == typeof(Neusoft.HISFC.Models.Fee.Item.ItemLevel))
                {
                    this.SelectedNode.Nodes.Clear();
                    Neusoft.HISFC.Models.Fee.Item.ItemLevel info = o as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
                    if (info.UserCode == "F")
                    {
                        #region 加载此文件夹下面的咚咚

                        ArrayList alFolder = new ArrayList();

                        if (info.ID == "ROOT")
                        {
                            alFolder = this.itemLevelManager.GetAllFolderByFolderAndLevelClass(info.ID, info.LevelClass.ID);
                        }
                        else
                        {
                            alFolder = this.itemLevelManager.GetAllFolderByFolderID(info.ID);
                        }
                        if (alFolder == null)
                        {
                            return;
                        }

                        try
                        {
                            TreeNode node;

                            Neusoft.HISFC.Models.Fee.Item.ItemLevel myGroup;
                            for (int i = 0; i < alFolder.Count; i++)
                            {
                                myGroup = alFolder[i] as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
                                if (info == null)
                                {
                                    continue;
                                }
                                node                    = new TreeNode(myGroup.Name);
                                node.ImageIndex         = 2;
                                node.SelectedImageIndex = 3;
                                node.Tag                = myGroup;


                                this.SelectedNode.Nodes.Add(node);
                            }
                            //ArrayList alGroup = this.groupManager.GetGroupByFolderID(info.ID);
                            //if (alGroup != null && alGroup.Count > 0)
                            //{
                            //    for (int j = 0; j < alGroup.Count; j++)
                            //    {
                            //        Neusoft.HISFC.Models.Fee.Item.ItemLevel group = alGroup[j] as Neusoft.HISFC.Models.Fee.Item.ItemLevel;
                            //        if (group == null)
                            //        {
                            //            continue;
                            //        }
                            //        TreeNode temNode = new TreeNode(group.Name);
                            //        temNode.ImageIndex = 10;
                            //        temNode.SelectedImageIndex = 11;
                            //        temNode.Tag = group;
                            //        this.SelectedNode.Nodes.Add(temNode);
                            //    }
                            //}
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            return;
                        }

                        this.SelectedNode.Expand();

                        #endregion
                    }
                }
            }
            base.OnAfterSelect(e);
        }