Esempio n. 1
0
        public ActionResult SearchReportAction(List <string> cond, string type)
        {
            var retData = new VM_Result_Data();

            retData.Content = "查询失败";
            var bllAllReport = new MesWeb.BLL.T_AllReport();
            var condStr      = "";

            if (cond != null && cond.Count > 0)
            {
                cond.ForEach(c =>
                {
                    condStr = condStr + spliter + "%" + c + "%";
                });
                condStr = condStr.Substring(spliter.Length);
            }
            var result = bllAllReport.GetModelList("ReportType = '" + type + "' and  IndexValue like '" + condStr + "' ");

            if (result != null && result.Count > 0)
            {
                var repList = new List <VM_GumReportSearchResult>();
                var results = new List <SearchReportResult>();

                result.ForEach(report =>
                {
                    var value  = report.ReportValue.Split(new string[] { spliter }, StringSplitOptions.None).ToList();
                    var remark = report.Remark.Split(new string[] { spliter }, StringSplitOptions.None).ToList();
                    var res    = new SearchReportResult();
                    //通用型结果
                    res.Remark    = remark;
                    res.Report    = value;
                    res.Id        = report.Id;
                    res.InputDate = report.InputDate.HasValue ? report.InputDate.Value.ToString("yyyy-MM-dd") : "--";
                    results.Add(res);

                    var rep = new VM_GumReportSearchResult();
                    //翻译字段
                    rep.BatchNum  = value[2];
                    rep.InputDate = report.InputDate.HasValue ? report.InputDate.Value.ToString("yyyy-MM-dd") : "--";
                    rep.SpecNum   = value[1];
                    rep.Supplier  = value[0];
                    rep.Detail    = "<a reportId='" + report.Id + "' onclick='navToGumDetail(this)'>详细</a>";

                    repList.Add(rep);
                });
                retData.Content  = results;
                retData.Code     = RESULT_CODE.OK;
                retData.Appendix = repList;
            }
            return(Json(retData));
        }
Esempio n. 2
0
        public static int SearchReportId(List <string> cond, string type)
        {
            var bllAllReport = new MesWeb.BLL.T_AllReport();
            var condStr      = "";

            if (cond != null && cond.Count > 0)
            {
                cond.ForEach(c =>
                {
                    condStr = condStr + spliter + c + "%";
                });
                condStr = condStr.Substring(spliter.Length);
            }
            var result = bllAllReport.GetModelList("ReportType = '" + type + "' and  IndexValue like '%" + condStr + "' ").FirstOrDefault();

            return(result.Id);
        }