Exemplo n.º 1
0
        public DataTransfer <PutOutput> Update(PutInput Input)
        {
            DataTransfer <PutOutput> transer             = new DataTransfer <PutOutput>();
            SystemProcess            systemprocessinput  = new SystemProcess();
            SystemProcess            systemprocessoutput = new SystemProcess();
            PutOutput output = new PutOutput();

            systemprocessinput.CopyFrom(Input);
            SystemProcess systemprocess = _iSystemProcessRepository.GetSystemProcess(systemprocessinput.SystemProcessId);

            if (systemprocess != null)
            {
                systemprocessoutput = _iSystemProcessRepository.UpdateSystemProcess(systemprocessinput);
                if (systemprocessoutput != null)
                {
                    output.CopyFrom(systemprocessoutput);
                    transer.IsSuccess = true;
                    transer.Data      = output;
                }
                else
                {
                    transer.IsSuccess = false;
                    transer.Errors    = new string[1];
                    transer.Errors[0] = "Error: Could not update.";
                }
            }
            else
            {
                transer.IsSuccess = false;
                transer.Errors    = new string[1];
                transer.Errors[0] = "Error: Record not found.";
            }
            return(transer);
        }
Exemplo n.º 2
0
        public SystemProcess GetSystemProcessByName(string processName)
        {
            //ISystemProcessService systemProcessService = IoC.Resolve<ISystemProcessService>("SystemProcessService");
            SystemProcessService systemProcessService = new SystemProcessService();
            DataTransfer <ControlPanel.Core.DataTransfer.SystemProcess.GetOutput> dt = systemProcessService.GetSystemProcessByName(processName);

            if (dt != null && dt.IsSuccess)
            {
                SystemProcess process = new SystemProcess();
                process.CopyFrom(dt.Data);
                return(process);
            }
            return(null);
        }