public IQueryable <CatPartnerModel> GetBy(CatPartnerGroupEnum partnerGroup)
        {
            string group = PlaceTypeEx.GetPartnerGroup(partnerGroup);
            IQueryable <CatPartnerModel> data = Get().Where(x => (x.PartnerGroup ?? "").IndexOf(group ?? "", StringComparison.OrdinalIgnoreCase) >= 0);

            return(data);
        }
        public static string GetPartnerGroup(CatPartnerGroupEnum partnerGroup)
        {
            string result = "";

            switch (partnerGroup)
            {
            case CatPartnerGroupEnum.AGENT:
                result = "AGENT";
                break;

            case CatPartnerGroupEnum.CONSIGNEE:
                result = "CONSIGNEE";
                break;

            case CatPartnerGroupEnum.CUSTOMER:
                result = "CUSTOMER";
                break;

            case CatPartnerGroupEnum.PAYMENTOBJECT:
                result = "PAYMENTOBJECT";
                break;

            case CatPartnerGroupEnum.PETROLSTATION:
                result = "PETROLSTATION";
                break;

            case CatPartnerGroupEnum.SHIPPER:
                result = "SHIPPER";
                break;

            case CatPartnerGroupEnum.SHIPPINGLINE:
                result = "SHIPPINGLINE";
                break;

            case CatPartnerGroupEnum.SUPPLIER:
                result = "SUPPLIER";
                break;

            case CatPartnerGroupEnum.SUPPLIERMATERIAL:
                result = "SUPPLIERMATERIAL";
                break;

            case CatPartnerGroupEnum.CARRIER:
                result = "CARRIER";
                break;

            case CatPartnerGroupEnum.AIRSHIPSUP:
                result = "AIRSHIPSUP";
                break;

            default:
                break;
            }
            return(result);
        }
示例#3
0
        public IActionResult GetBy(CatPartnerGroupEnum partnerGroup)
        {
            var results = catPartnerService.GetBy(partnerGroup);

            return(Ok(results));
        }