示例#1
0
        /// <summary>
        /// 产业商发布需求
        /// </summary>
        /// <param name="id">0表示执行添加操作</param>
        /// <param name="userid">产业商id</param>
        /// <param name="Type">需求类型编号</param>
        /// <param name="Dates">预期时间</param>
        /// <param name="Address">地址</param>
        /// <param name="DetailAddress">详细地址</param>
        /// <param name="PurchaseWeight">收购区间类型编号</param>
        /// <param name="CommenceWeight">起购重量</param>
        /// <param name="PhoneNumber">手机号</param>
        /// <param name="Remark">摘要</param>
        /// <param name="cropId">农作物Id</param>
        /// <param name="PurchaseStartPrice">预期最低价格</param>
        /// <param name="PurchaseEndPrice">预期最高价格</param>
        /// <param name="?">The ?.</param>
        /// <returns>JsonResult.</returns>
        public string SaveRequirement(DtoSaveRequirement modle)
        {
            SetJsonHeader();
            var content = GetPostParameters();
            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();

            var result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);

            return(result);
        }
示例#2
0
        public string SaveRequirement(DtoSaveRequirement model)//(long id, long userId, int type, int cropId, int acreage, string description, string date,
        //string address, string detailAddress, string PhoneNumber, double ExpectedStartPrice = 0, double ExpectedEndPrice = 0)
        {
            //验证参数
            var validateRes = ValidateParamModel();

            if (validateRes != null)
            {
                return(JsonHelper.ToJsJson(validateRes));
            }

            SetJsonHeader();
            var content = GetPostParameters();
            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();

            var result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);

            //try
            //{
            //    #region 调用E田接口,传订单数据
            //    ResponseResult<T_FARMER_PUBLISHED_DEMAND> farmerrequirement = JsonHelper.FromJsonTo<ResponseResult<T_FARMER_PUBLISHED_DEMAND>>(result);
            //    if (farmerrequirement.IsSuccess == true && farmerrequirement.Entity != null)
            //    {
            //        //干活需求单
            //        if (farmerrequirement.Entity.DemandTypeId != (int)DuPont.Entity.Enum.FarmerDemandType.SellGrain && farmerrequirement.Entity.DemandTypeId != (int)DuPont.Entity.Enum.FarmerDemandType.SellSilage)
            //        {
            //            Task taskasync = new Task(() => ReturnOrderModel(farmerrequirement.Entity));
            //            taskasync.Start();
            //        }
            //    }
            //    #endregion
            //}
            //catch
            //{
            //    return result;
            //}
            return(result);
        }