Esempio n. 1
0
        public async Task <ServiceResponse> GetAllAdminProduct(SPInput input, long UserId)
        {
            var spList    = new List <ProductList>();
            int dataCount = 0;
            var sqlParams = new List <SqlParameter>
            {
                new SqlParameter("@PageNo", (input.PageNo + 1)),
                new SqlParameter("@PageSize", input.MaxResultCount),
                new SqlParameter("@SortColumn", input.SortColumn),
                new SqlParameter("@SortDirection", input.Sorting),
                new SqlParameter("@Filter", input.Filter),
                new SqlParameter("@CurrentUserId", UserId),
            };

            var dataset = await _storedProcedureRepository.GetQueryDatatableAsync(StoredProcedureConstants.SP_GetAdminProductList, sqlParams.ToArray());

            spList = _storedProcedureRepository.CreateListFromTable <ProductList>(dataset.Tables[0]);

            if (spList.Count != 0)
            {
                dataCount = spList.FirstOrDefault().TotalRecords;
            }

            return(new ServiceResponse
            {
                status = 1,
                isSuccess = true,
                message = "Product data",
                jsonObj = new { data = spList },
                totalCount = dataCount
            });
        }
Esempio n. 2
0
 public async Task <ServiceResponse> GetProductList(SPInput input, long UserId)
 {
     return(await _productSrvice.GetAllProduct(input, UserId));
 }
Esempio n. 3
0
 public async Task <ServiceResponse> GetProductList(SPInput input, long UserId, bool isAdmin)
 {
     return(await _productSrvice.GetAll(input, UserId, isAdmin));
 }