Exemplo n.º 1
0
        private void m_mthGetData(string p_strRoleID)
        {
            string    SQL       = "select * from T_ROLE where ROLE_ID=" + p_strRoleID + "";
            DataTable dtRecords = null;

            com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ objServ =
                (com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ));

            objServ.m_lngGetMaxID(SQL, ref dtRecords);

            if (dtRecords != null)
            {
                m_txtName.Text = dtRecords.Rows[0]["ROLE_NAME"].ToString();
                m_txtDesc.Text = dtRecords.Rows[0]["ROLE_DESC"].ToString();
            }
            dtRecords.Clear();
            dtRecords = null;

            SQL = "select * from T_ROLEDETAIL where ROLE_ID=" + p_strRoleID + "";
            objServ.m_lngGetMaxID(SQL, ref m_dtFunction);
        }
Exemplo n.º 2
0
        private void m_cmdOK_Click(object sender, System.EventArgs e)
        {
            string    SQL       = "";
            string    strMaxID  = "";
            DataTable dtRecords = null;

            com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ objServ =
                (com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ));

            if (m_strMode == "Edit")
            {
                SQL = "update T_ROLE set ROLE_NAME='" + m_txtName.Text.Replace("'", "''") + "',ROLE_DESC='" + m_txtDesc.Text.Replace("'", "''") + "' where ROLE_ID=" + m_RoleID + "";
                objServ.m_lngSaveIllnessSymptom(SQL);

                SQL = "delete from T_ROLEDETAIL where ROLE_ID=" + m_RoleID + "";
                objServ.m_lngSaveIllnessSymptom(SQL);

                for (int i = 0; i < m_trvFunctionByFrom.Nodes.Count; i++)
                {
                    if (m_trvFunctionByFrom.Nodes[i].Checked)
                    {
                        SQL = "insert into T_ROLEDETAIL(ROLE_ID,PURVIEW_ID,ROLE_TYPE,ROLE_VALUES) values (" + m_RoleID + "," + ((DataRow)m_trvFunctionByFrom.Nodes[i].Tag)["PURVIEW_ID"].ToString() + ",0,'')";
                        objServ.m_lngSaveIllnessSymptom(SQL);
                    }
                    m_mthSeachNode(m_trvFunctionByFrom.Nodes[i], m_RoleID);
                }
            }
            else if (m_strMode == "Add")
            {
                if (com.digitalwave.Emr.StaticObject.clsEMR_StaticObject.s_StrCurrentHospitalNO == "440104001")
                {
                    SQL = "select isnull(max(ROLE_ID),0)+1 from T_ROLE";
                }
                else
                {
                    SQL = "select nvl(max(ROLE_ID),0)+1 from T_ROLE";
                }


                objServ.m_lngGetMaxID(SQL, ref dtRecords);
                if (dtRecords != null)
                {
                    strMaxID = dtRecords.Rows[0][0].ToString();
                }
                dtRecords.Clear();
                dtRecords = null;

                SQL = "insert into T_ROLE (ROLE_ID,ROLE_NAME,ROLE_DESC) values (" + strMaxID + ",'" + m_txtName.Text.Replace("'", "''") + "','" + m_txtDesc.Text.Replace("'", "''") + "')";
                objServ.m_lngSaveIllnessSymptom(SQL);

                for (int i = 0; i < m_trvFunctionByFrom.Nodes.Count; i++)
                {
                    if (m_trvFunctionByFrom.Nodes[i].Checked)
                    {
                        SQL = "insert into T_ROLEDETAIL(ROLE_ID,PURVIEW_ID,ROLE_TYPE,ROLE_VALUES) values (" + strMaxID + "," + ((DataRow)m_trvFunctionByFrom.Nodes[i].Tag)["PURVIEW_ID"].ToString() + ",0,'')";
                        objServ.m_lngSaveIllnessSymptom(SQL);
                    }
                    m_mthSeachNode(m_trvFunctionByFrom.Nodes[i], strMaxID);
                }
            }
            this.Close();
        }
Exemplo n.º 3
0
        private void m_mthGetAllFunctionByFrom()
        {
            string SQL = "";
//			TreeNode pNode=null;

            ArrayList NoteArry = new ArrayList();

            com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ objServ =
                (com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.common.ICD10.Midtier.clsIllnessSymptomServ));

            if (com.digitalwave.Emr.StaticObject.clsEMR_StaticObject.s_StrCurrentHospitalNO == "440104001")
            {
                #region sqlserver 2000
                SQL = "select * from t_purviewdefine ";

                objServ.m_lngGetMaxID(SQL, ref dtRecords0);
                if (dtRecords0 != null)
                {
                    //调用递归函数完成树形结构
                    AddTree(-1, (TreeNode)null);
                }
                #endregion
            }
            else
            {
                #region oracle
                SQL = "select * from t_purviewdefine start with PURVIEW_pID is null and (purview_type=0 or purview_type=1) connect by prior PURVIEW_ID=PURVIEW_pID";
                objServ.m_lngGetMaxID(SQL, ref dtRecords0);

                if (dtRecords0 != null)
                {
                    for (int i = 0; i < dtRecords0.Rows.Count; i++)
                    {
                        if (dtRecords0.Rows[i]["PURVIEW_pID"].ToString().Trim().Length == 0)
                        {                         //根节点
                            TreeNode tNode = m_trvFunctionByFrom.Nodes.Add(dtRecords0.Rows[i]["PURVIEW_CNAME"].ToString());
                            tNode.Tag = dtRecords0.Rows[i];

                            if (dtRecords0.Rows[i]["PURVIEW_FUNCTION"].ToString().Trim().Length != 0)
                            {
                                tNode.ForeColor = Color.Blue;
                            }

                            if (m_strMode == "Edit")
                            {
                                if (m_dtFunction != null)
                                {
                                    for (int k = 0; k < m_dtFunction.Rows.Count; k++)
                                    {
                                        if (dtRecords0.Rows[i]["PURVIEW_ID"].ToString() == m_dtFunction.Rows[k]["PURVIEW_ID"].ToString())
                                        {
                                            tNode.Checked = true;
                                            break;
                                        }
                                    }
                                }
                            }
                            NoteArry.Add(tNode);
                        }
                        else
                        {
                            for (int j = 0; j < NoteArry.Count; j++)
                            {
                                if (((DataRow)((TreeNode)NoteArry[j]).Tag)["PURVIEW_ID"].ToString().Trim() == dtRecords0.Rows[i]["PURVIEW_pID"].ToString().Trim())
                                {
                                    TreeNode tpNode = ((TreeNode)NoteArry[j]).Nodes.Add(dtRecords0.Rows[i]["PURVIEW_CNAME"].ToString());
                                    tpNode.Tag = dtRecords0.Rows[i];

                                    if (dtRecords0.Rows[i]["PURVIEW_FUNCTION"].ToString().Trim().Length != 0)
                                    {
                                        tpNode.ForeColor = Color.Blue;
                                    }

                                    if (m_strMode == "Edit")
                                    {
                                        if (m_dtFunction != null)
                                        {
                                            for (int k = 0; k < m_dtFunction.Rows.Count; k++)
                                            {
                                                if (dtRecords0.Rows[i]["PURVIEW_ID"].ToString() == m_dtFunction.Rows[k]["PURVIEW_ID"].ToString())
                                                {
                                                    tpNode.Checked = true;
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    NoteArry.Add(tpNode);
                                    break;
                                }
                            }
                        }
                    }
                }
                #endregion oracle
            }


            #region old
//			if (dtRecords!=null)
//			{
//				for (int i=0;i<dtRecords.Rows.Count;i++)
//				{
//					if (dtRecords.Rows[i]["PURVIEW_pID"].ToString().Trim().Length==0)
//					{
//						TreeNode tNode=m_trvFunctionByFrom.Nodes.Add(dtRecords.Rows[i]["PURVIEW_CNAME"].ToString());
//						tNode.Tag=dtRecords.Rows[i];
//						if (m_strMode=="Edit")
//						{
//							if (m_dtFunction!=null)
//							{
//								for (int k=0;k<m_dtFunction.Rows.Count;k++)
//								{
//									if (dtRecords.Rows[i]["PURVIEW_ID"].ToString()==m_dtFunction.Rows[k]["PURVIEW_ID"].ToString())
//									{
//										tNode.Checked=true;
//										break;
//									}
//								}
//							}
//						}
//						pNode=tNode;
//					}
//					else
//					{
//						if (pNode!=null)
//						{
//							TreeNode tNode=pNode.Nodes.Add(dtRecords.Rows[i]["PURVIEW_CNAME"].ToString());
//							tNode.Tag=dtRecords.Rows[i];
//							if (m_strMode=="Edit")
//							{
//								if (m_dtFunction!=null)
//								{
//									for (int k=0;k<m_dtFunction.Rows.Count;k++)
//									{
//										if (dtRecords.Rows[i]["PURVIEW_ID"].ToString()==m_dtFunction.Rows[k]["PURVIEW_ID"].ToString())
//										{
//											tNode.Checked=true;
//											break;
//										}
//									}
//								}
//							}
//						}
//					}
//
//				}
//			}
            #endregion old
        }