Esempio n. 1
0
        /// <summary>
        /// 得到所有提案信息
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        public JsonResult GetTextSelectUrlProposalInfo(string term)
        {
            string SystemID = Request["SystemID"] == null ?"-1": Request["SystemID"].ToString();

            System.Data.DataTable dtContent = new System.Data.DataTable();
            // DataTable dtUser = GPMS.Interface.DataLibrary.GetUserDataByFuzzy(term.Trim(), 10);
            SqlDataBase dd     = new SqlDataBase();
            string      str    = "select top(10) a.ProposalID,a.ProposalName from[IPP].[dbo].[ipp_Proposal] a where a.BillType <> 10 and a.SystemInfo =" + SystemID + " and ( a.ProposalName like '%" + term + "%' or a.ProposalID like '%" + term + "%') ";
            DataTable   dtUser = dd.GetTable(str);

            dtContent.Columns.Add("value"); //这几个就是传到视图的值
            dtContent.Columns.Add("label"); //这里估计就是得到输入值后控件下方显示的文本格式,也是点击后显示在控件的值
            dtContent.Columns.Add("desc");  //排序
            dtContent.Columns.Add("icon");
            foreach (DataRow drUser in dtUser.Rows)
            {
                //if (i.ToString().IndexOf(term) == -1)
                //{//模拟查询
                //    continue;
                //}
                DataRow dr = dtContent.NewRow();
                dr[0] = drUser["ProposalID"].ToString();
                dr[1] = drUser["ProposalName"].ToString();
                dr[2] = drUser["ProposalID"].ToString();
                dr[3] = drUser["ProposalID"].ToString();
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();//向上转型以使用父类的方法
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }
Esempio n. 2
0
        /// <summary>
        /// 查询开发工程师
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        public JsonResult GetTextSelectUrlDevUser(string term)
        {
            System.Data.DataTable dtContent = new System.Data.DataTable();
            // DataTable dtUser = GPMS.Interface.DataLibrary.GetUserDataByFuzzy(term.Trim(), 10);
            SqlDataBase dd     = new SqlDataBase();
            string      str    = "select top(10) a.UserCode,a.UserName from [IPP].[dbo].[V_Developer] a where (a.UserCode like '%" + term + "%' or a.UserName like '%" + term + "%')";
            DataTable   dtUser = dd.GetTable(str);

            dtContent.Columns.Add("value"); //这几个就是传到视图的值
            dtContent.Columns.Add("label"); //这里估计就是得到输入值后控件下方显示的文本格式,也是点击后显示在控件的值
            dtContent.Columns.Add("desc");  //排序
            dtContent.Columns.Add("icon");
            foreach (DataRow drUser in dtUser.Rows)
            {
                //if (i.ToString().IndexOf(term) == -1)
                //{//模拟查询
                //    continue;
                //}
                DataRow dr = dtContent.NewRow();
                dr[0] = drUser["UserCode"].ToString();
                dr[1] = drUser["UserName"].ToString();
                dr[2] = drUser["UserCode"].ToString();
                dr[3] = drUser["UserCode"].ToString();
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();//向上转型以使用父类的方法
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }
Esempio n. 3
0
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="term">关键词</param>
        /// <returns></returns>
        public JsonResult GetTextSelectUrlUser(string term)
        {
            System.Data.DataTable dtContent = new System.Data.DataTable();
            DataTable             dtUser    = GPMS.Interface.DataLibrary.GetUserDataByFuzzy(term, 10, false);

            dtContent.Columns.Add("value");
            dtContent.Columns.Add("label");
            dtContent.Columns.Add("desc");
            dtContent.Columns.Add("icon");
            foreach (DataRow drUser in dtUser.Rows)
            {
                //if (i.ToString().IndexOf(term) == -1)
                //{//模拟查询
                //    continue;
                //}
                DataRow dr = dtContent.NewRow();
                dr[0] = drUser["UserCode"].ToString();
                dr[1] = drUser["UserName"].ToString();
                dr[2] = drUser["OrganizeCode"].ToString();
                dr[3] = drUser["OrganizeName"].ToString();
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }
Esempio n. 4
0
        /// <summary>
        /// 模拟从数据库检索数据
        /// </summary>
        /// <param name="term">关键词</param>
        /// <returns></returns>
        public JsonResult GetTextSelectUrlDemo(string term)
        {
            System.Data.DataTable dtContent = new System.Data.DataTable();
            dtContent.Columns.Add("value");
            dtContent.Columns.Add("label");
            dtContent.Columns.Add("desc");
            dtContent.Columns.Add("icon");
            for (int i = 0; i < 100; i++)
            {
                if (i.ToString().IndexOf(term) == -1)
                {//模拟查询
                    continue;
                }
                DataRow dr = dtContent.NewRow();
                dr[0] = i.ToString();
                dr[1] = "服务器值" + i.ToString();
                dr[2] = "服务器值描述" + i.ToString();
                dr[3] = i.ToString();
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }
Esempio n. 5
0
        /// <summary>
        /// 获取产品名称
        /// </summary>
        /// <param name="term">关键词</param>
        /// <returns></returns>
        //public ActionResult GetTextSelectUrlProduct(string term)
        //{
        //    System.Data.DataTable dtContent = new System.Data.DataTable();
        //    ProductEntity obj = new ProductEntity();
        //    obj.ResetForSearch();
        //    obj.PageSize = 10;
        //    obj.ProductName = term;
        //    obj.IsUseLike = true;
        //    DataTable dt = obj.GetTable();

        //    dtContent.Columns.Add("value");
        //    dtContent.Columns.Add("label");
        //    dtContent.Columns.Add("desc");
        //    dtContent.Columns.Add("icon");
        //    foreach (DataRow drUser in dt.Rows)
        //    {
        //        //if (i.ToString().IndexOf(term) == -1)
        //        //{//模拟查询
        //        //    continue;
        //        //}
        //        DataRow dr = dtContent.NewRow();
        //        dr[0] = drUser["ProductNoSimple"].ToString();
        //        dr[1] = drUser["ProductName"].ToString();
        //        dr[2] = "";
        //        dr[3] = "";
        //        dtContent.Rows.Add(dr);
        //    }
        //    //select a as value,b as label,c as desc ,d as icon from table where title='term'
        //    Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
        //    entityBase.Dt = dtContent;
        //    JsonResult jsonResult = entityBase.ToJsonOnlyData();
        //    return jsonResult;
        //}
        /// <summary>
        /// 查询组织
        /// </summary>
        /// <param name="term">关键词</param>
        /// <returns></returns>
        public JsonResult GetTextSelectUrlOrganize(string term)
        {
            System.Data.DataTable dtContent = new System.Data.DataTable();
            Organize organize = new Organize();

            organize.ResetForSearch();
            organize.Parameters[0] = new SqlParameter("@term", term);
            organize.SqlCustomer   = " AND (organizeid LIKE '%'+@term+'%' OR organizename LIKE '%'+@term+'%')";
            organize.PageSize      = 10;
            DataTable dt = organize.GetTable();

            dtContent.Columns.Add("value");
            dtContent.Columns.Add("label");
            dtContent.Columns.Add("desc");
            dtContent.Columns.Add("icon");
            foreach (DataRow drUser in dt.Rows)
            {
                //if (i.ToString().IndexOf(term) == -1)
                //{//模拟查询
                //    continue;
                //}
                DataRow dr = dtContent.NewRow();
                dr[0] = drUser["organizeid"].ToString();
                string longname = drUser["longname"].ToString();
                if (longname != "广东东菱凯琴集团总部" && longname != "广东新宝电器股份有限公司")
                {
                    longname = longname.Replace("广东东菱凯琴集团总部", "").Replace("广东新宝电器股份有限公司", "");
                }
                dr[1] = longname;
                dr[2] = drUser["organizename"].ToString();
                dr[3] = "";
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }
Esempio n. 6
0
        /// <summary>
        /// 查询客户
        /// </summary>
        /// <param name="term">关键词</param>
        /// <returns></returns>
        //public JsonResult GetTextSelectUrlCust(string term)
        //{

        //    System.Data.DataTable dtContent = new System.Data.DataTable();

        //    CustomerEntity Customer = new CustomerEntity();
        //    Customer.ResetForSearch();
        //    Customer.PageSize = 10;
        //    Customer.SqlCustomer = " AND (CustomerName like '%'+@term+'%' OR CustomerNo like '%'+@term+'%') ";
        //    Customer.Parameters[0] = new SqlParameter("@term", term);
        //    Customer.IsUseLike = true;
        //    DataTable dtCust = Customer.GetTable(true);

        //    dtContent.Columns.Add("value");
        //    dtContent.Columns.Add("label");
        //    dtContent.Columns.Add("desc");
        //    dtContent.Columns.Add("icon");
        //    foreach (DataRow drCust in dtCust.Rows)
        //    {
        //        //if (i.ToString().IndexOf(term) == -1)
        //        //{//模拟查询
        //        //    continue;
        //        //}
        //        DataRow dr = dtContent.NewRow();
        //        dr[0] = drCust["CustomerNo"].ToString();
        //        dr[1] = drCust["CustomerNo"].ToString();
        //        dr[2] = drCust["CustomerDesc"].ToString();
        //        dr[3] = "";
        //        dtContent.Rows.Add(dr);
        //    }
        //    //select a as value,b as label,c as desc ,d as icon from table where title='term'
        //    Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
        //    entityBase.Dt = dtContent;
        //    JsonResult jsonResult = entityBase.ToJsonOnlyData();
        //    return jsonResult;
        //}

        #region 连续添加Personnel
        /// <summary>
        /// 连续添加Personnel
        /// </summary>
        /// <param name="term">查询条件</param>
        /// <returns>JSON</returns>
        public JsonResult GetTextSelectUrlUserInput(string term)
        {
            System.Data.DataTable dtContent = new System.Data.DataTable();
            string strTerm = "";

            if (term.Contains(";"))
            {
                strTerm = term.Substring(term.LastIndexOf(';') + 1, term.Trim().Length - (term.LastIndexOf(';') + 1)); //获取最后输入参数
            }

            DataTable dtUser = GPMS.Interface.DataLibrary.GetUserDataByFuzzy(strTerm, 10);

            dtContent.Columns.Add("value");
            dtContent.Columns.Add("label");
            dtContent.Columns.Add("desc");
            dtContent.Columns.Add("icon");
            foreach (DataRow drUser in dtUser.Rows)
            {
                //if (i.ToString().IndexOf(term) == -1)
                //{//模拟查询
                //    continue;
                //}
                DataRow dr = dtContent.NewRow();
                dr[0] = drUser["UserCode"].ToString();
                dr[1] = drUser["UserName"].ToString();
                dr[2] = drUser["Description"].ToString();
                dr[3] = "";
                dtContent.Rows.Add(dr);
            }
            //select a as value,b as label,c as desc ,d as icon from table where title='term'
            Donlim.Library.Entitys.EntityBase entityBase = new Donlim.Library.Entitys.EntityBase();
            entityBase.Dt = dtContent;
            JsonResult jsonResult = entityBase.ToJsonOnlyData();

            return(jsonResult);
        }