예제 #1
0
        public static CommodityClasses GetCommodityClasses()
        {
            //
            CommodityClasses classes = null;

            try {
                _Client = new RoadshowServiceClient();
                classes = _Client.GetCommodityClasses();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCommodityClasses() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCommodityClasses() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCommodityClasses() communication error.", ce); }
            return(classes);
        }
예제 #2
0
        public CommodityClasses GetCommodityClasses()
        {
            //
            CommodityClasses classes = null;

            try {
                classes = new CommodityClasses();
                DataSet ds = fillDataset(USP_COMMODITYCLASSES, TBL_COMMODITYCLASSES, new object[] { });
                if (ds != null)
                {
                    RoadshowDS _classes = new RoadshowDS();
                    _classes.CommodityClassTable.Merge(ds.Tables[TBL_COMMODITYCLASSES]);
                    for (int i = 0; i < _classes.CommodityClassTable.Rows.Count; i++)
                    {
                        classes.Add(new CommodityClass(_classes.CommodityClassTable[i]));
                    }
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading commodity classes.", ex); }
            return(classes);
        }