public static object GetConstructProgressStepFirstKg(string PBSUnitCode) { object obj3; try { object obj2 = DBNull.Value; string visualProgressNotStartInStr = PBSRule.GetVisualProgressNotStartInStr(); ConstructProgressStepStrategyBuilder builder = new ConstructProgressStepStrategyBuilder(); builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.PBSUnitCode, PBSUnitCode)); builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.VisualProgressNotIn, visualProgressNotStartInStr)); builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.StartDateNotNull)); builder.AddOrder("StartDate", true); string queryString = builder.BuildMainQueryString(); QueryAgent agent = new QueryAgent(); agent.SetTopNumber(1); EntityData data = agent.FillEntityData("ConstructProgressStep", queryString); agent.Dispose(); if (data.HasRecord()) { obj2 = data.CurrentRow["StartDate"]; } obj3 = obj2; } catch (Exception exception) { throw exception; } return(obj3); }
public static EntityData GetConstructProgressReportFirstKg(string PBSUnitCode) { EntityData data2; try { string visualProgressNotStartInStr = PBSRule.GetVisualProgressNotStartInStr(); ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder(); builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode)); builder.AddStrategy(new Strategy(ConstructProgressStrategyName.VisualProgressNotIn, visualProgressNotStartInStr)); builder.AddOrder("ReportDate", true); builder.AddOrder("ProgressCode", true); string queryString = builder.BuildQueryViewString(); QueryAgent agent = new QueryAgent(); agent.SetTopNumber(1); EntityData data = agent.FillEntityData("ConstructProgress", queryString); agent.Dispose(); data2 = data; } catch (Exception exception) { throw exception; } return(data2); }