Beispiel #1
0
        private void ChangeModule(ChangeModule obj)
        {
            switch(obj.SetModule)
            {
                case ModuleName.Log:
                    Output.Add("Log module called");
                    break;

                case ModuleName.ModuleA:
                    Output.Add("ModuleA called");
                    break;

                case ModuleName.ModuleB:
                    Output.Add("ModuleB called");
                    break;

                case ModuleName.ModuleC:
                    Output.Add("ModuleC called");
                    break;

                case ModuleName.ModuleD:
                    Output.Add("ModuleD called");
                    break;
            }
        }
Beispiel #2
0
        // DELETE: api/Module/5 delete module

        public async Task <HandleResult> Delete(string id)
        {
            var command = new ChangeModule(id, (int)UseFlag.Disabled);
            var result  = await ExecuteCommandAsync(command);

            if (result.IsSuccess())
            {
                return(HandleResult.FromSuccess("删除成功"));
            }
            return(HandleResult.FromFail(result.GetErrorMessage()));
        }
Beispiel #3
0
 /// <summary>删除模块
 /// </summary>
 public void Handle(ICommandContext context, ChangeModule command)
 {
     context.Get <Module>(command.AggregateRootId).Change(command.UseFlag);
 }