Esempio n. 1
0
    public string[] GetUserOtherList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型
        SqlDataReader myDR  = new MyDataOp("select top " + count + " Name from t_R_UserInfo where (Name like  '%" + prefixText + "%' or UserID like '%" + prefixText + "%'  ) group by Name order by Name ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["Name"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 2
0
    public string[] GetSampleSourceList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型
        SqlDataReader myDR  = new MyDataOp("select top " + count + " 单位全称 from View_SampleSource where   (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) order by num  desc").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["单位全称"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 3
0
    public string[] GetMainClassList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型

        SqlDataReader myDR = new MyDataOp("select top " + count + " ClassName from t_M_AnalysisMainClassEx where ClassCode like  '" + prefixText + "%'group by ClassName order by ClassName ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["ClassName"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 4
0
    public string[] GetCompletionList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型

        SqlDataReader myDR = new MyDataOp("select top " + count + " ItemName from t_M_ItemInfo where ItemCode like  '" + prefixText + "%'group by ItemName order by ItemName ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["ItemName"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 5
0
    public string[] GetReportList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型
        //string conditionstr = "";
        SqlDataReader myDR = new MyDataOp("select top " + count + " ReportName from t_M_ReporInfo where ReportName like  '" + prefixText + "%' and (StatusID<=5) group by ReportName order by  ReportName ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["ReportName"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 6
0
    public string[] Getxz(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型
        // SqlDataReader myDR = new MyDataOp("select top " + count + " 单位全称 from t_企业信息 where (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) group by 单位全称  union (select top " + count + " 单位全称 from t_other where (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) group by 单位全称) order by 单位全称 ").CreateReader();
        SqlDataReader myDR = new MyDataOp("select top " + count + " xz from t_xz where (xz like  '%" + prefixText + "%' or code like '%" + prefixText + "%'  ) group by xz   order by xz ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["xz"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 7
0
    public string[] GetClassList(string prefixText, int count)
    {
        List <string> items        = new List <string>(count);//泛型
        string        conditionstr = "";

        SqlDataReader myDR = new MyDataOp("select top " + count + " AIName from t_M_ANItemInf where" + conditionstr + " (AIName like  '" + prefixText + "%' or AICode like  '" + prefixText + "%') group by AIName order by AIName ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["AIName"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 8
0
    public string[] GetUserList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型

        prefixText = prefixText.Replace('/', '/');
        SqlDataReader myDR = new MyDataOp("select top " + count + " Standard from t_M_AnStandard where (Standard like  '%" + prefixText + "%') group by Standard order by Standard ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["Standard"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 9
0
    public string[] GetClientList(string prefixText, int count)
    {
        List <string> items = new List <string>(count);//泛型
        // SqlDataReader myDR = new MyDataOp("select top " + count + " 单位全称 from t_企业信息 where (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) group by 单位全称  union (select top " + count + " 单位全称 from t_other where (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) group by 单位全称) order by 单位全称 ").CreateReader();
        // SqlDataReader myDR = new MyDataOp("select top " + count + " 单位全称 from t_委托单位 where (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) group by 单位全称  order by 单位全称 ").CreateReader();
        SqlDataReader myDR = new MyDataOp("select top " + count + " 单位全称 from View_wtdepart where   (单位全称 like  '%" + prefixText + "%' or 单位曾用名全称 like '%" + prefixText + "%' or 企业简称代码 like '%" + prefixText + "%'  ) order by num desc ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["单位全称"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 10
0
    public string[] GetClassList(string prefixText, int count, string contextKey)
    {
        List <string> items        = new List <string>(count);//泛型
        string        conditionstr = "";

        if (contextKey != "-1")
        {
            conditionstr = " ClassID='" + contextKey + "' and";
        }
        SqlDataReader myDR = new MyDataOp("select top " + count + " AIName from t_M_AnalysisItemEx where" + conditionstr + " AICode like  '" + prefixText + "%'group by AIName order by AIName ").CreateReader();

        while (myDR.Read())
        {
            items.Add(myDR["AIName"].ToString());
        }
        //myCon.Close();//关闭数据库连接
        return(items.ToArray());
    }
Esempio n. 11
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int add(OutCar entity)
        {
            int    id     = 0;
            string sqlstr = String.Format(@"insert into t_c_outinfo(carid,destn,remark,createdate,createuser,outstart,outend,driver) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", entity.CarNO, entity.Destn, entity.Remark, entity.CreateDate, entity.CreateUser, entity.OutStart, entity.OutEnd, entity.Driver);

            MyDataOp db = new MyDataOp(sqlstr);

            if (db.ExecuteCommand())
            {
                db = null;
                string        selectstr = String.Format(@"select * from t_c_outinfo  where carid='{0}' and outstart='{1}' and outend='{2}'", entity.CarNO, entity.OutStart, entity.OutEnd);
                SqlDataReader sdr       = new MyDataOp(selectstr).CreateReader();
                while (sdr.Read())
                {
                    id = int.Parse(sdr["id"].ToString());
                }
            }
            return(id);
        }