Exemplo n.º 1
0
        public IList<Core.Business.ExternalApp> GetAllExternalApp()
        {
            IList<Core.Business.ExternalApp> externalApplist = new List<Core.Business.ExternalApp>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

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

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.ExternalApp externalApp = new Core.Business.ExternalApp();

                    if (!reader.IsDBNull(0)) externalApp.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) externalApp.Remark = reader.GetString(1);
                    if (!reader.IsDBNull(2)) externalApp.Type = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) externalApp.Status = reader.GetInt32(3);
                    if (!reader.IsDBNull(4)) externalApp.DateCreated = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) externalApp.IsChecked = reader.GetBoolean(5);
                    if (!reader.IsDBNull(6)) externalApp.NestType = reader.GetInt32(6);
                    if (!reader.IsDBNull(7)) externalApp.CreatorId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) externalApp.Name = reader.GetString(8);
                    if (!reader.IsDBNull(9)) externalApp.RouteName = reader.GetString(9);
                    if (!reader.IsDBNull(10)) externalApp.Version = reader.GetString(10);
                    if (!reader.IsDBNull(11)) externalApp.AvatarPath = reader.GetString(11);
                    if (!reader.IsDBNull(12)) externalApp.Credential = reader.GetString(12);
                    if (!reader.IsDBNull(13)) externalApp.Introduction = reader.GetString(13);
                    if (!reader.IsDBNull(14)) externalApp.ContactTel = reader.GetString(14);
                    if (!reader.IsDBNull(15)) externalApp.ContactEmail = reader.GetString(15);

                    externalApp.MarkOld();
                    externalApplist.Add(externalApp);
                }
                reader.Close();
            }
            return externalApplist;
        }
Exemplo n.º 2
0
        public Core.Business.ExternalApp Select(Int64 id)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_ExternalApp_Select_By_Id");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.ExternalApp externalApp = new Core.Business.ExternalApp();

                if (!reader.IsDBNull(0)) externalApp.Id = reader.GetInt64(0);
                if (!reader.IsDBNull(1)) externalApp.Remark = reader.GetString(1);
                if (!reader.IsDBNull(2)) externalApp.Type = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) externalApp.Status = reader.GetInt32(3);
                if (!reader.IsDBNull(4)) externalApp.DateCreated = reader.GetDateTime(4);
                if (!reader.IsDBNull(5)) externalApp.IsChecked = reader.GetBoolean(5);
                if (!reader.IsDBNull(6)) externalApp.NestType = reader.GetInt32(6);
                if (!reader.IsDBNull(7)) externalApp.CreatorId = reader.GetInt64(7);
                if (!reader.IsDBNull(8)) externalApp.Name = reader.GetString(8);
                if (!reader.IsDBNull(9)) externalApp.RouteName = reader.GetString(9);
                if (!reader.IsDBNull(10)) externalApp.Version = reader.GetString(10);
                if (!reader.IsDBNull(11)) externalApp.AvatarPath = reader.GetString(11);
                if (!reader.IsDBNull(12)) externalApp.Credential = reader.GetString(12);
                if (!reader.IsDBNull(13)) externalApp.Introduction = reader.GetString(13);
                if (!reader.IsDBNull(14)) externalApp.ContactTel = reader.GetString(14);
                if (!reader.IsDBNull(15)) externalApp.ContactEmail = reader.GetString(15);

                reader.Close();
                return externalApp;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }