コード例 #1
0
        private void toolStripButton18_Click(object sender, EventArgs e)
        {
            if (null == this.lY_salesWarranty_queryQCDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.LY_salesWarranty_queryQC.Columns, ls);
            DataSort.ShowDialog();



            if (null == this.dataGridView1.CurrentRow)
            {
                return;
            }
            SortForm DataSort2 = new SortForm();

            List <string> ls2 = new List <string>();

            ls2.Add("id");


            DataSort2.SetSortColumns(this.lYSalseMange2.ly_sales_receive_itemDetail_repairA_All.Columns, ls2);
            DataSort2.ShowDialog();
        }
コード例 #2
0
        private void toolStripButton18_Click(object sender, EventArgs e)
        {
            if (null == this.lY_salesWarranty_queryDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.LY_salesWarranty_query.Columns, ls);
            DataSort.ShowDialog();
        }
コード例 #3
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.ly_salesAndrepair_MaopossReportDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.ly_salesAndrepair_MaopossReport.Columns, ls);
            DataSort.ShowDialog();
            this.ly_salesAndrepair_MaopossReportBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #4
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.ly_inma0010DataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(ly_inma0010DataGridView.Columns, ls);
            DataSort.ShowDialog();
            this.lY_InventoryMaintenance_query_newBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #5
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.lY_qualityDebug_historyInfoDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange.LY_qualityDebug_historyInfo.Columns, ls);
            DataSort.ShowDialog();
            this.lY_qualityDebug_historyInfoBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #6
0
        private void toolStripButton20_Click(object sender, EventArgs e)
        {
            if (null == this.ly_sales_standard_SumDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseRepair.ly_quality_debug_Sum.Columns, ls);
            DataSort.ShowDialog();
            this.ly_quality_debug_SumBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #7
0
ファイル: LY_StoreOut_Verify.cs プロジェクト: Deny01/MY_PRO
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.ly_store_outnumDateDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(ly_store_outnumDateDataGridView.Columns, ls);
            DataSort.ShowDialog();
            this.ly_store_outnumDateBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #8
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            if (null == this.ly_production_detail_viewDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYProductMange.ly_production_detail_view.Columns, ls);
            DataSort.ShowDialog();
            this.ly_production_detail_viewBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #9
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.dataGridView1.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.ds.Tables[0].Columns, ls);
            DataSort.ShowDialog();
            this.bindingSource2.Sort = DataSort.GetSortString();
        }
コード例 #10
0
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            if (null == this.ly_purchase_contract_mainDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYMaterielRequirements.ly_purchase_contract_main11.Columns, ls);
            DataSort.ShowDialog();
            this.ly_purchase_contract_main11BindingSource.Sort = DataSort.GetSortString();
        }
コード例 #11
0
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            if (null == this.sum_queryDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.sumCard_DataSet.Sum_query.Columns, ls);
            DataSort.ShowDialog();
            this.sum_queryBindingSource.Sort = DataSort.GetSortString();
        }
コード例 #12
0
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            if (null == this.ly_sales_contract_standard_ReportDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.ly_sales_contract_standard_Report.Columns, ls);
            DataSort.ShowDialog();
            //this.ly_sales_contract_standard_ReportBindingSource.Sort ="(" +DataSort.GetSortString()+") or 清单号='合计'";
        }
コード例 #13
0
ファイル: Ly_DNINEW.cs プロジェクト: Deny01/MY_PRO
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            if (null == this.dataGridView5.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange.GetOrderByBussCodeAll.Columns, ls);
            DataSort.ShowDialog();
            this.getOrderByBussCodeAllBindingSource.Sort = DataSort.GetSortString();
            AddSummationRow_New(getOrderByBussCodeAllBindingSource, dataGridView5);
        }
コード例 #14
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (null == this.dataGridView1.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.ly_plan_getmaterial_department.Columns, ls);
            DataSort.ShowDialog();

            this.ly_plan_getmaterial_departmentBindingSource1.Sort = DataSort.GetSortString();
        }
コード例 #15
0
        private void toolStripButton20_Click(object sender, EventArgs e)
        {
            if (null == this.ly_material_task_viewNewDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYPlanMange.ly_material_task_viewNew.Columns, ls);
            DataSort.ShowDialog();
            this.ly_material_task_viewNewBindingSource.Sort = DataSort.GetSortString();
            AddSummationRow_New(ly_material_task_viewNewBindingSource, ly_material_task_viewNewDataGridView);
        }
コード例 #16
0
ファイル: LY_DNI.cs プロジェクト: Deny01/MY_PRO
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            if (null == this.ly_sales_contract_standard_ReportDataGridView.CurrentRow)
            {
                return;
            }
            SortForm DataSort = new SortForm();

            List <string> ls = new List <string>();

            ls.Add("id");


            DataSort.SetSortColumns(this.lYSalseMange2.ly_sales_cost_Report.Columns, ls);
            DataSort.ShowDialog();
            this.lysalescostReportBindingSource.Sort = " sumorder asc," + DataSort.GetSortString();
            AddSummationRow_New(lysalescostReportBindingSource, ly_sales_contract_standard_ReportDataGridView);
        }
コード例 #17
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            SumQuery qds;

            qds = new SumQuery();

            SortForm DataSort = new SortForm();
            //DataGridView dv = (DataGridView)DataSort.Controls["sortTableDataGridView"];

            DataGridView dv = DataSort.sortTableDataGridView;

            dv.Columns[1].Visible = false;



            DataSort.Text = "分组设置";

            List <string> ls = new List <string>();

            ls.Add("id");

            DataSort.SetSortColumns(qds.QueryColumns.Columns, ls);
            DataSort.ShowDialog();

            string groupStr = DataSort.GetSortString();

            ////////////
            if (null != groupStr)
            {
                string[] result = groupStr.Split(new Char[] { ',' });

                string header = " select ";
                string ender  = " group by ";

                string sWhere = "  where ( 1 = 1) ";

                if (this.checkBox8.Checked)
                {
                    sWhere = sWhere + "  and ( a.accrual_date >= '" + dateTimePicker1.Text + "' and a.accrual_date <= '" + dateTimePicker2.Text + "') ";
                }


                //if (sWhere.Length > 3)
                //{
                //    sWhere = " where " + sWhere.Substring(0, sWhere.Length - 3);

                //}
                //else
                //{
                //    sWhere = "";
                //}


                if (result.Length > 0)
                {
                    for (int i = 0; i < result.Length; i++)
                    {
                        header = header + selstr(result[i]) + ",";

                        if (i < result.Length - 1)
                        {
                            ender = ender + grustr(result[i]) + ",";
                        }
                        else
                        {
                            ender = ender + grustr(result[i]);
                        }
                    }
                }



                string body = " sum( isnull(a.principal_money,0))  as 本金, " +
                              " sum(isnull(a.compensate_money,0)) as 还本, " +
                              " (sum( isnull(a.principal_money,0)) - sum(isnull(a.compensate_money,0))) as 欠本," +
                              "  sum(isnull(a.accrual_money,0))  as 利息, " +
                              " sum(isnull(a.compensate_accrual_money,0)) as 还息, " +
                              " ( sum(isnull( a.accrual_money,0)) -    sum(isnull(a.compensate_accrual_money,0))) as 欠息," +
                              " left(max(convert(varchar(20),accrual_date,120)),10)  as 计息日期" +
                              " FROM XD_Client_Loanaccrual AS a LEFT OUTER JOIN " +
                              "  XD_Client_Loan AS b ON a.loan_id = b.Id " +
                              " LEFT OUTER JOIN " +
                              " YX_client AS c on b.Client_Code = c.Card_number "; //+
                //" LEFT OUTER JOIN " +
                //" XD_client_compensate_loan AS d on a.loan_id = d.loan_id and a.accrual_date = d.compensate_date ";


                string sel;


                if (result.Length > 0)
                {
                    sel = header + body + sWhere + ender;
                }
                else
                {
                    sel = header + body + sWhere;
                }

                SqlDataAdapter myAdapter = new SqlDataAdapter(sel, SQLDatabase.Connectstring);

                //DataSet allData = new DataSet();


                //myAdapter.Fill(allData);

                if (null != ds)
                {
                    ds.Dispose();
                }

                ds = new DataSet();

                myAdapter.Fill(ds);
                myAdapter.Dispose();

                //this.dataGridView1.DataSource = allData;


                this.dataGridView1.Columns.Clear();

                this.dataGridView1.AutoGenerateColumns = true;
                dataGridView1.AutoSizeRowsMode         = DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;

                //BindingSource bindingSource1 = new BindingSource();



                //DataTableReader reader = new DataTableReader(allData.Tables[0]);

                //this.billMainDataSet.BalanceBill.Clear();
                //this.billMainDataSet.BalanceBill.Load(reader);
                //ds = allData;
                if (null != bindingSource2)
                {
                    this.bindingSource2.Dispose();
                }

                this.bindingSource2            = new BindingSource();
                this.bindingSource2.DataSource = ds.Tables[0];
                dataGridView1.DataSource       = bindingSource2;

                this.bindingNavigator1.BindingSource = bindingSource2;

                bindingSource2.ResetBindings(true);

                AddSummationRow(bindingSource2, dataGridView1);
            }
        }