示例#1
0
        private void Init()
        {
            //加载所有机构信息
            scanDataSet = new Business.OrgInfo().GetOrgByStr("");

            //创建根节点
            if (scanDataSet.BaseOrgInfo.Rows.Count > 0)
            {
                //获取河南省为根节点
                DataRow[] drArrayRoot = scanDataSet.BaseOrgInfo.Select("orgid=1");
                DataRow   rootRow;
                if (drArrayRoot.Length > 0)
                {
                    rootRow = drArrayRoot[0];
                }
                else
                {
                    MessageBox.Show("获取根节点错误");
                    return;
                }

                this.OrgTreeView.Nodes.Clear();
                TreeNode root = new TreeNode();
                root.Text = rootRow["orgname"].ToString();
                root.Collapse(true);
                root.Tag = rootRow;
                this.OrgTreeView.Nodes.Add(root);
                root.Expand();
            }
        }
示例#2
0
        public ScanDataSet GetOrgByStr(string str)
        {
            ScanDataSet scanDataSet = new ScanDataSet();

            SqlConnection sqlConnection = SqlHelper.GetConnection();

            sqlConnection.Open();
            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("select * from base_org_info where status=1 " + str, sqlConnection))
                {
                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter())
                    {
                        sqlDataAdapter.SelectCommand = sqlCommand;
                        sqlDataAdapter.Fill(scanDataSet, scanDataSet.BaseOrgInfo.TableName);
                    }
                }
            }

            finally
            {
                SqlHelper.CloseConnection(sqlConnection);
            }


            return(scanDataSet);
        }
示例#3
0
        public ScanDataSet GetConfigInfoByStr(string str)
        {
            ScanDataSet scanDataSet = new ScanDataSet();


            SqlConnection sqlConnection = SqlHelper.GetConnection();

            sqlConnection.Open();


            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("select t1.*,t2.orgname ,(CASE WHEN t1.status=1 THEN '启用' ELSE '注销' END ) statusname from hzyl_wz_config t1,base_org_info t2 where t1.forgid=t2.orgid /*and t1.status=1 and t2.status=1*/ " + str, sqlConnection))
                {
                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter())
                    {
                        sqlDataAdapter.SelectCommand = sqlCommand;
                        sqlDataAdapter.Fill(scanDataSet, scanDataSet.ConfigInfo.TableName);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                SqlHelper.CloseConnection(sqlConnection);
            }

            return(scanDataSet);
        }
示例#4
0
文件: UserInfo.cs 项目: zeroland/scan
        public ScanDataSet GetUserByID(string id)
        {
            ScanDataSet scanDataSet = new ScanDataSet();


            SqlConnection sqlConnection = SqlHelper.GetConnection();

            sqlConnection.Open();
            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("select t1.*,t2.orgname ,(CASE WHEN t1.status=1 THEN '启用' ELSE '注销' END ) statusname from hzyl_wz_user t1,base_org_info t2 where t1.forgid=t2.orgid /*and t1.status=1 and t2.status=1*/ and t1.id=@id", sqlConnection))
                {
                    sqlCommand.Parameters.Add("@id", SqlDbType.VarChar, 20).Value = id;

                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter())
                    {
                        sqlDataAdapter.SelectCommand = sqlCommand;
                        sqlDataAdapter.Fill(scanDataSet, scanDataSet.UserInfo.TableName);
                    }
                }
            }
            finally
            {
                SqlHelper.CloseConnection(sqlConnection);
            }
            return(scanDataSet);
        }
示例#5
0
文件: UserInfo.cs 项目: zeroland/scan
        public ScanDataSet GetUserByUserInfo(string userCode, string password)
        {
            ScanDataSet scanDataSet = new ScanDataSet();


            SqlConnection sqlConnection = SqlHelper.GetConnection();

            sqlConnection.Open();
            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("select t1.*,t2.orgname from hzyl_wz_user t1,base_org_info t2 where t1.forgid=t2.orgid and  usercode=@usercode and password=@password", sqlConnection))
                {
                    sqlCommand.Parameters.Add("@usercode", SqlDbType.VarChar, 20).Value = userCode;
                    sqlCommand.Parameters.Add("@password", SqlDbType.VarChar, 20).Value = password;
                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter())
                    {
                        sqlDataAdapter.SelectCommand = sqlCommand;
                        sqlDataAdapter.Fill(scanDataSet, scanDataSet.UserInfo.TableName);
                    }
                }
            }
            finally
            {
                SqlHelper.CloseConnection(sqlConnection);
            }
            return(scanDataSet);
        }
示例#6
0
        public void GetItemDict(ScanDataSet ds)
        {
            string commandText = xmlHelper.GetTextByAttribute(Util.Util.GetXMLPath(fileName), "select", "ID", "GetItemDict");

            using (SqlConnection sqlConnection = new SqlConnection(Util.SqlHelper.GetConnSting()))
            {
                using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(commandText, sqlConnection))
                {
                    sqlDataAdapter.Fill(ds, ds.ItemDict.TableName);
                }
            }
        }
示例#7
0
        public void GetItemDict(ScanDataSet ds)
        {
            IDcitProcess iDictProcess = new SqlServer.DictProcess();

            iDictProcess.GetItemDict(ds);
        }
示例#8
0
        public void GetCenterData(ScanDataSet ds)
        {
            IDcitProcess iDictProcess = new SqlServer.DictProcess();

            iDictProcess.GetCenterData(ds);
        }