Ejemplo n.º 1
0
        public string GenGetOrderWhere(WaveSearchCondition SearchCondition)
        {
            StringBuilder sb = new StringBuilder();

            if (!string.IsNullOrEmpty(SearchCondition.WaveNumber))
            {
                sb.Append(" and w.WaveNumber='" + SearchCondition.WaveNumber + "'");
            }
            if (SearchCondition.CustomerID != 0)
            {
                sb.Append(" and w.CustomerID=" + SearchCondition.CustomerID);
            }
            if (SearchCondition.WarehouseID != 0)
            {
                sb.Append(" and w.WarehouseID=" + SearchCondition.WarehouseID);
            }
            if (!string.IsNullOrEmpty(SearchCondition.OrderNumber))
            {
                sb.Append(" and w.ID in(select WaveID from WMS_WaveDetail where OrderNumber='" + SearchCondition.OrderNumber + "')");
            }
            if (!string.IsNullOrEmpty(SearchCondition.ExternOrderNumber))
            {
                sb.Append(" and w.ID in(select WaveID from WMS_WaveDetail where ExternOrderNumber='" + SearchCondition.ExternOrderNumber + "')");
            }
            if (!string.IsNullOrEmpty(SearchCondition.PreOrderNumber))
            {
                sb.Append(" and w.ID in(select WaveID from WMS_WaveDetail where PreOrderNumber='" + SearchCondition.PreOrderNumber + "')");
            }
            if (!string.IsNullOrEmpty(SearchCondition.StartCreateTime.ToString()))
            {
                sb.Append(" and w.CreateTime>='" + SearchCondition.StartCreateTime.DateTimeToString("yyyy-MM-dd 00:00:00.00") + "'");
            }
            if (!string.IsNullOrEmpty(SearchCondition.EndCreateTime.ToString()))
            {
                sb.Append(" and w.CreateTime<='" + SearchCondition.EndCreateTime.DateTimeToString("yyyy-MM-dd 23:59:59.99") + "'");
            }
            if (!string.IsNullOrEmpty(SearchCondition.StartCompleteTime.ToString()))
            {
                sb.Append(" and w.CreateTime>='" + SearchCondition.StartCompleteTime.DateTimeToString("yyyy-MM-dd 00:00:00.00") + "'");
            }
            if (!string.IsNullOrEmpty(SearchCondition.EndCompleteTime.ToString()))
            {
                sb.Append(" and w.CreateTime<='" + SearchCondition.EndCompleteTime.DateTimeToString("yyyy-MM-dd 23:59:59.99") + "'");
            }
            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public GetWaveByConditionResponse GetWaveHeaderByCondition(WaveSearchCondition SearchCondition, int pageIndex, int pageSize, out int rowCount)
        {
            GetWaveByConditionResponse response = new GetWaveByConditionResponse();
            string sqlWhere     = this.GenGetOrderWhere(SearchCondition);
            int    tempRowCount = 0;

            DbParam[] dbParams = new DbParam[] {
                new DbParam("@Where", DbType.String, sqlWhere, ParameterDirection.Input),
                new DbParam("@PageIndex", DbType.Int32, pageIndex, ParameterDirection.Input),
                new DbParam("@PageSize", DbType.Int32, pageSize, ParameterDirection.Input),
                new DbParam("@RowCount", DbType.Int32, tempRowCount, ParameterDirection.Output)
            };

            DataSet ds = this.ExecuteDataSet("Proc_WMS_GetWaveHeaderByCondition", dbParams);

            rowCount = (int)dbParams[3].Value;
            response.WaveCollection = ds.Tables[0].ConvertToEntityCollection <WMS_Wave>();
            return(response);
        }