Ejemplo n.º 1
0
        public BasicResponse <int> GetReportTotalRecord(Sys.Safety.Request.ReportGetReportTotalRecordRequest reportRequest)
        {
            // 20171106
            BasicResponse <int> response = new BasicResponse <int>();

            int count = 0;

            var    _strFreQryCondition = reportRequest._strFreQryCondition;
            var    ListID          = reportRequest.ListID;
            var    _listdate       = reportRequest._listdate;
            var    ListDataID      = reportRequest.ListDataID;
            int    filterType      = reportRequest.FilterType;
            int    removeRepetType = reportRequest.RemoveRepetType;
            string arrangeTime     = reportRequest.ArrangeTime;

            SetDayTableSql(_strFreQryCondition, ListID, _listdate, filterType, removeRepetType);

            if (_strFreQryCondition.ToLower().IndexOf("datsearch") > 0)
            {
                string strdate = _strFreQryCondition.Substring(_strFreQryCondition.ToLower().IndexOf("datsearch") + 10, 55);
                _strFreQryCondition = _strFreQryCondition.Replace(strdate, " <> '1900-1-1'");
            }

            //string strsql = "select strListSQL from BFT_ListDataEx where ListID=" + ListID + " and ListDataID=" + ListDataID + " LIMIT 0,1 ";
            //DataTable dtSourceSql = _Repository.QueryTable(strsql);
            var    item   = _ListdataexRepository.Datas.FirstOrDefault(o => o.ListID == ListID && o.ListDataID == ListDataID);
            string strsql = string.Empty;

            if (item != null)
            {
                string strSortWhere = "";
                IList <ListdatalayountInfo> listDataLayoutDTO = this.GetListLayout(filterType, arrangeTime, ListDataID);
                strSortWhere = listDataLayoutDTO != null && listDataLayoutDTO.Count > 0
                    ? "and " + listDataLayoutDTO[0].StrConTextCondition
                    : "";
                strsql = item.StrListSQL;// Convert.ToString(dtSourceSql.Rows[0]["strListSQL"]);
                strsql = strsql.Replace("where 1=1", "where 1=1 " + _strFreQryCondition + strSortWhere);
            }
            if (this.GetDBType() == "mysql")
            {
                strsql = strsql.Replace("ISNULL", "IFNULL").Replace("isnull", "ifnull");
            }
            this.GetDistinctSql(ref strsql, ListID);
            //count = _Repository.GetTotalRecord(strsql);
            SqlRequest countsqlrequest = new SqlRequest
            {
                Sql = strsql
            };
            DataTable temptable = _SqlService.QueryTableBySql(countsqlrequest).Data;

            if (temptable != null && temptable.Rows.Count > 0)
            {
                count = temptable.Rows.Count;
            }

            response.Data = count;
            return(response);
        }
Ejemplo n.º 2
0
        public BasicResponse <int> GetReportTotalRecord(Sys.Safety.Request.ReportGetReportTotalRecordRequest reportRequest)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/Report/GetReportTotalRecord?token=" + Token, JSONHelper.ToJSONString(reportRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <int> >(responseStr));
        }
Ejemplo n.º 3
0
 public BasicResponse <int> GetReportTotalRecord(Sys.Safety.Request.ReportGetReportTotalRecordRequest reportRequest)
 {
     return(reportService.GetReportTotalRecord(reportRequest));
 }