Exemplo n.º 1
0
        public HttpResponseMessage GetMaintenancePrice(string ProductPriceInfoSearchDTO)
        {
            ProductPriceInfoSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <ProductPriceInfoSearchDTO>(ProductPriceInfoSearchDTO);
            ResultDTO <List <ProductPriceInfoResultDTO> > actionresult = new ResultDTO <List <ProductPriceInfoResultDTO> >();

            try
            {
                actionresult.Object       = _IProductServices.GetMaintenancePrice(dto);
                actionresult.SubmitResult = true;
                actionresult.rows         = dto.rows;
                actionresult.page         = dto.page;
                actionresult.Count        = dto.Count;
            }
            catch (Exception ex)
            {
                actionresult.SubmitResult = false;
                actionresult.Message      = ex.Message;
            }

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(actionresult),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 得到试剂产品价格信息
        /// </summary>
        /// <returns></returns>
        public static ResultData <List <ProductPriceModel> > GetReagentPriceList(ProductPriceInfoSearchDTO dto)
        {
            ResultData <List <ProductPriceModel> > result = null;

            result = GetAPI <ResultData <List <ProductPriceModel> > >(WebConfiger.MasterDataServicesUrl + "ReagentPrice?ProductPriceInfoSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));
            int i = 1;

            foreach (var a in result.Object)
            {
                a.Index = i;
                i++;
            }
            return(result);
        }
Exemplo n.º 3
0
        public HttpResponseMessage GetReagentPriceList(string ProductPriceInfoSearchDTO)
        {
            ProductPriceInfoSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <ProductPriceInfoSearchDTO>(ProductPriceInfoSearchDTO);
            ResultDTO <List <ProductPriceInfoResultDTO> > actionresult = new ResultDTO <List <ProductPriceInfoResultDTO> >();

            actionresult.Object       = _IProductServices.GetReagentPriceList(dto);
            actionresult.SubmitResult = true;
            actionresult.Count        = dto.Count;

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(actionresult),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 得到一条维修产品信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static ResultData <ProductPriceModel> GetMaintenancePrice(ProductPriceInfoSearchDTO dto)
        {
            ResultData <ProductPriceModel> result = new ResultData <ProductPriceModel>();

            var resultlist = GetAPI <List <ProductPriceModel> >(WebConfiger.MasterDataServicesUrl + "MaintenancePrice?ProductPriceInfoSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            if (resultlist.Count > 0)
            {
                result.Object       = resultlist.First();
                result.SubmitResult = true;
            }
            else
            {
                result.Message = "此条信息不存在!";
            }

            return(result);
        }