public async Task <IHttpActionResult> GetWarehouseList() { List <Warehouse> warehouseNoList = new List <Warehouse>(); var connection = new SqlConnection(sqlConnectionString); warehouseNoList = connection.Query <Warehouse>("Select * from tblWarehouse").ToList(); List <WareHouseList> warehouseList = new List <WareHouseList>(); for (int i = 0; i < warehouseNoList.Count; i++) { WareHouseList tempwarehouseList = new WareHouseList(); var ID = warehouseNoList[i].ID; var warehouseSection = connection.Query <WarehouseSection>("Select * from tblSection where WarehouseID = @ID", new { Id = ID }).ToList(); // for (int j = 0; j < warehouseSection.Count; j++) //{ // tempwarehouseList.WarehouseId = ID; // tempwarehouseList.WarehouseSection = warehouseSection[j].Section; // tempwarehouseList.WareHouseNo = warehouseNoList[i].WareHouseNo; // tempwarehouseList.SectionId = warehouseSection[j].ID; // warehouseList.Add(tempwarehouseList); // DataTable dt = new DataTable(); // // dt.Load(command.ExecuteReader()); // // var list = DataTableToJSONWithJSONNet(dt); // //dynamic json = JsonConvert.DeserializeObject(warehouseList); // // data.UnitList = json; //} } WareHouseData wareHouseData = new WareHouseData(); wareHouseData.WareHouseLists = warehouseNoList; return(Ok(wareHouseData)); }
private void WarehouseList_accordionControlElement_Click(object sender, EventArgs e) { WareHouseList WareHouseListForm = new WareHouseList(); WareHouseListForm.Show(); }