Example #1
0
        public StoreController()
        {
            List <Tuple <string, string> > storePropertyList = new List <Tuple <string, string> >();
            Type t = typeof(Store);

            MemberInfo[] members = t.GetProperties();
            var          result  = from m in members
                                   where m.Name != "Id" && m.Name != "ProductList"
                                   select m.ToString();

            foreach (var r in result)
            {
                string[] NameAndType   = r.Split(' ');
                string   columnName    = NameAndType[1];
                string   elementString = KCHandler.ConvertBindTypeFromDataType(columnName, NameAndType[0].Split('.').Last());
                storePropertyList.Add(new Tuple <string, string>(columnName, elementString));
            }
            storeTableOption = new EditableTableOption(storePropertyList);

            List <Tuple <string, string> > storeProductPropertyList = new List <Tuple <string, string> >();

            storeProductPropertyList.Add(new Tuple <string, string>("ProductName", KCHandler.ConvertBindTypeFromDataType("ProductName", "", true)));
            storeProductPropertyList.Add(new Tuple <string, string>("IsAvailable", KCHandler.ConvertBindTypeFromDataType("IsAvailable", "Boolean")));
            storeProductTableOption = new EditableTableOption(storeProductPropertyList, false, false);
        }
        public ProductController()
        {
            List <Tuple <string, string> > productPropertyList = new List <Tuple <string, string> >();
            Type t = typeof(Product);

            MemberInfo[] members = t.GetProperties();
            var          result  = from m in members
                                   where m.Name != "Id" && m.Name != "StoreList"
                                   select m.ToString();

            foreach (var r in result)
            {
                string[] NameAndType   = r.Split(' ');
                string   columnName    = NameAndType[1];
                string   elementString = KCHandler.ConvertBindTypeFromDataType(columnName, NameAndType[0].Split('.').Last());
                productPropertyList.Add(new Tuple <string, string>(columnName, elementString));
            }
            storeTableOption = new EditableTableOption(productPropertyList);
        }