Exemplo n.º 1
0
        public List <WeeklyReport> GetWeeklyReportListByPerson(Guid userId, int startYear, int startMonth, int endYear, int endMonth)
        {
            List <CommandParameter> list = new List <CommandParameter>();

            list.Add(new CommandParameter("@userId", userId));
            list.Add(new CommandParameter("@startYear", startYear));
            list.Add(new CommandParameter("@startMonth", startMonth));
            list.Add(new CommandParameter("@endYear", endYear));
            list.Add(new CommandParameter("@endMonth", endMonth));
            DataSet dataSet = this._dataBase.ExecuteDataSet(CommandType.StoredProcedure, "GetWeeklyReportListByPerson", list, new string[]
            {
                "result"
            });
            List <WeeklyReport> list2 = RelationalMappingUnity.Select <WeeklyReport>(dataSet.Tables[0]);

            if (list2 == null)
            {
                return(null);
            }
            foreach (WeeklyReport current in list2)
            {
                DataRow[] array = dataSet.Tables[1].Select("WeeklyReport = '" + current.Id + "'");
                for (int i = 0; i < array.Length; i++)
                {
                    WeeklyReportItem weeklyReportItem = RelationalMappingUnity.Select <WeeklyReportItem>(array[i]);
                    if (weeklyReportItem != null)
                    {
                        current.ItemList.Add(weeklyReportItem);
                    }
                }
            }
            return(list2);
        }
Exemplo n.º 2
0
        public List <WeeklyReport> GetWeeklyReportListByOrganization(Guid domainId, Guid organizationId, int year, int weekOfYear)
        {
            List <CommandParameter> list = new List <CommandParameter>();

            list.Add(new CommandParameter("@domainId", domainId));
            list.Add(new CommandParameter("@organizationId", organizationId));
            list.Add(new CommandParameter("@year", year));
            list.Add(new CommandParameter("@weekOfYear", weekOfYear));
            DataSet dataSet = this._dataBase.ExecuteDataSet(CommandType.StoredProcedure, "GetWeeklyReportListByOrganization", list, new string[]
            {
                "result"
            });
            List <WeeklyReport> list2 = RelationalMappingUnity.Select <WeeklyReport>(dataSet.Tables[0]);

            if (list2 == null)
            {
                return(null);
            }
            foreach (WeeklyReport current in list2)
            {
                DataRow[] array = dataSet.Tables[1].Select("WeeklyReport = '" + current.Id + "'");
                for (int i = 0; i < array.Length; i++)
                {
                    WeeklyReportItem weeklyReportItem = RelationalMappingUnity.Select <WeeklyReportItem>(array[i]);
                    if (weeklyReportItem != null)
                    {
                        current.ItemList.Add(weeklyReportItem);
                    }
                }
            }
            return(list2);
        }
Exemplo n.º 3
0
        public List <WeeklyReport> GetWeeklyReportListForCheck(Guid domainId, Guid checkerId, int year, int weekOfYear, CheckViewType checkViewType)
        {
            List <CommandParameter> list = new List <CommandParameter>();

            list.Add(new CommandParameter("@domainId", domainId));
            list.Add(new CommandParameter("@checkerId", checkerId));
            list.Add(new CommandParameter("@year", year));
            list.Add(new CommandParameter("@weekOfYear", weekOfYear));
            if (checkViewType == CheckViewType.All)
            {
                list.Add(new CommandParameter("@checked", DBNull.Value));
            }
            else
            {
                list.Add(new CommandParameter("@checked", (int)checkViewType));
            }
            DataSet dataSet = this._dataBase.ExecuteDataSet(CommandType.StoredProcedure, "GetWeeklyReportForCheck", list, new string[]
            {
                "result"
            });
            List <WeeklyReport> list2 = RelationalMappingUnity.Select <WeeklyReport>(dataSet.Tables[0]);

            if (list2 == null)
            {
                return(null);
            }
            foreach (WeeklyReport current in list2)
            {
                DataRow[] array = dataSet.Tables[1].Select("WeeklyReport = '" + current.Id + "'");
                for (int i = 0; i < array.Length; i++)
                {
                    WeeklyReportItem weeklyReportItem = RelationalMappingUnity.Select <WeeklyReportItem>(array[i]);
                    if (weeklyReportItem != null)
                    {
                        current.ItemList.Add(weeklyReportItem);
                    }
                }
            }
            return(list2);
        }