コード例 #1
0
        /// <summary>
        /// Purpose: Grabs product delivery type information based on ID
        /// Accepts: Int
        /// Returns: Nothing
        /// </summary>
        public void GetProductDeliveryTypeByID(int id)
        {
            try
            {
                ProductDeliveryTypeData data = new ProductDeliveryTypeData();
                Hashtable hsh = new Hashtable();

                hsh = data.GetProductDeliveryTypeByID(id);

                ProductDeliveryTypeID = id;
                DeliveryTypeID = Convert.ToInt32(hsh["deliverytypeid"]);
                ProductCode = hsh["productcode"];
                Created = hsh["created"];
                Modified = hsh["modified"];
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "ProductDeliveryType", "GetProductDeliveryTypeByID");
            }
        }
コード例 #2
0
        /// <summary>
        /// Purpose: Grabs all product delivery types by product code
        /// Accepts: String (Product Code)
        /// Returns: List<ProductDeliveryType>
        /// </summary>
        public List<ProductDeliveryType> GetAllProductDeliveryTypesByProdCode(string prodcd)
        {
            List<ProductDeliveryType> pdtypes = new List<ProductDeliveryType>();
            try
            {
                ProductDeliveryTypeData data = new ProductDeliveryTypeData();
                List<QSRDataObjects.ProductDeliveryType> dataPDTypes = data.GetAllProductDeliveryTypesByProdCode(prodcd);

                foreach (QSRDataObjects.ProductDeliveryType pdt in dataPDTypes)
                {
                    ProductDeliveryType pdtype = new ProductDeliveryType();
                    pdtype.ProductDeliveryTypeID = pdt.ProductDeliveryTypeID;
                    pdtype.DeliveryTypeID = Convert.ToInt32(pdt.DeliveryTypeID);
                    pdtype.ProductCode = pdt.ProductCode;
                    pdtype.Created = pdt.Created;
                    pdtype.Modified = pdt.Modified;
                    pdtypes.Add(pdtype);
                }
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "ProductDeliveryType", "GetAllProductDeliveryTypesByProdCode");
            }
            return pdtypes;
        }