zoukankan      html  css  js  c++  java
  • Linq代码

            private void getDtModel()
            {
                dtModel = new DataTable();
                List<object[]> arrValue = (from ee in dtSapProcessModel.AsEnumerable()
                                                                     from ff in dtSapProcessElement.AsEnumerable()
                                                                     from gg in dtSapProcessFileNumber.AsEnumerable()
                                                                     where (gg.Field<string>("WorkShop") == sWorkShop
                                                                     && gg.Field<string>("Standard") == sStandard
                                                                     && ee.Field<int>("FK_ElementId") == ff.Field<int>("ID")
                                                                     && gg.Field<int>("FK_ElementID") == ff.Field<int>("ID")
                                                                     && ee.Field<bool>("IsDeleted") == false
                                                                     && ff.Field<bool>("IsDeleted") == false
                                                                     && gg.Field<bool>("IsDeleted") == false)
                                                                     orderby ee.Field<int>("OrderNumber")
                                                                     select new object[]
                                                                     {
                                                                            0,
                                                                            ee.Field<int>("OrderNumber"),
                                                                            ee.Field<string>("ModelName"),
                                                                            ee.Field<string>("Header"),
                                                                            ff.Field<string>("ProcessC"),
                                                                            ff.Field<string>("ProcessE"),
                                                                            gg.Field<string>("FileNumber"),
                                                                            ff.Field<string>("DescriptionC"),
                                                                            ff.Field<string>("DescriptionE"),
                                                                     }
                                                            ).ToList();
                dtModel.Columns.Add("ID", typeof(int));
                dtModel.Columns.Add("OrderNumber", typeof(int));
                dtModel.Columns.Add("ModelName");
                dtModel.Columns.Add("Header");
                dtModel.Columns.Add("ProcessC");
                dtModel.Columns.Add("ProcessE");
                dtModel.Columns.Add("FileNumber");
                dtModel.Columns.Add("DescriptionC");
                dtModel.Columns.Add("DescriptionE");
                foreach (var item in arrValue)
                {
                    dtModel.Rows.Add(item);
                }
            }
  • 相关阅读:
    OO助教总结
    OO2019第四单元作业总结
    OO2019第三单元作业总结
    OO2019第二单元作业
    OO2019第一单元作业总结
    OO第一单元作业总结
    BUAA_OO_2020_Unit4_Summary
    BUAA_OO_2020_Unit3_Summary
    BUAA_OO_2020_Uint2_Summary
    闫金柱-OO第一单元总结
  • 原文地址:https://www.cnblogs.com/swtool/p/5663420.html
Copyright © 2011-2022 走看看