private void button1_Click(object sender, EventArgs e)
        {
            DateTime from = dateTimePicker1.Value.Date;
            DateTime to   = dateTimePicker2.Value.Date;

            using (AccountingRef.AccountingClient client = new AccountingRef.AccountingClient())
            {
                var result = client.GetTxCylinders(from, to, "");
                var groups = result.Where(x => x.CashMemoNo == 0).AsEnumerable().GroupBy(g => g.CylinderDetails).Select(g => new { CylinderDetails = g.Key, Price = Math.Round(g.Sum(s => s.Price) / g.Count(), 2), Quentity = g.Sum(s => s.Quentity), Total = g.Sum(s => s.Total) });
                dataGridView1.DataSource = groups.ToList();
                groups = result.Where(x => x.CashMemoNo != 0).AsEnumerable().GroupBy(g => g.CylinderDetails).Select(g => new { CylinderDetails = g.Key, Price = Math.Round(g.Sum(s => s.Price) / g.Count(), 2), Quentity = g.Sum(s => s.Quentity), Total = g.Sum(s => s.Total) });
                dataGridView3.DataSource = groups.ToList();

                var result1 = client.GetTxStoveRegulators(from, to, "");
                var groups1 = result1.Where(x => x.CashMemoNo == 0).AsEnumerable().GroupBy(g => g.Details).Select(g => new { Details = g.Key, Price = Math.Round(g.Sum(s => s.Price) / g.Count(), 2), Quentity = g.Sum(s => s.Quentity), Total = g.Sum(s => s.Total) });
                dataGridView2.DataSource = groups1.ToList();
                groups1 = result1.Where(x => x.CashMemoNo != 0).AsEnumerable().GroupBy(g => g.Details).Select(g => new { Details = g.Key, Price = Math.Round(g.Sum(s => s.Price) / g.Count(), 2), Quentity = g.Sum(s => s.Quentity), Total = g.Sum(s => s.Total) });
                dataGridView4.DataSource = groups1.ToList();
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            // dataGridView1.Rows.Clear();
            DateTime from   = dateTimePicker1.Value;
            DateTime to     = dateTimePicker2.Value;
            string   cyType = comboBox1.Text;

            using (AccountingRef.AccountingClient client = new AccountingRef.AccountingClient())
            {
                var result = client.GetTxStoveRegulators(from, to, cyType);
                if (!checkBox1.Checked)
                {
                    result = result.Where(x => x.CashMemoNo == 0).ToArray();
                }
                if (!checkBox2.Checked)
                {
                    result = result.Where(x => x.CashMemoNo != 0).ToArray();
                }
                label5.Text = result.Count().ToString();
                result      = result.OrderByDescending(x => x.TxDate).ToArray();
                dataGridView1.DataSource = result;
            }
        }