public ApiResult <AutoPreview> Preview([FromQuery] PreviewInput parameter)
        {
            if (!this.IsFormValid())
            {
                return(ApiResult.Failure <AutoPreview>(this.FormInvalidReason(),
                                                       MessageCodes.ParameterValidationFailure));
            }

            var userOutPut = Resolve <IUserDetailService>().GetUserOutput(parameter.Id.ConvertToLong());

            if (userOutPut == null)
            {
                return(ApiResult.Failure <AutoPreview>("用户不存在或者已经删除!"));
            }

            //if (!(userOutPut.ParentId == parameter.LoginUserId || userOutPut.Id == parameter.LoginUserId)) {
            //    return ApiResult.Failure<List<KeyValue>>("对不起您无权查看!");
            //}
            //var result = userOutPut.ToKeyValues();

            return(ApiResult.Success(new AutoPreview
            {
                KeyValues = userOutPut.ToKeyValues()
            }));
        }
Exemple #2
0
 public FieldBox()
 {
     InitializeComponent();
     fieldBox.TextChanged      += (s, e) => TextChanged?.Invoke(s, e);
     fieldBox.PreviewTextInput += (s, e) => PreviewInput?.Invoke(s, e);
     fieldBox.LostFocus        += (s, e) => InputLostFocus?.Invoke(s, e);
 }
Exemple #3
0
        public ApiResult BillView([FromQuery] PreviewInput parameter)
        {
            var view = Resolve <IFinanceAdminService>().GetViewBillSingle(parameter.Id.ConvertToLong());

            if (view == null)
            {
                return(ApiResult.Failure("账单不存在或者已经删除!"));
            }

            if (view.Bill.UserId != parameter.LoginUserId)
            {
                return(ApiResult.Failure("您无权查看该账单!"));
            }

            var apiOutput = Resolve <IFinanceAdminService>().GetBillOutput(view);
            var temp      = apiOutput.ToKeyValues();

            return(ApiResult.Success(temp));
        }
        public ApiResult <List <KeyValue> > Preview([FromQuery] PreviewInput parameter)
        {
            if (!this.IsFormValid())
            {
                return(ApiResult.Failure <List <KeyValue> >(this.FormInvalidReason(),
                                                            MessageCodes.ParameterValidationFailure));
            }

            var view = Resolve <IRewardService>().GetRewardView(parameter.Id.ConvertToLong());

            if (view == null)
            {
                return(ApiResult.Failure <List <KeyValue> >("该分润记录不存在!"));
            }
            //var result = view.Reward.ToKeyValues();
            var result = AutoMapping.SetValue <RewardPriviewOutput>(view.Reward);

            result.MoneyTypeName = view.MoneyTypeName;
            //result.StatusName = view.Status.GetDisplayName();
            result.OrderUserName = view.OrderUser.UserName;

            return(ApiResult.Success(result.ToKeyValues()));
        }