Example #1
0
        public static List <PoItem> GetCurrentPoList(User user, FilterInfo filter)
        {
            List <PoItem> ret = new List <PoItem>();

            try
            {
                var connection = ConnectionsMgr.GetOCConnection(user, ECGB);
                {
                    var recCount = _GetRecordCount(user, connection, filter);
                    if (recCount > 0)
                    {
                        filter.ResultCount = recCount;
                        filter.MaxPage     = (int)(Math.Ceiling(recCount / (double)resultPageSize));
                    }

                    using (var queryCurrent = connection.Select($"{_Column.UniqueKey},{_Column.PONumber},{_Column.PODate},{_Column.ShipmentDate},{_Column.CancelDate},potype,round(totcmpinv) totcmpinv,round(totcmpasn) totcmpasn,round({_Column.TotalItems}) {_Column.TotalItems}", SrcH850, $"WHERE POStatus IN (0, 1) AND {filter.ToFetchQueryString(user, searchCols, resultPageSize)}"))
                    {
                        while (queryCurrent.Read())
                        {
                            PoItem po = new PoItem(queryCurrent);
                            ret.Add(po);
                        }
                    }
                }
                connection.Close();
            }
            catch (Exception e)
            {
                ProgramLog.LogError(user, nameof(PdsManager), nameof(GetCurrentPoList), e.Message);
            }
            return(ret);
        }
Example #2
0
        public static List <XrefRecord> GetXrefList(User user, FilterInfo filter)
        {
            List <XrefRecord> ret = new List <XrefRecord>();

            try
            {
                var connection = ConnectionsMgr.GetOCConnection(user, Home);
                {
                    var recCount = _GetRecordCount(user, connection, filter);
                    if (recCount > 0)
                    {
                        filter.ResultCount = recCount;
                        filter.MaxPage     = (int)(Math.Ceiling(recCount / (double)resultPageSize));
                    }

                    using (var queryCurrent = connection.Select("*", CatXref, $"WHERE {filter.ToFetchQueryString(user, searchCols, resultPageSize)}"))
                    {
                        while (queryCurrent.Read())
                        {
                            XrefRecord xr = new XrefRecord(queryCurrent);
                            ret.Add(xr);
                        }
                    }
                }
                connection.Close();
            }
            catch (Exception e)
            {
                ProgramLog.LogError(user, nameof(CatalogXrefManager), nameof(GetXrefList), e.Message);
            }
            return(ret);
        }