コード例 #1
0
 internal static async Task <List <Tables.dbo.Work> > List(string site)
 {
     await using var cmd = new SqlCommand("[dbo].[GetWorks]", new Base().SqlConnection)
                 {
                     CommandType = CommandType.StoredProcedure
                 };
     cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value = site;
     using var sda = new SqlDataAdapter(cmd);
     return(Object.GetList <Tables.dbo.Work>(sda));
 }
コード例 #2
0
        internal static async Task <Tables.dbo.Subscriber> Item(Guid id)
        {
            await using var cmd = new SqlCommand("[dbo].[GetSubscriber]", new Base().SqlConnection)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

            cmd.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = id;
            using var sda = new SqlDataAdapter(cmd);
            return(Object.GetItem <Tables.dbo.Subscriber>(sda));
        }
コード例 #3
0
        internal static async Task <List <Tables.dbo.Subscriber> > List(string site, int areaId)
        {
            await using var cmd = new SqlCommand("[dbo].[GetSubscribersForSiteAreaId]", new Base().SqlConnection)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

            cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value = site;
            cmd.Parameters.Add("@AreaId", SqlDbType.Int).Value        = areaId;
            using var sda = new SqlDataAdapter(cmd);
            return(Object.GetList <Tables.dbo.Subscriber>(sda));
        }
コード例 #4
0
 internal static async Task <List <Tables.dbo.Work> > ListWithTestimonials(string site, int pageIndex, int pageSize)
 {
     await using var cmd = new SqlCommand("[dbo].[GetWorksPagingWithTestimonials]", new Base().SqlConnection)
                 {
                     CommandType = CommandType.StoredProcedure
                 };
     cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value = site;
     cmd.Parameters.Add("@PageIndex", SqlDbType.Int).Value     = pageIndex;
     cmd.Parameters.Add("@PageSize", SqlDbType.Int).Value      = pageSize;
     using var sda = new SqlDataAdapter(cmd);
     return(Object.GetList <Tables.dbo.Work>(sda));
 }
コード例 #5
0
        internal static async Task <Tables.dbo.Subscriber> Item(string site, int areaId, string emailAddress)
        {
            await using var cmd = new SqlCommand("[dbo].[GetSubscriberForSiteAreaIdEmailAddress]", new Base().SqlConnection)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

            cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value          = site;
            cmd.Parameters.Add("@AreaId", SqlDbType.Int, 25).Value             = areaId;
            cmd.Parameters.Add("@EmailAddress", SqlDbType.NVarChar, 255).Value = emailAddress;
            using var sda = new SqlDataAdapter(cmd);
            return(Object.GetItem <Tables.dbo.Subscriber>(sda));
        }
コード例 #6
0
        internal static async Task <Tables.dbo.Work> Item(string site, string title, string authors)
        {
            await using var cmd = new SqlCommand("[dbo].[GetWorkBySiteTitleAuthors]", new Base().SqlConnection)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

            cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value     = site;
            cmd.Parameters.Add("@Title", SqlDbType.NVarChar, 100).Value   = title;
            cmd.Parameters.Add("@Authors", SqlDbType.NVarChar, 255).Value = authors;
            using var sda = new SqlDataAdapter(cmd);
            return(Object.GetItem <Tables.dbo.Work>(sda));
        }