public IList <PersonalMonthlyReportRowDetail> LoadPairableScndcnpValue(decimal PersonId, DateTime Date, ConceptsKeys key) { PairableScndCnpValue PairableScndCnpValue = null; SecondaryConcept ScndCnp = null; PersonalMonthlyReportRowDetail PrsMonthlyRptRowDtl = null; return(NHibernateSession.QueryOver <PairableScndCnpValue>(() => PairableScndCnpValue) .Select(Projections.Property(() => ScndCnp.Name).WithAlias(() => PrsMonthlyRptRowDtl.ScndCnpName), Projections.Property(() => PairableScndCnpValue.FromPairs).WithAlias(() => PrsMonthlyRptRowDtl.Froms), Projections.Property(() => PairableScndCnpValue.ToPairs).WithAlias(() => PrsMonthlyRptRowDtl.Tos), Projections.Property(() => ScndCnp.Color).WithAlias(() => PrsMonthlyRptRowDtl.Color)) .JoinAlias(() => PairableScndCnpValue.Concept, () => ScndCnp) .Where(x => x.Person.ID == PersonId) .And(x => x.FromDate == Date) .And(x => x.ToDate == Date) .And(() => ScndCnp.KeyColumnName == key.ToString()) .TransformUsing(Transformers.AliasToBean <PersonalMonthlyReportRowDetail>()) .List <PersonalMonthlyReportRowDetail>()); }
private IList <TaskFeatures> SetDataPointFeatures_MonthlyOperationGanttChartSchema(IList <TaskFeatures> TaskFeaturesList, string ConceptType, string FromTime, string ToTime, PersonalMonthlyReportRow personalMonthlyReportRow, PersonalMonthlyReportRowDetail personalMonthlyReportRowDetail, Series serie, DataPointCollection dataPointCollection) { TaskFeatures[] TaskFeaturesCol = new TaskFeatures[1024]; int serieIndex = this.GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.Series.GetIndex(serie.Name); int dataPointIndex = dataPointCollection.Count - 1; TaskFeatures taskFeatures = new TaskFeatures(); taskFeatures = new TaskFeatures(); taskFeatures.Key = serie.Name + "%" + dataPointIndex.ToString(); taskFeatures.Name = GetLocalResourceObject(serie.Name) != null?GetLocalResourceObject(serie.Name).ToString() : serie.Name; taskFeatures.Type = ConceptType; taskFeatures.FromTime = FromTime; taskFeatures.ToTime = ToTime; taskFeatures.SerieIndex = serieIndex.ToString(); taskFeatures.DataPointIndex = dataPointIndex.ToString(); taskFeatures.DateKey = personalMonthlyReportRow.ID.ToString(); taskFeatures.DayName = personalMonthlyReportRow.DayName; taskFeatures.Date = personalMonthlyReportRow.Date.Year + "/" + personalMonthlyReportRow.Date.Month + "/" + personalMonthlyReportRow.Date.Day; taskFeatures.UIDate = personalMonthlyReportRow.TheDate; TaskFeaturesList.Add(taskFeatures); dataPointCollection[dataPointIndex].ToolTip = taskFeatures.DayName + " " + taskFeatures.UIDate; dataPointCollection[dataPointIndex].ToolTip += " \n" + taskFeatures.Name; dataPointCollection[dataPointIndex].ToolTip += " \n" + GetLocalResourceObject("From").ToString() + " " + taskFeatures.FromTime; dataPointCollection[dataPointIndex].ToolTip += " \n" + GetLocalResourceObject("To").ToString() + " " + taskFeatures.ToTime; dataPointCollection[dataPointIndex].ToolTip += " \n" + GetLocalResourceObject("ImpureValue").ToString() + " " + personalMonthlyReportRowDetail.ImpureValue; return(TaskFeaturesList); }
private void SetConceptColor_MonthlyOperationGanttChartSchema(PersonalMonthlyReportRowDetail personalMonthlyReportRowDetail, Series serie) { serie.Color = (Color)(new ColorConverter()).ConvertFromString(personalMonthlyReportRowDetail.Color); }
private void Fill_GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema(LoadState LS, decimal PersonnelID, int Year, int Month, string FromDate, string ToDate) { string[] retMessage = new string[4]; IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList = null; IList <TaskFeatures> TaskFeaturesList = new List <TaskFeatures>(); Dictionary <string, Series> AvailableGanttSeriesDic = new Dictionary <string, Series>(); try { this.Clear_DataPointCollection_MonthlyOperationGanttChartSchema(); if (Session["Year_MonthlyOperationGanttChartSchema"] != null) { if ((int)Session["Year_MonthlyOperationGanttChartSchema"] != Year) { Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] = null; } } if (Session["Month_MonthlyOperationGanttChartSchema"] != null) { if ((int)Session["Month_MonthlyOperationGanttChartSchema"] != Month) { Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] = null; } } switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: PersonnelID = BUser.CurrentUser.Person.ID; break; } BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(PersonnelID); if (Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] == null) { PersonnelMonthlyOperationList = MonthlyOperationBusiness.GetPersonGanttChart(Year, Month, FromDate, ToDate).Reverse().ToList(); Session.Add("MonthlyOperationSource_MonthlyOperationGanttChartSchema", PersonnelMonthlyOperationList); Session.Add("Year_MonthlyOperationGanttChartSchema", Year); Session.Add("Month_MonthlyOperationGanttChartSchema", Month); } else { PersonnelMonthlyOperationList = (IList <PersonalMonthlyReportRow>)(Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"]); } this.SetAxisLables_MonthlyOperationGanttChartSchema(MonthlyOperationBusiness, PersonnelMonthlyOperationList.Reverse().ToList()); IList <GanttChartSettingsProxy> GanttChartSettingsProxyList = this.GetGanttChartSettings_MonthlyOperationGanttChartSchema(); for (int i = 1; i <= PersonnelMonthlyOperationList.Count; i++) { foreach (GanttChartSettingsProxy ganttChartSettingsProxyItem in GanttChartSettingsProxyList) { if (ganttChartSettingsProxyItem.ViewState) { string ConceptType = "Pairly" + ganttChartSettingsProxyItem.ConceptTitle; PersonalMonthlyReportRowDetail personalMonthlyReportRowDetail = ((PersonalMonthlyReportRowDetail)(typeof(PersonalMonthlyReportRow).GetProperty(ConceptType).GetValue(PersonnelMonthlyOperationList[i - 1], null))); foreach (IPair pair in personalMonthlyReportRowDetail.Pairs) { if (pair.From != pair.To) { string realFromTime = string.Empty; string realToTime = string.Empty; double FromTime = this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(pair.From, out realFromTime); double ToTime = this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(pair.To, out realToTime); Series serie = GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.Series[ganttChartSettingsProxyItem.ConceptTitle]; serie.Points.AddXY(i, FromTime, ToTime); DataPointCollection dataPointCollection = serie.Points; this.SetConceptColor_MonthlyOperationGanttChartSchema(personalMonthlyReportRowDetail, serie); this.SetDataPointFeatures_MonthlyOperationGanttChartSchema(TaskFeaturesList, ConceptType, realFromTime, realToTime, PersonnelMonthlyOperationList[i - 1], personalMonthlyReportRowDetail, serie, dataPointCollection); if (!AvailableGanttSeriesDic.ContainsKey(ganttChartSettingsProxyItem.ConceptTitle)) { AvailableGanttSeriesDic.Add(ganttChartSettingsProxyItem.ConceptTitle, serie); } } } } } this.SetDataPointFeatures_MonthlyOperationGanttChartSchema(TaskFeaturesList); this.SetAttributes_MonthlyOperationGanttChartSchema(); this.CustomizeGanttLegends_MonthlyOperationGanttChartSchema(AvailableGanttSeriesDic); } this.operationYearMonthProvider.SetOperationYearMonth(Year, Month); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }