Beispiel #1
0
        public void Update(OABuessOutInputDto input)
        {
            var hours = (input.EndTime.Value - input.StartTime.Value).Hours;

            if (hours < 0)
            {
                throw new UserFriendlyException((int)ErrorCode.CodeValErr, "开始时间不能晚于结束时间。");
            }
            var ret = _oaBuessOutRepository.Get(input.Id.Value);

            ret = input.MapTo(ret);
            _oaBuessOutRepository.Update(ret);
        }
Beispiel #2
0
        public InitWorkFlowOutput Create(OABuessOutInputDto input)
        {
            var model = input.MapTo <OABuessOut>();
            var hours = (model.EndTime.Value - model.StartTime.Value).Hours;

            if (hours < 0)
            {
                throw new UserFriendlyException((int)ErrorCode.CodeValErr, "开始时间不能晚于结束时间。");
            }
            model.Status = 0;
            var ret = _oaBuessOutRepository.Insert(model);

            return(new InitWorkFlowOutput()
            {
                InStanceId = ret.Id.ToString()
            });
        }