Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="partner"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        public ChartDTO GetProjectChartData(string partner, string fromDate, string toDate)
        {
            //dynamic MyDynamic = new System.Dynamic.ExpandoObject();
            ChartDTO retVal = new ChartDTO();

            try
            {
                DataSet ds = new ProjectDB(Utility.ConfigurationHelper.GPD_Connection).GetProjectChartData(partner, fromDate, toDate);
                if (ds != null && ds.Tables.Count == 1 && ds.Tables[0].Rows.Count > 0)
                {
                    string   tempAppType = "";
                    LinesDTO line        = new LinesDTO();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string appType = dr["APP_TYPE"].ToString();
                        if (appType.ToUpper() != tempAppType)
                        {
                            tempAppType = appType.ToUpper();
                            line        = new LinesDTO();
                            line.Name   = appType;
                            retVal.Lines.Add(line);
                        }
                        line.Dates.Add(((DateTime)dr["C_DATE"]).ToString("yyyy-MM-dd"));
                        line.Values.Add(Convert.ToInt32(dr["P_COUNT"].ToString()));
                    }
                }
            }
            catch (Exception exc)
            {
                log.Error("Unable to get data for project-chart. ERROR: " + exc.ToString());
            }
            return(retVal);
        }
Example #2
0
        private LinesDTO populateDTO()
        {
            LinesDTO oLinesDTO = new LinesDTO();

            oLinesDTO.LeagueName = _oLeagueDTO.LeagueName;
            // ...
            return(oLinesDTO);
        }
Example #3
0
        public void InsertRow()
        {
            List <string> ocValues  = new List <string>();
            LinesDTO      oLinesDTO = populateDTO();

            populate_ocValuesForInsert(ocValues, oLinesDTO);

            //                        TableName  ColNames(csv)  DTO             Insert into DTO Method
            SqlFunctions.DALInsertRow(TableName, TableColumns, ocValues, _ConnectionString);
        }
Example #4
0
 private void populate_ocValuesForInsert(List <string> ocValues, LinesDTO oLinesDTO)
 {
     ocValues.Add(oLinesDTO.LeagueName.ToString());
     ocValues.Add(oLinesDTO.GameDate.ToString());
     ocValues.Add(oLinesDTO.RotNum.ToString());
     ocValues.Add(oLinesDTO.TeamAway.ToString());
     ocValues.Add(oLinesDTO.TeamHome.ToString());
     ocValues.Add(oLinesDTO.Line.ToString());
     ocValues.Add(oLinesDTO.PlayType.ToString());
     ocValues.Add(oLinesDTO.PlayDuration.ToString());
     ocValues.Add(oLinesDTO.CreateDate.ToString());
     ocValues.Add(oLinesDTO.LineSource.ToString());
 }
Example #5
0
        static void populateDTOFromRdr(List <object> ocRows, object oRow, SqlDataReader rdr)
        {
            // Column Updates Procedure
            // 1) Update Table Columns
            // 2) Select 1000, Cut Column names, Insert in Textpad, run Sql Columns macro, Replace {table}Columns with macro Op
            // 3) Use CodeGeneration.xlsm to generate populateBoxScoreValues entries
            // 4) Update CoversBoxScore.PopulateBoxScoresDTO

            LinesDTO oLeagueDTO = (LinesDTO)oRow;

            oLeagueDTO.LeagueName = rdr["LeagueName"].ToString().Trim();
            oLeagueDTO.RotNum     = (int)rdr["RotNum"];
            // DateTime double
            //  oLeagueDTO.MultiYearLeague = (bool)rdr["MultiYearLeague"];
        }
Example #6
0
        public int GetRow(LinesDTO oLinesDTO)
        {
            int rows = SysDAL.DALfunctions.ExecuteSqlQuery(_ConnectionString, getRowSql(), null, oLinesDTO, populateDTOFromRdr);

            return(rows);
        }