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

            if (gridtable == null) return;
            IList<PJ_clcrkd> datalist = new List<PJ_clcrkd>();
            foreach (DataRow dr in gridtable.Rows)
            {
                PJ_clcrkd pc = new PJ_clcrkd();
                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_clcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

            ExportCJSCTZEdit etdjh = new ExportCJSCTZEdit();
            etdjh.ExportExcel(datalist);
            //}
        }
Beispiel #2
0
        private void btView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            //IList<PJ_clcrkd> datalist = gridView1.DataSource as IList<PJ_clcrkd>;
            IList<PJ_clcrkd> datalist =new List<PJ_clcrkd>();
            foreach(DataRow dr in gridtable.Rows)
            {
                PJ_clcrkd pc =new  PJ_clcrkd ();
                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_clcrkd where  (type = '工程材料入库单' or type = '工程材料入库单原始库存') ";
            //if (fys.ShowDialog() == DialogResult.OK)
            //{

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