Пример #1
0
        public PEDOnCategory GetPEDOnCategory(string product, string store)
        {
            var result = new PEDOnCategory();
            Database db = new Database();

            string[,] str = new string[2, 2];
            str[0, 0] = "@productId";
            str[0, 1] = product;
            str[1, 0] = "@storeId";
            str[1, 1] = store;
            try
            {
                string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_GetPEDOnCategory", str);
                var serializer = new XmlSerializer(typeof(PEDOnCategory));

                    using (var reader = new StringReader(xmlResult))
                    {
                     result = (PEDOnCategory)serializer.Deserialize(reader);
                     return result;
                    }

            }
            catch (Exception)
            {
                return new PEDOnCategory();
            }
        }
Пример #2
0
 public PEDOnCategoryModel(PEDOnCategory pEDOnCategory)
 {
     this.itemPEDDetails = (from p in pEDOnCategory.pEDOnCategory
                            select new ItemPEDDetailsModel {
                            PED=p.PED,
                            Quantity=p.Quantity,
                            }).ToList();
 }