Beispiel #1
0
        public CommandInfo doCommand(CommandInfo CommandInfo)
        {
            CommandInteraction          cmdInteraction = new CommandInteraction();
            Dictionary <string, string> paras          = new Dictionary <string, string>();

            foreach (Parameter p in CommandInfo.ParameterList)
            {
                paras.Add(p.Name, p.Value);
            }
            cmdInteraction.executeCommand(CommandInfo.CommandName, paras);
            TrackingWorkFlowInteraction twfi = new TrackingWorkFlowInteraction();

            twfi.doCommand(CommandInfo);
            return(CommandInfo);
        }
Beispiel #2
0
        public CommandInfo doCommand(CommandInfo CommandInfo)
        {
            CommandInfo.CommandName = CommandInfo.CommandName.Trim();
            try
            {
                CommandInteraction          cmdInteraction = new CommandInteraction();
                Dictionary <string, string> paras          = new Dictionary <string, string>();
                paras.Add("InstanceId", CommandInfo.InstanceId);
                paras.Add("WFName", CommandInfo.WFName);
                if (CommandInfo.ParameterList != null)
                {
                    foreach (Parameter p in CommandInfo.ParameterList)
                    {
                        paras.Add(p.Name, p.Value);
                    }
                }
                TrackingDataContext tdc = new TrackingDataContext();
                Guid guid = new Guid(CommandInfo.InstanceId);
                IQueryable <CommonResource.Tracking> trackingQuery =
                    from tracking in tdc.Trackings
                    where ((tracking.wfinstanceid == guid))
                    select tracking;
                foreach (CommonResource.Tracking t in trackingQuery)
                {
                    t.lastmodifiedby = AuthenticationHelper.GetCurrentUser();
                }
                //CommonResource.Tracking t = new CommonResource.Tracking();
                //t.wfname = this.WFName;
                //t.bugid = bugId;
                //t.wfinstanceid = new Guid(this.InstanceId);
                //tdc.Trackings.InsertOnSubmit(t);
                tdc.SubmitChanges();

                cmdInteraction.executeCommand(CommandInfo.CommandName, paras); //this is do the real action in extension
                TrackingWorkFlowInteraction twfi = new TrackingWorkFlowInteraction();
                twfi.doCommand(CommandInfo);                                   // this is just trigger the state machine(WF) to do one step
            }
            catch (Exception e)
            {
                throw new WebFaultException <string>(e.ToString(), HttpStatusCode.InternalServerError);
            }
            return(CommandInfo);
        }