public Report(string reportid) { this.reportid = reportid; report = (JObject)Client.reports[reportid]; name = report["name"].ToString(); moduleid = report["moduleid"].ToString(); module = new ExcelModule((JObject)Client.modules[moduleid]); string[] index; switch (report["ranges"].ToString()) { case "0": ranges = module.ranges; range_indexes = new string[ranges.Length]; for (int i = 0; i < ranges.Length; i++) { range_indexes[i] = (i + 1).ToString(); } break; case "ALL": ranges = module.ranges; range_indexes = new string[ranges.Length]; for (int i = 0; i < ranges.Length; i++) { range_indexes[i] = (i + 1).ToString(); } break; default: index = report["ranges"].ToString().Split('|'); index.CopyTo(range_indexes, 0); ranges = new JObject[index.Length]; for (int i = 0; i < ranges.Length; i++) { ranges[i] = module.ranges[Convert.ToInt32(index[i]) - 1]; } break; } ranges_count = ranges.Length; }
public Boolean csvfinished = false; //csv是否创建完成 public Range(ExcelModule module, int id) { this.module = module; rangename = module.ranges[id]["name"].ToString(); sheetname = module.ranges[id]["sheetname"].ToString(); startrow = Convert.ToInt32(module.ranges[id]["startrow"].ToString()); startcol = Convert.ToInt32(module.ranges[id]["startcol"].ToString()); dims = module.ranges[id]["dims"].ToString().Split(','); fields = module.ranges[id]["fields"].ToString().Split(','); sourcetype = module.ranges[id]["sourcetype"].ToString(); campaign_models = module.ranges[id]["campaign_models"].ToString(); switch (sourcetype) { case "zuanshi": sourcetable = new Zuanshitable(this); break; case "subway": sourcetable = new Subwaytable(this); break; case "shop": sourcetable = new SYCMSHOPtable(this); break; case "item": sourcetable = new SYCMITEMtable(this); break; case "ordersinfo": sourcetable = new Orderstable(this); break; default: sourcetable = new Sourcetable(this); break; } }