Exemplo n.º 1
0
        public IList<Core.Business.StimulationType> GetAllStimulationType()
        {
            IList<Core.Business.StimulationType> stimulationTypelist = new List<Core.Business.StimulationType>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectStimulationTypesAll");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.StimulationType stimulationType = new Core.Business.StimulationType();

                    if (!reader.IsDBNull(0)) stimulationType.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) stimulationType.StimulationId = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) stimulationType.StimulatedType = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) stimulationType.State = reader.GetInt32(3);
                    if (!reader.IsDBNull(4)) stimulationType.ApplyingEndDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) stimulationType.FirstChenEndDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) stimulationType.SecondCheckEndDate = reader.GetDateTime(6);
                    if (!reader.IsDBNull(7)) stimulationType.ExpertCheckEndDate = reader.GetDateTime(7);
                    if (!reader.IsDBNull(8)) stimulationType.Des = reader.GetString(8);
                    stimulationType.MarkOld();
                    stimulationTypelist.Add(stimulationType);
                }
                reader.Close();
            }
            return stimulationTypelist;
        }
Exemplo n.º 2
0
        public List<StimulationType> SelectStimulationTypesByStimulationId(Guid guid)
        {
            if (guid == System.Guid.Empty)
                return null;

            List<Core.Business.StimulationType> stimulationTypelist = new List<Core.Business.StimulationType>();

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@StimulationId", SqlDbType.UniqueIdentifier, guid);

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectStimulationTypesByStimulationId");

            if (reader != null&&!reader.IsClosed)
            {
                while (reader.Read())
                {
                    Core.Business.StimulationType stimulationType = new Core.Business.StimulationType();

                    if (!reader.IsDBNull(0)) stimulationType.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) stimulationType.StimulationId = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) stimulationType.StimulatedType = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) stimulationType.State = reader.GetInt32(3);
                    if (!reader.IsDBNull(4)) stimulationType.ApplyingEndDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) stimulationType.FirstChenEndDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) stimulationType.SecondCheckEndDate = reader.GetDateTime(6);
                    if (!reader.IsDBNull(7)) stimulationType.ExpertCheckEndDate = reader.GetDateTime(7);
                    if (!reader.IsDBNull(8)) stimulationType.Des = reader.GetString(8);
                    stimulationType.MarkOld();
                    stimulationTypelist.Add(stimulationType);
                }
                reader.Close();
            }
            return stimulationTypelist;
        }