private void button_load_Click(object sender, EventArgs e) { var data = db.bills.Where(o => o.id > 0); if (!rangeSelector.valid) { Comformation.show(Text, "Please select a Duration", 1); return; } var r = rangeSelector.Range; var r1 = r[0]; var r2 = r[1]; var d = rangeSelector.DurationType; if (d == 1) { if (!rangeSelector.fyvalid) { Comformation.show(Text, "Please select a Fiscalyear", 1); return; } var fyid = rangeSelector.fy.id; data = data.Where(o => o.fiscalyear_id == fyid); } else if (d == 5) { data = data.Where(o => o.date == r1); } else { data = data.Where(o => o.date >= r1 && o.date <= r2); } betterListView1.Clear(); if (comboBox_grouping.SelectedIndex == 1) { GroupByBill(data); } else if (comboBox_grouping.SelectedIndex == 2) { GroupByItem(data.Select(o => o.id).ToList()); } else if (comboBox_grouping.SelectedIndex == 3) { GroupByCategory(data.Select(o => o.id).ToList()); } //else if (comboBox_grouping.SelectedIndex == 4) //{ // GroupByCounter(data); //} }
private void button_load_Click(object sender, EventArgs e) { var data = db.wastagepurchaseitems.Where(o => o.id > 0); if (!rangeSelector.valid) { Comformation.show(Text, "Please select a Duration", 1); return; } var r = rangeSelector.Range; var r1 = r[0]; var r2 = r[1]; var d = rangeSelector.DurationType; if (d == 1) { if (!rangeSelector.fyvalid) { Comformation.show(Text, "Please select a Fiscalyear", 1); return; } var fyid = rangeSelector.fy.id; data = data.Where(o => o.fiscalyear_id == fyid); } else if (d == 5) { data = data.Where(o => o.date == r1); } else { data = data.Where(o => o.date >= r1 && o.date <= r2); } betterListView1.Clear(); if (comboBox_grouping.SelectedIndex == 1) { Getbyitem(data); } }