Example #1
0
        public ProductSupplierGetRes GetProductSupplierList([FromBody] ProductSupplierGetReq request)
        {
            var response = new ProductSupplierGetRes();

            try
            {
                var result = _productRepository.GetProductSupplierList(request);
                if (result != null && result.SupllierList.Count > 0)
                {
                    response.SupllierList          = result.SupllierList;
                    response.ResponseStatus.Status = "Success";
                }
                else
                {
                    response.ResponseStatus.Status       = "Success";
                    response.ResponseStatus.ErrorMessage = "No Records Found.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
Example #2
0
        public async Task <ProductSupplierGetRes> GetProductSupplierList(ProductSupplierGetReq productSupplierGetReq, string ticket)
        {
            ProductSupplierGetRes productSupplierGetRes = new ProductSupplierGetRes();

            productSupplierGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:GetProductSupplierList"), productSupplierGetReq, typeof(ProductSupplierGetRes), ticket);

            return(productSupplierGetRes);
        }
Example #3
0
        public ProductRangeGetRes GetProductRangeByParam([FromBody] ProductRangeGetReq request)
        {
            var response = new ProductRangeGetRes();

            try
            {
                if (request != null)
                {
                    var result = _productRepository.GetProductRangeByParam(request);
                    if (result != null && result.ProductRangeDetails != null && result.ProductRangeDetails.Count > 0)
                    {
                        response.ResponseStatus.Status = "Success";
                        response.ProductRangeDetails   = result.ProductRangeDetails.ToList();

                        if (result.DefProdRangelist != null && result.DefProdRangelist.Count > 0)
                        {
                            response.DefProdRangelist = result.DefProdRangelist.ToList();
                        }

                        if (!string.IsNullOrEmpty(request.ProductId))
                        {
                            ProductSupplierGetReq objProductSupplierGetReq = new ProductSupplierGetReq {
                                ProductId = request.ProductId
                            };
                            ProductSupplierGetRes objProductSupplierGetRes = _productRepository.GetSupplierDetails(objProductSupplierGetReq);
                            if (objProductSupplierGetRes != null)
                            {
                                response.SupplierId   = objProductSupplierGetRes.SupplierId;
                                response.SupplierName = objProductSupplierGetRes.SupplierName;
                            }
                        }
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Success";
                        response.ResponseStatus.ErrorMessage = "No Records Found.";
                        response.ProductRangeDetails         = new List <ProductRangeDetails>();
                        response.DefProdRangelist            = new List <ProductRangeDetails>();
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Request details can not be null/blank.";
                    response.ProductRangeDetails         = new List <ProductRangeDetails>();
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
                response.ProductRangeDetails         = new List <ProductRangeDetails>();
            }
            response.ProductCatId = request.ProductCatId;
            response.ProductId    = request.ProductId;
            return(response);
        }
Example #4
0
        public PositionGetRoomTypeAndSuppRes GetPositionRoomAndSupplement([FromBody] ProdCategoryRangeGetReq request)
        {
            var response = new PositionGetRoomTypeAndSuppRes();

            try
            {
                if (request != null && request.ProductId.Count > 0)
                {
                    var resultRoom = _productRepository.GetProductCategoryRangeByProductID(request);
                    if (resultRoom != null && resultRoom.Count > 0)
                    {
                        response.ResponseStatus.Status = "Success";
                        response.RoomTypeList          = resultRoom.ToList();

                        var resultDefaultRoom = _productRepository.GetDefaultRoomsFromQuote(request);
                        if (resultDefaultRoom != null && resultDefaultRoom.Count > 0)
                        {
                            response.ResponseStatus.Status = "Success";
                            response.DefaultRoomslist      = resultDefaultRoom.ToList();
                        }
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Success";
                        response.ResponseStatus.ErrorMessage = "No Records Found.";
                    }

                    ProductSupplierGetReq objProductSupplierGetReq = new ProductSupplierGetReq();
                    objProductSupplierGetReq.ProductId = request.ProductId[0];
                    ProductSupplierGetRes objProductSupplierGetRes = _productRepository.GetSupplierDetails(objProductSupplierGetReq);
                    if (objProductSupplierGetRes != null)
                    {
                        response.SupplierId   = objProductSupplierGetRes.SupplierId;
                        response.SupplierName = objProductSupplierGetRes.SupplierName;
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Product Id can not be null/blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
 public IActionResult GetProductSupplierList(string ProductId)
 {
     try
     {
         ProductSupplierGetRes response = new ProductSupplierGetRes();
         ProductSupplierGetReq request  = new ProductSupplierGetReq();
         request.ProductId = ProductId;
         response          = masterProviders.GetProductSupplierList(request, token).Result;
         return(Json(response));
     }
     catch (Exception ex)
     {
         throw;
         return(View());
     }
 }