Beispiel #1
0
 public PersonItemManager(IEmrHost app)
 {
     InitializeComponent();
     m_app         = app;
     m_ItemCatalog = new ItemCatalog(app);
     m_ItemContent = new ItemContentForm(app);
     sqlHelper     = m_app.SqlHelper;
 }
Beispiel #2
0
 /// <summary>
 /// 新增大分类
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barButtonItemNewRoot_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     //新增大分类的时候清空上次的值  ywk
     m_ItemCatalog = new ItemCatalog(m_app);
     m_ItemCatalog.BigOrSmallItem = "big";
     m_ItemCatalog.CreateUser     = m_app.User.Id;
     m_ItemCatalog.CanChangeFlag  = true;
     m_ItemCatalog.SetContainerCodeEditFlag(true);
     m_ItemCatalog.SetIsPersonEditFlag(true);
     if (m_ItemCatalog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         try
         {
             string id = Guid.NewGuid().ToString();
             //string createuser = "";
             //if (m_ItemCatalog.IsPerson == "1")无论新增的是科室小模板还是个人小模板,都往数据库插入创建人
             string createuser = m_app.User.Id;
             sqlHelper.ExecuteNoneQuery(string.Format(sql_insertCatalog, id, DS_Common.FilterSpecialCharacter(m_ItemCatalog.ITEMNAME), string.Empty, 1, DS_Common.FilterSpecialCharacter(m_ItemCatalog.Memo),
                                                      m_app.User.CurrentDeptId, m_ItemCatalog.ContainerCode, m_ItemCatalog.IsPerson, DS_Common.FilterSpecialCharacter(createuser)));
             TreeListNode leafnode = treeList1.AppendNode(new object[] { id, m_ItemCatalog.ITEMNAME, "Folder", m_ItemCatalog.IsPerson, m_ItemCatalog.CreateUser, m_ItemCatalog.Memo, m_ItemCatalog.ContainerCode }, null);
             DataTable    dt       = sqlHelper.ExecuteDataTable("select * from emrtemplet_item_person_catalog where ID='" + id + "'");
             if (null != dt && dt.Rows.Count > 0)
             {
                 leafnode.Tag = dt.Rows[0];
             }
             //if (treeList1.FocusedNode != null)
             //    treeList1.FocusedNode.ExpandAll();
             m_app.CustomMessageBox.MessageShow("新增成功");
             treeList1.FocusedNode = leafnode;
         }
         catch (Exception EX)
         {
             m_app.CustomMessageBox.MessageShow(EX.Message);
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// 新增子分类
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItemNew2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //新增子分类的时候清空上次的值  ywk
            m_ItemCatalog = new ItemCatalog(m_app);
            if (treeList1.FocusedNode == null)
            {
                m_app.CustomMessageBox.MessageShow("请选择父节点");
                return;
            }
            if (!treeList1.FocusedNode.GetValue("NODETYPE").ToString().Equals("Folder"))
            {
                m_app.CustomMessageBox.MessageShow("请选择分类节点");
                return;
            }
            string parentID = treeList1.FocusedNode.GetValue("ID").ToString();
            string isPerson = treeList1.FocusedNode.GetValue("ISPERSON").ToString();
            //分类权限控制
            string msg = GetMsgIfNotCreateUser(parentID, null == treeList1.FocusedNode.GetValue("createusers") ? "" : treeList1.FocusedNode.GetValue("createusers").ToString(), 0, 2, int.Parse(isPerson));

            if (!string.IsNullOrEmpty(msg))
            {
                m_app.CustomMessageBox.MessageShow(msg);
                return;
            }
            m_ItemCatalog.IsPerson       = isPerson;
            m_ItemCatalog.CreateUser     = m_app.User.Id; //treeList1.FocusedNode.GetValue("CREATEUSER").ToString();
            m_ItemCatalog.BigOrSmallItem = "small";
            string containerCode = null == treeList1.FocusedNode.GetValue("CONTAINER") ? "" : treeList1.FocusedNode.GetValue("CONTAINER").ToString();

            if (string.IsNullOrEmpty(containerCode))
            {
                DataRow drow = (DataRow)treeList1.FocusedNode.Tag;
                containerCode = null == drow ? "" : (null == drow["CONTAINER"] ? "" : drow["CONTAINER"].ToString());
                if (string.IsNullOrEmpty(containerCode))
                {
                    DataTable dt = m_app.SqlHelper.ExecuteDataTable(" select * from emrtemplet_item_person_catalog where id='" + parentID + "'");
                    if (null != dt && dt.Rows.Count > 0)
                    {
                        containerCode = null == dt.Rows[0]["CONTAINER"] ? "" : dt.Rows[0]["CONTAINER"].ToString();
                    }
                }
            }
            m_ItemCatalog.ContainerCode = containerCode;
            m_ItemCatalog.SetContainerCodeEditFlag(false);
            m_ItemCatalog.SetIsPersonEditFlag(false);

            if (m_ItemCatalog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    string id = Guid.NewGuid().ToString();
                    //string createuser = "";
                    //if (m_ItemCatalog.IsPerson == "1")
                    //    createuser = m_app.User.Id;
                    //无论科室小模板还是个人小模板都插入创建人
                    string createuser = m_app.User.Id;
                    sqlHelper.ExecuteNoneQuery(string.Format(sql_insertCatalog, id, DS_Common.FilterSpecialCharacter(m_ItemCatalog.ITEMNAME), parentID, 1, DS_Common.FilterSpecialCharacter(m_ItemCatalog.Memo),
                                                             m_app.User.CurrentDeptId, m_ItemCatalog.ContainerCode, m_ItemCatalog.IsPerson, DS_Common.FilterSpecialCharacter(createuser)));
                    TreeListNode leafnode = treeList1.AppendNode(new object[] { id, m_ItemCatalog.ITEMNAME, "Folder", m_ItemCatalog.IsPerson, m_ItemCatalog.CreateUser, m_ItemCatalog.Memo, m_ItemCatalog.ContainerCode }, treeList1.FocusedNode);
                    DataTable    dt       = sqlHelper.ExecuteDataTable("select * from emrtemplet_item_person_catalog where ID='" + id + "'");
                    if (null != dt && dt.Rows.Count > 0)
                    {
                        leafnode.Tag = dt.Rows[0];
                    }
                    m_app.CustomMessageBox.MessageShow("新增成功");
                    //if (treeList1.FocusedNode != null)
                    //    treeList1.FocusedNode.ExpandAll();
                    treeList1.FocusedNode = leafnode;
                }
                catch (Exception EX)
                {
                    m_app.CustomMessageBox.MessageShow(EX.Message);
                }
            }
        }