WCF WinCE 中 手机端 非字符串型 datetime,int,decimal,double 等等 传递不到WCF端的解决方案

 [DataContract]
    public class PU_ArrivalVouchs : IPU_ArrivalVouchs
    {
        /// <summary>
        /// 采购到货单子表标识
        /// </summary>		
        [DataMember(IsRequired = true,Order=0)]
        public int? Autoid { get; set; }

        /// <summary>
        /// 采购到货单主表标识
        /// </summary>		
        [DataMember(IsRequired = true)]
        public int? ID { get; set; }

        /// <summary>
        /// 仓库编码
        /// </summary>		
        [DataMember(IsRequired = true)]
        public string cWhCode { get; set; }

        /// <summary>
        /// 存货编码
        /// </summary>		
        [DataMember(IsRequired = true)]
        public string cInvCode { get; set; }

        /// <summary>
        /// 辅计量数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? iNum { get; set; }

        /// <summary>
        /// 数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? iQuantity { get; set; }

        /// <summary>
        /// 采购订单子表标识
        /// </summary>		
        [DataMember(IsRequired = true)]
        public int? iPOsID { get; set; }


        /// <summary>
        /// 开票数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fKPQuantity { get; set; }

        /// <summary>
        /// 实收数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fRealQuantity { get; set; }


        /// <summary>
        /// 关闭人
        /// </summary>		
        [DataMember(IsRequired = true)]
        public string cCloser { get; set; }


        /// <summary>
        /// 是否质检
        /// </summary>		
        [DataMember(IsRequired = true)]
        public int? bGsp { get; set; }

        /// <summary>
        /// 批号
        /// </summary>		
        [DataMember(IsRequired = true)]
        public string cBatch { get; set; }

        ///// <summary>
        ///// dVDate
        ///// </summary>		
        //[DataMember(IsRequired = true)]
        //public DateTime dVDate { get; set; }

        ///// <summary>
        ///// dPDate
        ///// </summary>		
        //[DataMember(IsRequired = true)]
        //public DateTime dPDate { get; set; }


        /// <summary>
        /// 退货数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fthquantity { get; set; }

        /// <summary>
        /// 退货件数
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fthnum { get; set; }

        /// <summary>
        /// 报废数量
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fbfquantity { get; set; }

        /// <summary>
        /// 报废件数
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? fbfnum { get; set; }

        /// <summary>
        /// 已检验件数
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? finchecknum { get; set; }

        //+-----------------------------------------------------------
        //+ Api中必须的字段
        //+-----------------------------------------------------------

        /// <summary>
        /// 税率
        /// </summary>		
        [DataMember(IsRequired = true)]
        public decimal? itaxrate { get; set; }

    }

 

[DataMember(IsRequired = true,Order=0)]
        public int? Autoid { get; set; }
需要在字段前加 [DataMember(IsRequired = true,Order=0)]    IsRequired=true 属性,   Order属性可加可不加,加上去则以该顺序序列化,如果不加则默认以字母为顺序.

加上该属性后,非字符串类型 如:datetime,int,decimal,double 等等 就可以被传递到 WCF端了.

你可能感兴趣的:(DateTime)