コード例 #1
0
        public ProdCatDefGetRes GetProdCatDefByName([FromBody] ProdCatDefGetReq request)
        {
            var response = new ProdCatDefGetRes();

            try
            {
                if (request != null)
                {
                    var result = _productRepository.GetProdCatDefByName(request);
                    if (result != null && result.Count > 0)
                    {
                        response.ResponseStatus.Status = "Success";
                        response.ProdCatDefProperties  = result;
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Success";
                        response.ResponseStatus.ErrorMessage = "No Records Found.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Request can not be null.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
コード例 #2
0
ファイル: MasterProviders.cs プロジェクト: dilip07156/CoreUI
        public async Task <ProdCatDefGetRes> GetProdCatDefByName(ProdCatDefGetReq prodCatDefGetReq, string ticket)
        {
            ProdCatDefGetRes prodCatDefGetRes = new ProdCatDefGetRes();

            prodCatDefGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:ServiceGetProdCatDefByName"), prodCatDefGetReq, typeof(ProdCatDefGetRes), ticket);

            return(prodCatDefGetRes);
        }
コード例 #3
0
        public JsonResult GetHotelCategory(string term)
        {
            //List<AgentName> agentList = objAgentResponse.AgentProperties.Select(data => new AgentName { value = data.VoyagerCompany_Id, label = data.Name }).ToList();

            if (term.Length >= 3 && term.Substring(0, 3) == "###")
            {
                term = "";
            }
            ProdCatDefGetReq objProdCatDefGetReq = new ProdCatDefGetReq {
                Name = term
            };
            MasterProviders            objMasterProviders    = new MasterProviders(_configuration);
            ProdCatDefGetRes           objMasterTypeResponse = objMasterProviders.GetProdCatDefByName(objProdCatDefGetReq, token).Result;
            List <AutoCompleteTextBox> CatList = objMasterTypeResponse.ProdCatDefProperties.Select(data => new AutoCompleteTextBox {
                value = data.VoyagerDefProductCategoryId, label = data.Name
            }).ToList();

            return(Json(CatList));
        }