Пример #1
0
 public static void MakeConstructProgressApplyReport(string year, DataTable tb)
 {
     try
     {
         int month;
         for (month = 1; month <= 12; month++)
         {
             tb.Columns.Add("VGMonth" + month.ToString());
         }
         int num2 = ConvertRule.ToInt(year);
         foreach (DataRow row in tb.Rows)
         {
             string     text = ConvertRule.ToString(row["BuildingCode"]);
             EntityData data = ConstructDAO.GetV_ConstructProgressByPBSUnit(ConvertRule.ToString(row["PBSUnitCode"]));
             for (month = 1; month <= 12; month++)
             {
                 string   text3 = "";
                 DateTime time  = new DateTime(num2, month, 1);
                 string   text4 = time.ToString("yyyy-MM-dd");
                 string   text5 = time.AddMonths(1).ToString("yyyy-MM-dd");
                 DataView view  = new DataView(data.CurrentTable, "ReportDate >= '" + text4 + "' and ReportDate < '" + text5 + "'", "ReportDate desc", DataViewRowState.CurrentRows);
                 if (view.Count > 0)
                 {
                     DataRow row2 = view[0].Row;
                     int     num3 = ConvertRule.ToInt(row2["ProgressType"]);
                     text3 = ConvertRule.ToString(row2["VisualProgressName"]);
                     if (num3 == 1)
                     {
                         text3 = text3 + ConvertRule.ToInt(row2["CurrentLayer"]).ToString();
                     }
                 }
                 row["VGMonth" + month.ToString()] = text3;
             }
             data.Dispose();
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }