Exemplo n.º 1
0
        public Base <object> Add(ExpressInfo model)
        {
            Express entity = new Express();

            //取token值
            TokenReponse repository = new TokenReponse();
            Token        token      = repository.First(model.Token);
            Meta         meta       = new Meta();
            bool         addNote    = true;

            //校验数据

            if (token == null)
            {
                meta.ErrorCode = ErrorCode.LoginError.GetHashCode().ToString();
                meta.ErrorMsg  = EnumHelper.GetDescriptionFromEnumValue(ErrorCode.LoginError);
            }
            else
            {
                entity.UserID      = token.UserId.ToString();
                entity.ExpressName = model.ExpressName;
                entity.ExpressPwd  = model.ExpressPwd;
                entity.Phone       = model.Phone;
                entity.Destination = model.Destination;
                entity.ExpectTime  = model.ExpectTime;
                entity.Money       = Convert.ToDecimal(model.vState);
                entity.Zy          = model.Zy;
                entity.Payway      = Convert.ToInt32(model.Rel);
                addNote            = ExpressService.Add(entity, ref meta);
            }
            Base <object> result = new Base <object>
            {
                Meta = meta,
                Body = addNote
            };

            return(result);
        }
Exemplo n.º 2
0
 public DeliveryInfo(DeliveryType deliverType, long templateId, Express express)
     : this(deliverType, templateId)
 {
     TkDebug.AssertArgumentNull(express, "express", null);
     Expresses.Add(express);
 }