Exemple #1
0
        private void barExplorYear_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            if (gridtable == null) return;
           
            IList<PJ_wgclcrkd> datalist = new List<PJ_wgclcrkd>();
            foreach (DataRow dr in gridtable.Rows)
            {
                PJ_wgclcrkd pc = new PJ_wgclcrkd();
                foreach (DataColumn dc in gridtable.Columns)
                {
                    if (dc.ColumnName.IndexOf("wpjz") < 0 && dc.ColumnName.IndexOf("xh") < 0 && dr[dc.ColumnName].ToString() != string.Empty)
                        pc.GetType().GetProperty(dc.ColumnName).SetValue(pc, dr[dc.ColumnName], null);
                }
                datalist.Add(pc);
            }
            //fys.strType = " and (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //fys.StrSQL = "select distinct ssgc  from PJ_wgclcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

            ExportWGSCTZEdit etdjh = new ExportWGSCTZEdit();
            etdjh.ExportExcel(datalist);
            //}
        }
Exemple #2
0
        private void btView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            //IList<PJ_wgclcrkd> datalist = gridView1.DataSource as IList<PJ_wgclcrkd>;
            if (gridtable == null) return;
            IList<PJ_wgclcrkd> datalist = new List<PJ_wgclcrkd>();
            foreach (DataRow dr in gridtable.Rows)
            {
                PJ_wgclcrkd pc = new PJ_wgclcrkd();
                foreach (DataColumn dc in gridtable.Columns)
                {
                    if (dc.DataType.FullName.IndexOf("wpjz") < 0)
                        pc.GetType().GetProperty(dc.ColumnName).SetValue(pc, dr[dc.ColumnName], null);
                }
                datalist.Add(pc);
            }
            frmProjectSelect fys = new frmProjectSelect();
            //fys.strType = " and (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //fys.StrSQL = "select distinct ssgc  from PJ_wgclcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

                ExportWGSCTZEdit etdjh = new ExportWGSCTZEdit();
                etdjh.ExportExcel(datalist);
            //}
           
           
           
        }