Beispiel #1
0
        private void GetThisCateGory(System.Web.HttpContext context)
        {
            IList <CategoryPartInfo> list = new List <CategoryPartInfo>();
            int cid1 = 0;
            int cid2 = 0;
            int cid3 = 0;
            int cid4 = 0;
            int cid5 = 0;
            int cid6 = 0;
            int cid7 = 0;
            var c1   = context.Request["Cid1"];
            var c2   = context.Request["Cid2"];
            var c3   = context.Request["Cid3"];
            var c4   = context.Request["Cid4"];
            var c5   = context.Request["Cid5"];
            var c6   = context.Request["Cid6"];
            var c7   = context.Request["Cid7"];

            int.TryParse(c1, out cid1);
            int.TryParse(c2, out cid2);
            int.TryParse(c3, out cid3);
            int.TryParse(c4, out cid4);
            int.TryParse(c5, out cid5);
            int.TryParse(c6, out cid6);
            int.TryParse(c7, out cid7);
            try
            {
                var catagoryDT = CategoryBrowser.GetCategoriesByThisId(cid1, cid2, cid3, cid4, cid5, cid6, cid7);


                if (catagoryDT != null)
                {
                    for (int i = 0; i < catagoryDT.Rows.Count; i++)
                    {
                        list.Add(DataMapper.ConvertDataRowToPartCategory(catagoryDT.Rows[i]));
                    }
                }
            }
            catch (Exception)
            {
            }
            context.Response.ContentType = "application/json";
            context.Response.Write(JsonConvert.SerializeObject(list));
        }