Пример #1
0
        private ActionResult GetInStockCensusPages(InStockCensusShow condition, string where)
        {
            string StrForm = "(select count(*) count,s.IntoOrderNo,s.BigCode,s.MiddleCode,p.ProductNumber ProductNumber,p.ProductName ProductName,s.IntoTime " +
                             "from Scale s left join Product p on s.ProductNo=p.ProductNumber where s.IsInto=1 " + where +
                             "group by ProductNumber,ProductName,s.IntoOrderNo,s.BigCode,s.MiddleCode,s.IntoTime) as InStockScaleShow ";

            PageJsonModel <InStockCensus> page = new PageJsonModel <InStockCensus>();

            page.pageIndex = condition.pageIndex;
            page.pageSize  = condition.pageSize;
            page.strForm   = StrForm;
            page.strSelect = " * ";
            if (string.IsNullOrWhiteSpace(condition.orderby) == false)
            {
                page.strOrder = Common.FilteSQLStr(condition.orderby);
            }
            else
            {
                page.strOrder = "IntoTime desc";
            }

            page.LoadList();

            if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0)
            {
                ScaleCodeCount IntoStockCount = Scale.GetIntoStockCount(where);
                page.pageResponse.BigCount    = IntoStockCount.BigCount;
                page.pageResponse.MiddleCount = IntoStockCount.MiddleCount;
                page.pageResponse.SmallCount  = IntoStockCount.SmallCount;
                return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult GetInStockCensusPage(InStockCensusShow condition)
        {
            string where = string.Empty;
            if (!string.IsNullOrWhiteSpace(condition.keyword))
            {
                where += string.Format(" and ( BigCode='{0}' or MiddleCode='{0}' or SmallCode='{0}')", Common.Filter(condition.keyword));
            }
            if (!string.IsNullOrWhiteSpace(condition.ProductNumber))
            {
                where += string.Format(" and ProductNo='{0}'", condition.ProductNumber);
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateB))
            {
                where += string.Format(" and IntoTime >={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateB + " 00:00:00")));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateE))
            {
                where += string.Format(" and IntoTime <={0} ", CommonFunc.GetTimestamp(Convert.ToDateTime(condition.DatCreateE + " 23:59:59")));
            }

            return(GetInStockCensusPages(condition, where));
        }