Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array["ATM"] = array(
- "PC" => array(
- "Processor" => array(
- "CompanyName" => "Name",
- "Speed" => "2.9 GHz"
- ),
- "RAM" => array(
- "CompanyName" => "GSkill",
- "Capacity" => "8GB")
- ),
- "Others" => array()
- );
- public Dictionary<string, dynamic> _LoadData(int id, Dictionary<string, dynamic> data, FormCollection collection)
- {
- var childs = inv_db.inv_meta_data_properties.Where(a => a.parentDataPropertyId == id).ToList();
- if(childs.Count > 0){
- foreach(var child in childs){
- data[child.dataPropertyValue] = _LoadData(child.dataPropertyId, data, collection);
- }
- }else{
- var propItemId = (from map in inv_db.inv_item_property_mapping
- join prop in inv_db.inv_dic_item_properties on map.itemPropertyId equals prop.itemPropertyId
- where map.itemId == id && map.status == 1
- select new
- {
- name = prop.propertyName,
- propId = prop.itemPropertyId
- }).ToList();
- foreach (var value in propItemId) {
- var key = id + "_" + value.propId;
- data[value.name] = collection[key].ToString();
- }
- }
- return data;
- }
Add Comment
Please, Sign In to add comment