Example #1
0
 private CommandDefinition.CommandFormat ReplyCreate(CommandEnum command, BooleanValue isAck, ActionEnum action, byte subAction, byte[] data)
 {
     CommandDefinition.CommandAckStruct /*can't name it command*/ cmd = new CommandDefinition.CommandAckStruct(command, BooleanValue.False, isAck);
     CommandDefinition.ActionStruct /*can't name it action*/ act = new CommandDefinition.ActionStruct(ActionEnum.Response, subAction);
     CommandDefinition.CommandFormat packet = new CommandDefinition.CommandFormat(cmd, act, data);
     return packet;
 }
Example #2
0
        /// <summary>
        /// Display a String for the Enums
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string ToMessage(this ActionEnum value)
        {
            // Default String
            var Message = "None";

            switch (value)
            {
            case ActionEnum.Attack:
                Message = " Attacks ";
                break;

            case ActionEnum.Move:
                Message = " Moves ";
                break;

            case ActionEnum.Ability:
                Message = " Uses Ability ";
                break;

            case ActionEnum.Unknown:
            default:
                break;
            }

            return(Message);
        }
Example #3
0
        public bool UpdateTjcy(ActionEnum action, Xm_Ysxx ysxx, List<Item_File> fileInfos)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(ysxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(ysxx));
                    break;
            }

            //清空项目所有的文件。
            tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode not in ('24','25','26')";
            tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, (int)WorkFlowNode.JunGong);
            sqls.Add(tmpSql);

            //插入基本信息的文件。
            foreach (Item_File fileInfo in fileInfos)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
Example #4
0
        public bool UpdateJsxxData(ActionEnum action, Xm_Jsxx jsxx, List<Item_File> fileInfos)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;
            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(jsxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(jsxx));

                    //清空项目所有的文件。
                    tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}'";
                    tmpSql = string.Format(tmpSql, jsxx.ITEMCODE, (int)WorkFlowNode.JueSuan);
                    sqls.Add(tmpSql);
                    break;
            }

            tmpSql = "update xm_xmxx set JSSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{1}'";
            tmpSql = string.Format(tmpSql, jsxx.SCDASJ, jsxx.ITEMCODE);
            sqls.Add(tmpSql);

            //插入文件。
            foreach (Item_File fileInfo in fileInfos)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
Example #5
0
        //private Item mItem;
        public BattleAction(ActionEnum action, Ability ability)
        {
            /* start BattleAction */

            mAction = action;
            mAbility = ability;
        }
Example #6
0
        protected void Initialise(string connectionId, ActionEnum actionType, string gameId, string user, string parameters)
        {
            // Do any initialisation that is common to all user actions.

            // If there is any failure that only needs to be reported back to the player who attempted the action, notify
            // them by throwing a HubException with an appropriate message. The client treats a HubException as a deliberate
            // means of feeding back details of a mistake that does not affect the game state and the user can rectify.

            // The ProcessAction() method can use the same technique as long as the game state has not changed.

            G                = Game.FindOrCreateGame(gameId); // find our game or create a new one if required
            ActionType       = actionType;
            UserName         = user;
            Parameters       = parameters;
            PlayerIndex      = -1;
            ConnectionId     = connectionId;
            ResponseType     = ActionResponseTypeEnum.PlayerCentricGameState; // Default response type for actions
            ResponseAudience = ActionResponseAudienceEnum.AllPlayers;         // Default audience for action response

            if (G.IsRunningInTestMode())
            {
                ConnectionId = UserName; // Simulate a unique connection id as there won't be a separate connection for each player
            }

            // Ensure name is not blank
            if (this.UserName == "")
            {
                throw new HubException("You tried to " + ActionType.ToString().ToLower() + " but your user name was blank"); // client catches this as part of action method, i.e. no call to separate client method required
            }

            // Check that this connection is not being used by someone with a different user name
            Participant p = G.GetParticipantFromConnection(ConnectionId);

            if (p != null)
            {
                if (p.Name != this.UserName)
                {
                    // This connection is already being used by someone else
                    throw new HubException("You attempted to " + ActionType.ToString().ToLower() + " (as user " + this.UserName + ") from a connection that is already in use by " + p.Name); // client catches this as part of action method, i.e. no call to separate client method required
                }
            }

            // Check player has permission to trigger this action
            PlayerIndex = G.PlayerIndexFromName(user);
            if (!G.ActionIsAvailableToPlayer(ActionType, PlayerIndex))
            {
                throw new HubException("You attempted to " + ActionType.ToString().ToLower() + " (as user " + this.UserName + ") but this option is not available to you at this point"); // client catches this as part of action method, i.e. no call to separate client method required
            }

            if (p == null /* from above */ && PlayerIndex != -1 && G.Participants[PlayerIndex].IsLockedOutFollowingReplay == true)
            {
                // This is a new connection AND the player is currently locked out following a 'replay' action,
                // so do an implicit Rejoin by linking the new connection to the current player
                // (note the game will no longer be in test mode at this stage, so IsRunningInTestMode() will show false even though this is as a result of testing)
                G.Participants[PlayerIndex].NoteConnectionId(this.ConnectionId);
                G.Participants[PlayerIndex].IsLockedOutFollowingReplay = false;
                // Can continue processing the command now
            }
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VideoContext" /> class.
 /// </summary>
 /// <param name="action">The contextual action:  Option descriptions:  * &#x60;Added to&#x60; - An Added To action.  * &#x60;Appearance by&#x60; - An Appearance By action.  * &#x60;Liked by&#x60; - A Liked By action.  * &#x60;Uploaded by&#x60; - An Unloaded By action.  (required).</param>
 /// <param name="resource">The contextual resource: a user, group, or channel representation, or an object of a tag. (required).</param>
 /// <param name="resourceType">The contextual resource type. (required).</param>
 public VideoContext(ActionEnum action = default(ActionEnum), Object resource = default(Object), string resourceType = default(string))
 {
     this.Action = action;
     // to ensure "resource" is required (not null)
     this.Resource = resource ?? throw new ArgumentNullException("resource is a required property for VideoContext and cannot be null");
     // to ensure "resourceType" is required (not null)
     this.ResourceType = resourceType ?? throw new ArgumentNullException("resourceType is a required property for VideoContext and cannot be null");
 }
Example #8
0
 public override void Feedback(ActionEnum action, object item, bool result)
 {
     if (action == ActionEnum.Move && !result)
     {
         // we tried to move and failed... take damage
         ReduceHealth(BumpingDamage);
     }
 }
Example #9
0
 public override void Read(PrimitiveReader reader)
 {
     Action = (ActionEnum)reader.ReadVarint();
     if (!(Action == ActionEnum.PerformRespawn || Action == ActionEnum.RequestStats))
     {
         throw new InvalidPacketException(nameof(Action), Action);
     }
 }
Example #10
0
        /*******************************************************************************************************/

        internal DicParam GroupDic(ActionEnum action)
        {
            var dic = SetDicBase(DC);

            dic.Group       = new List <DicParam>();
            dic.GroupAction = action;
            return(dic);
        }
Example #11
0
 public bool PlayAction(ActionEnum action)
 {
     if (machine != null)
     {
         return(machine.ChangeState(action));
     }
     return(false);
 }
Example #12
0
 public HeroAction GetAction(ActionEnum type)
 {
     if (mActions.ContainsKey(type))
     {
         return(mActions[type]);
     }
     return(null);
 }
Example #13
0
        protected override void Initialize()
        {
            base.Initialize();
            //health = maxHealth;

            action    = ActionEnum.Idle;
            attacking = false;
        }
        Guid CreateButtonPressAction(ActionEnum action, string value = "")
        {
            Guid g = Guid.NewGuid();

            ButtonPressActionDictionary.Add(g, new ButtonPressAction(action, value));

            return(g);
        }
Example #15
0
 public override void ExitState(ActionEnum nextState)
 {
     if (nextState != JUMPING)
     {
         Context.Combo    = 0;
         Context.Dropping = false;
     }
 }
Example #16
0
 public bool Equals(ActionEnum obj)
 {
     if ((object)obj == null)
     {
         return(false);
     }
     return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value));
 }
Example #17
0
 private Data(ActionEnum action, LoginData login = default, Message[] messages = default, ChatInfo[] chats = default, InviteInfo[] invites = default, string token = "-")
 {
     this.Action   = action;
     this.Login    = login;
     this.Messages = messages;
     this.Invites  = invites;
     this.Chats    = chats;
     this.Token    = token;
 }
        public void StartTurn(IHasTurn hasTurn)
        {
            MyActionEnum      = ActionEnum.HasAction;
            MyBonusActionEnum = BonusActionEnum.HasBonusAction;
            MyReactionEnum    = ReactionEnum.HasReaction;


            hasTurn.StartTurn(MyActionEnum, MyBonusActionEnum, MyReactionEnum);
        }
Example #19
0
 public void BlockAction(ActionEnum action)
 {
     switch (action)
     {
     case ActionEnum.Dash:
         canDash = false;
         break;
     }
 }
Example #20
0
 public void UnblockAction(ActionEnum action)
 {
     switch (action)
     {
     case ActionEnum.Dash:
         canDash = true;
         break;
     }
 }
Example #21
0
        private void Process(ActionEnum action, int?userId = null)
        {
            switch (action)
            {
            case ActionEnum.Create:
                var user = Read <User>();
                #region ex
                //var userService
                //    = new UserService(new UserRepository(new BuildingContext()));

                //var assembly = Assembly.LoadFile();
                //var currentAssembly = Assembly.GetExecutingAssembly();
                //var refAssemblies = currentAssembly.GetReferencedAssemblies();

                //var bllAssemblyName =
                //    refAssemblies.FirstOrDefault
                //    (assem => assem.Name == "BLL");

                //var bllAssembly = Assembly.Load(bllAssemblyName);

                //var userServiceType =
                //    bllAssembly.GetType("BLL.Services.UserService");

                //var userService =
                //    (UserService)Activator.CreateInstance(userServiceType);
                #endregion
                userService.Create(user);
                break;

            case ActionEnum.Read:
                var userRead = userService.Read(userId.Value);
                Write(userRead);
                break;

            case ActionEnum.ReadAll:
                var userReadAll = userService.ReadAll();
                WriteAll(userReadAll);
                Console.ReadKey();
                break;

            case ActionEnum.Update:
                break;

            case ActionEnum.Delete:
                var userIdToDelete   = ReadKey <User>();
                var userReadToDelete = userService.Read(userIdToDelete);
                if (userReadToDelete == null)
                {
                    Console.WriteLine("No such User!");
                }
                else
                {
                    userService.Delete(userIdToDelete);
                }
                break;
            }
        }
Example #22
0
        private void Application_Idling(object sender, IdlingEventArgs e)
        {
            // see if there's something for us to do.

            try
            {
                // we want frequent callbacks
                e.SetRaiseWithoutDelay();
                ActionEnum tmpAction = _action;
                _action = ActionEnum.None;

                switch (tmpAction)
                {
                case ActionEnum.ShowElement:
                    performShow();
                    break;

                case ActionEnum.Shutdown:
                    performShutdown();
                    break;

                case ActionEnum.ColorElements:
                    performColor();
                    break;

                case ActionEnum.RemoveColor:
                    removeColor(_uiDoc.ActiveGraphicalView);
                    break;

                case ActionEnum.ResetColors:
                    resetColors();
                    break;

                case ActionEnum.ShowSolid:
                    performShowSolid();
                    break;

                case ActionEnum.ShowMove:
                    performShowMove();
                    break;

                case ActionEnum.ShowRotation:
                    performShowRotate();
                    break;

                case ActionEnum.Select:
                    performSelect();
                    break;
                }
            }
            catch (Exception ex)
            {
                TaskDialog td = new TaskDialog("Error in Revit Fingerprint");
                td.MainContent     = "An unexpected error occurred.";
                td.ExpandedContent = ex.GetType().Name + ": " + ex.Message + " " + ex.StackTrace;
            }
        }
Example #23
0
 /**
  * <summary>
  * Stops the current sound if any
  * </summary>
  */
 private void StopSound()
 {
     if (si != null)
     {
         si.Stop();
         si = null;
         lastActionSound = wo.GetAction();
     }
 }
Example #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CallflowsRecordCall" /> class.
 /// </summary>
 /// <param name="action">Whether to start or stop the recording (required) (default to ActionEnum.Start).</param>
 /// <param name="format">What format to store the recording on disk.</param>
 /// <param name="label">Label to include in the origin of call recording.</param>
 /// <param name="mediaName">the name of media.</param>
 /// <param name="method">HTTP verb to use when sending the recording to the supplied URL (default to MethodEnum.Put).</param>
 /// <param name="origin">How the recording was started - read-only.</param>
 /// <param name="recordMinSec">The minimum length, in seconds, the recording must be to be considered successful. Otherwise it is deleted.</param>
 /// <param name="recordOnAnswer">Whether to delay the recording until the channel is answered (default to false).</param>
 /// <param name="recordOnBridge">Whether to delay the recording until the channel is bridged (default to false).</param>
 /// <param name="recordSampleRate">What sampling rate to use on the recording.</param>
 /// <param name="shouldFollowTransfer">If true, the recording will continue after a transfer on the active leg (default to true).</param>
 /// <param name="skipModule">When set to true this callflow action is skipped, advancing to the wildcard branch (if any).</param>
 /// <param name="timeLimit">Time limit, in seconds, for the recording.</param>
 /// <param name="url">The URL to use when sending the recording for storage.</param>
 public CallflowsRecordCall(ActionEnum action = ActionEnum.Start, FormatEnum?format = default(FormatEnum?), string label = default(string), string mediaName = default(string), MethodEnum?method = MethodEnum.Put, string origin = default(string), int?recordMinSec = default(int?), bool?recordOnAnswer = false, bool?recordOnBridge = false, int?recordSampleRate = default(int?), bool?shouldFollowTransfer = true, bool?skipModule = default(bool?), int?timeLimit = default(int?), string url = default(string))
 {
     // to ensure "action" is required (not null)
     if (action == null)
     {
         throw new InvalidDataException("action is a required property for CallflowsRecordCall and cannot be null");
     }
     else
     {
         this.Action = action;
     }
     this.Format    = format;
     this.Label     = label;
     this.MediaName = mediaName;
     // use default value if no "method" provided
     if (method == null)
     {
         this.Method = MethodEnum.Put;
     }
     else
     {
         this.Method = method;
     }
     this.Origin       = origin;
     this.RecordMinSec = recordMinSec;
     // use default value if no "recordOnAnswer" provided
     if (recordOnAnswer == null)
     {
         this.RecordOnAnswer = false;
     }
     else
     {
         this.RecordOnAnswer = recordOnAnswer;
     }
     // use default value if no "recordOnBridge" provided
     if (recordOnBridge == null)
     {
         this.RecordOnBridge = false;
     }
     else
     {
         this.RecordOnBridge = recordOnBridge;
     }
     this.RecordSampleRate = recordSampleRate;
     // use default value if no "shouldFollowTransfer" provided
     if (shouldFollowTransfer == null)
     {
         this.ShouldFollowTransfer = true;
     }
     else
     {
         this.ShouldFollowTransfer = shouldFollowTransfer;
     }
     this.SkipModule = skipModule;
     this.TimeLimit  = timeLimit;
     this.Url        = url;
 }
Example #25
0
        private void Process(ActionEnum action, string type = null)
        {
            switch (action)
            {
            case ActionEnum.Create:
                var material = Read <Material>();
                #region ex
                //var userService
                //    = new UserService(new UserRepository(new BuildingContext()));

                //var assembly = Assembly.LoadFile();
                //var currentAssembly = Assembly.GetExecutingAssembly();
                //var refAssemblies = currentAssembly.GetReferencedAssemblies();

                //var bllAssemblyName =
                //    refAssemblies.FirstOrDefault
                //    (assem => assem.Name == "BLL");

                //var bllAssembly = Assembly.Load(bllAssemblyName);

                //var userServiceType =
                //    bllAssembly.GetType("BLL.Services.UserService");

                //var userService =
                //    (UserService)Activator.CreateInstance(userServiceType);
                #endregion
                materialService.Create(material);
                break;

            case ActionEnum.Read:
                var materialRead = materialService.Read(int.Parse(type));
                Write(materialRead);
                break;

            case ActionEnum.ReadAll:
                var materialReadAll = materialService.ReadAll();
                WriteAll(materialReadAll);
                Console.ReadKey();
                break;
                //case ActionEnum.Take:
                //    var allUsers = userService.ReadAll();
                //    WriteAll<User>(allUsers);
                //    var readUserId = ReadId();
                //    List<User> listUser = new List<User>();
                //    foreach ( int id in readUserId)
                //    {
                //        listUser.Add(userService.Read(id));
                //    }

                //    var materialTake = Read<Material>();
                //    materialTake = materialService.Take(materialTake, listUser) ;
                //    Write(materialTake);
                //    Console.ReadKey();
                //    break;
            }
        }
Example #26
0
        private void SetActionState(GamePadState state, Buttons button, ActionEnum act)
        {
            bool pressed = IsButtonPressed(state, button);

            if (_buttonState[button] != pressed)
            {
                _buttonState[button] = pressed;
                DoAction(act, pressed);
            }
        }
 public ActionNode(string name, ActionEnum actionEnum, int weight, int compositeWeight, int compositeWeightRangeStart, int compositeWeightRangeEnd, string connectionString)
 {
     this["Name"]                   = name;
     this["ActionEnum"]             = actionEnum;
     this["Weight"]                 = weight;
     this.CompositeWeight           = compositeWeight;
     this.CompositeWeightRangeStart = compositeWeightRangeStart;
     this.CompositeWeightRangeEnd   = compositeWeightRangeEnd;
     this["ConnectionString"]       = connectionString;
 }
Example #28
0
 public RHelper(ActionEnum action, String value, int countDown, String skip)
 {
     this.action        = action;
     this.value         = value;
     this.initCountDown = countDown;
     keyAction          = true;
     _timer             = new Timer();
     _timer.Elapsed    += new ElapsedEventHandler(DisplayTimeEvent);
     _timer.Interval    = 100;
 }
 public InputState(List <KeyMapping> keyMappings, List <AxisMapping> axisMappings)
 {
     this.paused       = false;
     this.keyMappings  = keyMappings;
     this.axisMappings = axisMappings;
     subscribers       = new List <IActionSubscriber>();
     mousePosition     = new Vector2();
     mouseMovement     = new Vector2();
     actionToRemap     = ActionEnum.None;
 }
        private void onRowSelected(object sender, EventArgs e)
        {
            _selectedSolution = null;
            if (dataGridView1.SelectedRows.Count > 0)
            {
                _selectedSolution = dataGridView1.SelectedRows[0].DataBoundItem as Objects.Solution;
            }

            _action = ActionEnum.Show;
        }
Example #31
0
        public async Task <bool> DoAction(ActionEnum input)
        {
            if (Global.GameOptions.DefaultAct == ActionEnum.None)
            {
                return(true);
            }
            var actionOutput = await _myKiritoService.DoAction(input);

            return(actionOutput != null);
        }
Example #32
0
    public bool IsPlaying(ActionEnum type)
    {
        var action = GetCurrentState() as HeroAction;

        if (action != null && action.type == type)
        {
            return(action.IsPlaying());
        }
        return(false);
    }
Example #33
0
        /**
         * <summary>
         * Adds a new sound for a specific action to the bank
         * </summary>
         */
        private void AddNewSound(ActionEnum key, string value)
        {
            int id = AddSoundToBank(soundBank, value);

            if (!sounds.ContainsKey(key))
            {
                sounds.Add(key, new List <int>());
            }
            sounds[key].Add(id);
        }
Example #34
0
        private void SetActionState(KeyboardState state, Keys key, ActionEnum act)
        {
            bool pressed = IsKeyPressed(state, key);

            if (_keyState[key] != pressed)
            {
                _keyState[key] = pressed;
                DoAction(act, pressed);
            }
        }
Example #35
0
 public void Combine(ActionEnum action, Substance secondSubstance) {
     switch (action) {
         case ActionEnum.ADD: state = state + secondSubstance.state; break;
         case ActionEnum.SUB: state = state - secondSubstance.state; break;
         case ActionEnum.XOR: state = state ^ secondSubstance.state; break;
         case ActionEnum.OR: state = state | secondSubstance.state; break;
         case ActionEnum.AND: state = state & secondSubstance.state; break;
         case ActionEnum.NOT: state = ~state; break;
         case ActionEnum.NOP: break;
     }
     state = state & STATE_MASK;
 }
Example #36
0
        public bool UpdateGdxxData(ActionEnum action, Xm_Gdxx gdxx)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(gdxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(gdxx));
                    break;
            }

            tmpSql = "update xm_xmxx set GDSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{1}'";
            tmpSql = string.Format(tmpSql, gdxx.GDSJ, gdxx.ITEMCODE);
            sqls.Add(tmpSql);

            return OracleHelper.ExecuteCommand(sqls);
        }
Example #37
0
 public static Point PointByAction(ActionEnum actionEnum, Point start, Creature[,] cellsMatrix)
 {
     switch (actionEnum)
     {
         case ActionEnum.Die:
         {
             cellsMatrix[start.X, start.Y] = null;
             throw new CreatureIsDeadException(start);
         }
         case ActionEnum.Left:
             return new Point(start.X - 1, start.Y);
         case ActionEnum.Right:
             return new Point(start.X + 1, start.Y);
         case ActionEnum.Up:
             return new Point(start.X, start.Y - 1);
         case ActionEnum.Down:
             return new Point(start.X, start.Y + 1);
         default:
             throw new ArgumentOutOfRangeException(nameof(actionEnum), actionEnum, null);
     }
 }
Example #38
0
 private CommandDefinition.CommandFormat ConstructCommand(CommandEnum command, BooleanValue ackReq, ActionEnum action, byte subAction)
 {
     CommandDefinition.CommandAckStruct cmdAck = new CommandDefinition.CommandAckStruct(command, ackReq, BooleanValue.False);
     CommandDefinition.ActionStruct a = new CommandDefinition.ActionStruct(action, subAction);
     CommandDefinition.CommandFormat cmd = new CommandDefinition.CommandFormat(cmdAck.CommandWithAck, a.ActionAndSubAction);
     return cmd;
 }
Example #39
0
 /**
   <summary>Serializes the specified PDF file.</summary>
   <param name="file">File to serialize.</param>
   <param name="action">Generator.</param>
 */
 private void Serialize(
     File file,
     ActionEnum action
     )
 {
     Serialize(file, action, null);
 }
Example #40
0
        public bool UpdateGcxx(ActionEnum action, Xm_Gcxx gcxx)
        {
            ArrayList sqls = new ArrayList();

            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(gcxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(gcxx));
                    break;
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
Example #41
0
 public GroupActionAttribute(string actionData, ActionEnum action = ActionEnum.Callback)
     : base(actionData,action) {}
Example #42
0
 public SplitChange(ActionEnum action, Split item, int index)
 {
     Action = action;
     Item = item;
     Index = index;
 }
Example #43
0
 private CommandDefinition.CommandFormat CommandMake(CommandEnum commandCode, BooleanValue acknowledgeIsRequested, ActionEnum actionCode, byte subAction)
 {
     CommandDefinition.CommandAckStruct acknowledgement = new CommandDefinition.CommandAckStruct(commandCode, acknowledgeIsRequested, BooleanValue.False);
     CommandDefinition.ActionStruct action = new CommandDefinition.ActionStruct(actionCode, subAction);
     CommandDefinition.CommandFormat returnedCommand = new CommandDefinition.CommandFormat(acknowledgement.CommandWithAck, action.ActionAndSubAction);
     return returnedCommand;
 }
Example #44
0
 private void Apcs_ApcsUpdate(CommandEnum command, ActionEnum action, byte subAction, object data)
 {
     if (command == CommandEnum.PulseWidth && action == ActionEnum.Response)
         _currentPulseWidth = (PulseWidth)PulseWidth.ToObject(typeof(PulseWidth), subAction);
     else if (command == CommandEnum.ScanMode && action == ActionEnum.Response)
         _currentApcsEnergyMode = (ScanEnergyMode)ScanEnergyMode.ToObject(typeof(ScanEnergyMode), subAction);
 }
Example #45
0
        public bool UpdateZtbData(ActionEnum action, Xm_Ss_Ztb_Jbxx ztbJbxx, Xm_Xmdw xmdw, List<Xm_Ss_Ztb_Zbqk> zbqks, List<Xm_Ss_Ztb_Sght> sghts, List<Item_File> fileInfos)
        {
            List<string> sgdwNames = (from record in sghts
                                      select record.CBF).Distinct().ToList();
            List<Xm_Xmdw> sgdws = new List<Xm_Xmdw>();
            foreach (var item in sgdwNames)
            {
                sgdws.Add(new Xm_Xmdw() { ItemCode = ztbJbxx.ItemCode, Type = ItemCompanyType.SG, Name = item });
            }

            ArrayList sqls = new ArrayList();
            string tmpSql;
            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(ztbJbxx));
                    sqls.Add(SqlBuilder.BuildInsertSql(xmdw));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(ztbJbxx));
                    sqls.Add(SqlBuilder.BuildUpdateSql(xmdw));

                    //清空项目所有的文件。
                    tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode in ('16','17','18','19')";
                    tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode, (int)WorkFlowNode.ShiShi);
                    sqls.Add(tmpSql);

                    //清空所有中标情况记录。
                    tmpSql = "delete from xm_ss_ztb_zbqk where itemcode = '{0}'";
                    tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode);
                    sqls.Add(tmpSql);

                    //清空所有施工合同记录。
                    tmpSql = "delete from xm_ss_ztb_sght where itemcode = '{0}'";
                    tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode);
                    sqls.Add(tmpSql);

                    //清空所有施工单位记录。
                    tmpSql = "delete from xm_xmdw where itemcode = '{0}' and TYPE = '{1}'";
                    tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode, (int)ItemCompanyType.SG);
                    sqls.Add(tmpSql);
                    break;
            }

            tmpSql = "update xm_xmxx set KBSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{1}'";
            tmpSql = string.Format(tmpSql, ztbJbxx.KBSJ, ztbJbxx.ItemCode);
            sqls.Add(tmpSql);

            //插入基本信息的文件。
            foreach (Item_File fileInfo in fileInfos)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }
            foreach (var zbqk in zbqks)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(zbqk));
            }
            foreach (var sght in sghts)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(sght));
            }
            foreach (var sgdw in sgdws)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(sgdw));
            }
            return OracleHelper.ExecuteCommand(sqls);
        }
Example #46
0
        public bool UpdateJdData(ActionEnum action, Xm_Ss_Ztb_Jbxx jzxx, List<Xm_Ss_Jdgz_Xmbb> xmybs, List<Xm_Ss_Jdgz_Xmbb> xmjbs, List<Item_File> files)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;
            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(jzxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(jzxx));

                    //清空项目所有的文件。
                    tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode in ('{2}')";
                    tmpSql = string.Format(tmpSql, jzxx.ItemCode, (int)WorkFlowNode.ShiShi, "21");
                    sqls.Add(tmpSql);

                    //清空所有项目报表记录。
                    Dictionary<string, string> xmbbCondition = new Dictionary<string, string>();
                    xmbbCondition.Add("itemcode", jzxx.ItemCode);
                    sqls.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Jdgz_Xmbb>(xmbbCondition));
                    break;
            }

            tmpSql = "update xm_xmxx set KGSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss'),JGSJ = to_date('{1}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{2}'";
            tmpSql = string.Format(tmpSql, jzxx.KGSJ, jzxx.JGSJ, jzxx.ItemCode);
            sqls.Add(tmpSql);

            //插入基本信息的文件。
            foreach (Item_File fileInfo in files)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }
            foreach (var xmbb in xmybs.Union(xmjbs))
            {
                sqls.Add(SqlBuilder.BuildInsertSql(xmbb));
            }
            return OracleHelper.ExecuteCommand(sqls);
        }
Example #47
0
        public bool UpdateBgxxData(Xm_Ss_Bgxx bgxx, ActionEnum gcxxAction, Xm_Gcxx gcxx, Xm_Xmzj xmzjgs, List<Item_File> files)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            sqls.Add(SqlBuilder.BuildUpdateSql(bgxx));

            if (gcxx != null)
            {
                switch (gcxxAction)
                {
                    case ActionEnum.Insert:
                        tmpSql = "delete from xm_gcxx where itemcode = '{0}' and stage = '{1}' and xh >= {2}";
                        tmpSql = string.Format(tmpSql, gcxx.ItemCode, (int)gcxx.Stage, gcxx.Xh);
                        sqls.Add(tmpSql);
                        sqls.Add(SqlBuilder.BuildInsertSql(gcxx));
                        break;
                    case ActionEnum.Update:
                        sqls.Add(SqlBuilder.BuildUpdateSql(gcxx));
                        break;
                }
            }

            if (xmzjgs != null)
            {
                tmpSql = "delete from xm_xmzj where itemcode = '{0}' and stage = '{1}' and xh = '{2}'";
                tmpSql = string.Format(tmpSql, xmzjgs.ItemCode, (int)xmzjgs.Stage, xmzjgs.Xh);
                sqls.Add(tmpSql);
                sqls.Add(SqlBuilder.BuildInsertSql(xmzjgs));

                //清空项目所有的文件。
                tmpSql = "delete from item_file where itemcode = '{0}' and stage = '{1}' and xh = '{2}' and filecode in ('{3}')";
                tmpSql = string.Format(tmpSql, xmzjgs.ItemCode, (int)xmzjgs.Stage, xmzjgs.Xh, (int)FileCode.预算补充文件);
                sqls.Add(tmpSql);

                //插入基本信息的文件。
                foreach (Item_File fileInfo in files)
                {
                    sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
                }
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     SelectedAction = ActionEnum.Cancel;
     Close();
 }
        /// <summary>
        /// Checks action from the player input
        /// </summary>
        /// <param name="time">Elapsed time</param>
        private void CheckActions(GameTime time)
        {
            _lastTrigger += time.ElapsedGameTime.TotalMilliseconds;
            _lastTrigger = Math.Min(_lastTrigger, TriggerDelay);
            if (_lastTrigger < TriggerDelay)
                return;

            InputToAction();
            bool triggered = _currentAction != ActionEnum.None;
            if (!triggered) return;

            switch (_currentAction)
            {
                case ActionEnum.CreateSoldier:
                    CreateSoldier();
                    break;
                case ActionEnum.HitSoldier:
                    HitSoldier();
                    break;
                case ActionEnum.ShieldOn:
                    SwitchShield(true);
                    break;
                case ActionEnum.ShieldOff:
                    SwitchShield(false);
                    break;
                case ActionEnum.PoisonOn:
                    AddPoison();
                    break;
                case ActionEnum.PoisonOff:
                    RemovePoison();
                    break;
            }

            _lastTrigger = 0.0d;
            _currentAction = ActionEnum.None;
        }
Example #50
0
        /// <summary>
        /// Apply desired option on selected frame(s)
        /// </summary>
        /// <param name="actionLabel">
        /// Name of option used to display error message</param>
        /// <param name="actionType">
        /// Type of option referenced by an enumerator </param>
        /// <param name="pickerValue">
        /// Value of picker used for Pixelate and Blur filter</param>
        /// <exception cref="ArgumentException">
        /// Thrown when we have an invalid value of pickerValue</exception>
        /// /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when we have an unknown option [optionType]</exception>
        /// <remarks> 
        /// The purpose of this function is that we can apply 
        /// almost every action/option to the selected frame(s), so if you want to use it
        /// please be sure that the desired action is added to [_actionEnum] Enum.
        /// </remarks>
        private void ApplyActionToFrames(string actionLabel, ActionEnum actionType, float pickerValue = 0, object param = null)
        {
            IList listIndexSelectedFrames;

            this.Invoke((Action)ResetUndoProp);

            int actualFrame = 0;

            this.Invoke((Action)delegate
            { actualFrame = trackBar.Value; });

            #region Apply Action to the Selected Frames

            if (tvFrames.IsFrameSelected(out listIndexSelectedFrames, actualFrame))
            {
                int removedCount = 0;
                bool overwrite = true;

                for (int i = 0; i < listIndexSelectedFrames.Count; i++)
                {
                    var frameIndex = (int)listIndexSelectedFrames[i];
                    var currentFrame = _listFramesEdit[frameIndex - removedCount].From();

                    #region Switch ActionType

                    switch (actionType)
                    {
                        case ActionEnum.Pixelate:
                            currentFrame = ImageUtil.Pixelate(currentFrame,
                                                        new Rectangle(0, 0, currentFrame.Width,
                                                        currentFrame.Height), Convert.ToInt32(pickerValue));
                            break;

                        case ActionEnum.Blur:
                            currentFrame = ImageUtil.Blur(currentFrame,
                                                        new Rectangle(0, 0, currentFrame.Width,
                                                        currentFrame.Height), Convert.ToInt32(pickerValue));
                            break;

                        case ActionEnum.Grayscale:
                            currentFrame =
                                        ImageUtil.Grayscale(currentFrame);
                            break;

                        case ActionEnum.Color:
                            currentFrame =
                                        ImageUtil.Colorize(currentFrame, (Color)param);
                            break;

                        case ActionEnum.Negative:
                            currentFrame =
                                        ImageUtil.Negative(currentFrame);
                            break;

                        case ActionEnum.Sepia:
                            currentFrame =
                                        ImageUtil.SepiaTone(currentFrame);
                            break;

                        case ActionEnum.Border:
                            currentFrame =
                                        ImageUtil.Border(currentFrame, pickerValue, (Color) param);
                            break;
                        case ActionEnum.Delete:
                            #region Delete

                            //index - 1 to delete the right frame.
                            _listFramesEdit.RemoveAt(frameIndex - removedCount);
                            _listDelayEdit.RemoveAt(frameIndex - removedCount);
                            tvFrames.Remove(1);
                            trackBar.Maximum = _listFramesEdit.Count - 1;
                            removedCount++;
                            overwrite = false;

                            #endregion
                            break;

                        case ActionEnum.Speed:
                            #region Speed

                            int value = Convert.ToInt32(_listDelayEdit[frameIndex] * pickerValue);

                            if (value >= 10 && value <= 2500)
                            {
                                _listDelayEdit[frameIndex] = value;
                            }
                            else if (value < 10) //Minimum
                            {
                                _listDelayEdit[frameIndex] = 10;
                            }
                            else if (value > 2500) //Maximum
                            {
                                _listDelayEdit[frameIndex] = 2500;
                            }

                            #endregion
                            break;

                        case ActionEnum.Caption:

                            #region Caption

                            if (param == null) break;

                            currentFrame = _listFramesEdit[frameIndex].From();

                            using (Graphics imgGr = Graphics.FromImage(currentFrame))
                            {
                                var graphPath = new GraphicsPath();

                                var fSt = (int)Settings.Default.fontCaption.Style;
                                var fF = Settings.Default.fontCaption.FontFamily;

                                StringFormat sFr = StringFormat.GenericDefault;

                                #region Horizontal Alignment

                                if (Settings.Default.captionHorizontalAlign == StringAlignment.Near)
                                {
                                    sFr.Alignment = StringAlignment.Near;
                                }
                                else if (Settings.Default.captionHorizontalAlign == StringAlignment.Center)
                                {
                                    sFr.Alignment = StringAlignment.Center;
                                }
                                else
                                {
                                    sFr.Alignment = StringAlignment.Far;
                                }

                                #endregion

                                #region Vertical Alignment

                                if (Settings.Default.captionVerticalAlign == StringAlignment.Near)
                                {
                                    sFr.LineAlignment = StringAlignment.Near;
                                }
                                else if (Settings.Default.captionVerticalAlign == StringAlignment.Center)
                                {
                                    sFr.LineAlignment = StringAlignment.Center;
                                }
                                else
                                {
                                    sFr.LineAlignment = StringAlignment.Far;
                                }

                                #endregion

                                #region Draw the string using a specific sizing type. Percentage of the height or Points

                                if (Settings.Default.fontSizeAsPercentage)
                                {
                                    graphPath.AddString(param.ToString(), fF, fSt, (currentFrame.Height * Settings.Default.fontCaptionPercentage),
                                        new Rectangle(new Point(0, 0), currentFrame.Size), sFr);
                                }
                                else
                                {
                                    graphPath.AddString(param.ToString(), fF, fSt, Settings.Default.fontCaption.Size, new Rectangle(new Point(0, 0), currentFrame.Size), sFr);
                                }

                                #endregion

                                #region Draw the path to the surface

                                if (Settings.Default.captionUseOutline)
                                {
                                    imgGr.DrawPath(new Pen(Settings.Default.captionOutlineColor,
                                            Settings.Default.captionOutlineThick), graphPath);
                                }
                                else
                                {
                                    imgGr.DrawPath(new Pen(Color.Transparent), graphPath);
                                }

                                #endregion

                                #region Fill the path with a solid color or a hatch brush

                                if (Settings.Default.captionUseHatch)
                                {
                                    imgGr.FillPath(new HatchBrush(Settings.Default.captionHatch, Settings.Default.captionHatchColor,
                                            Settings.Default.fontCaptionColor), graphPath);
                                }
                                else
                                {
                                    imgGr.FillPath(new SolidBrush(Settings.Default.fontCaptionColor), graphPath);
                                }

                                #endregion
                            }

                            #endregion
                            break;
                        case ActionEnum.Export:

                            #region Export

                            if (param.Equals(ImageFormat.Png))
                            {
                                currentFrame.Save(actionLabel + " (" + frameIndex + ").png", ImageFormat.Png);
                            }
                            else
                            {
                                currentFrame.Save(actionLabel + " (" + frameIndex + ").jpg", ImageFormat.Jpeg);
                            }

                            #endregion
                            break;
                        case ActionEnum.AddText:

                            #region AddText

                            Brush textBrush = new SolidBrush(Settings.Default.forecolorInsertText);

                            using (var myGraphic = Graphics.FromImage(currentFrame))
                            {
                                //Define the rectangle size by taking in consideration [X] and [Y] of 
                                // [_pointTextPosition] so the text matches the Bitmap l
                                var rectangleSize = new Size(currentFrame.Width - _pointTextPosition.X,
                                    currentFrame.Height - _pointTextPosition.Y);

                                //Insert text in the specified Point
                                myGraphic.DrawString(param.ToString(), Settings.Default.fontInsertText, textBrush, new Rectangle(_pointTextPosition,
                                    rectangleSize), new StringFormat());
                            }

                            #endregion
                            break;
                        case ActionEnum.FlipRotate:

                            currentFrame.RotateFlip((RotateFlipType)param);

                            break;
                        case ActionEnum.FreeDraw:

                            #region FreeDraw

                            using (var graphics = Graphics.FromImage(currentFrame))
                            {
                                graphics.DrawImage((Image)param, 0, 0);
                            }

                            #endregion
                            break;
                        case ActionEnum.Progress:

                            #region Progress

                            using (Graphics imgGr = Graphics.FromImage(currentFrame))
                            {
                                float actualValue = frameIndex + 1;
                                float maxValue = _listFramesEdit.Count;

                                Brush fillBrush = null;

                                #region Pen

                                float thickness = Settings.Default.progressThickAsPercentage ? Settings.Default.progressThickPercentage : Settings.Default.progressThickness;

                                if (Settings.Default.progressUseHatch)
                                {
                                    fillBrush = new HatchBrush(Settings.Default.progressHatch, Settings.Default.progressColor, Color.Transparent);
                                }
                                else
                                {
                                    fillBrush = new SolidBrush(Settings.Default.progressColor);
                                }

                                #endregion

                                #region Position

                                var rectangle = new Rectangle();

                                if (Settings.Default.progressPosition.Equals('T'))
                                {
                                    // 100 * 50 / 100
                                    float width = ((100 * actualValue) / maxValue) / 100;
                                    rectangle = new Rectangle(0, 0, (int)(currentFrame.Size.Width * width), (int)Settings.Default.progressThickness);
                                }
                                else if (Settings.Default.progressPosition.Equals('B'))
                                {
                                    float width = ((100 * actualValue) / maxValue) / 100;
                                    rectangle = new Rectangle(0, (int)(currentFrame.Size.Height - Settings.Default.progressThickness), (int)(currentFrame.Size.Width * width), (int)Settings.Default.progressThickness);
                                }
                                else if (Settings.Default.progressPosition.Equals('L'))
                                {
                                    float height = ((100 * actualValue) / maxValue) / 100;
                                    rectangle = new Rectangle(0, 0, (int)Settings.Default.progressThickness, (int)(currentFrame.Size.Height * height));
                                }
                                else
                                {
                                    float height = ((100 * actualValue) / maxValue) / 100;
                                    rectangle = new Rectangle((int)(currentFrame.Size.Width - Settings.Default.progressThickness), 0, (int)Settings.Default.progressThickness, (int)(currentFrame.Size.Height * height));
                                }

                                imgGr.FillRectangle(fillBrush, rectangle);

                                #endregion
                            }

                            #endregion

                            break;
                    }

                    #endregion

                    if (overwrite)
                    {
                        File.Delete(_listFramesEdit[frameIndex - removedCount]);

                        currentFrame.Save(_listFramesEdit[frameIndex - removedCount]);
                        currentFrame.Dispose();
                    }

                    GC.Collect(1);
                }

                this.Invoke((Action)delegate
                {
                    trackBar_ValueChanged(null, null);

                    //Highlight the node.
                    tvFrames.Focus();
                    tvFrames.SelectedNode =
                        tvFrames.Nodes[_parentNodeLabel].Nodes[trackBar.Value];
                });
            }

            #endregion
        }
        /// <summary>
        /// Converts triggered input to action
        /// </summary>
        private void InputToAction()
        {
            if (IsActionTriggered(Buttons.X, Keys.Enter))
            {
                _currentAction = ActionEnum.CreateSoldier;
                return;
            }

            if (IsActionTriggered(Buttons.A, Keys.Space))
            {
                _currentAction = ActionEnum.HitSoldier;
                return;
            }

            if (IsActionTriggered(Buttons.DPadUp, Keys.Up))
            {
                _currentAction = ActionEnum.ShieldOn;
                return;
            }

            if (IsActionTriggered(Buttons.DPadDown, Keys.Down))
            {
                _currentAction = ActionEnum.ShieldOff;
                return;
            }

            if (IsActionTriggered(Buttons.DPadLeft, Keys.Left))
            {
                _currentAction = ActionEnum.PoisonOff;
                return;
            }

            if (IsActionTriggered(Buttons.DPadRight, Keys.Right))
            {
                _currentAction = ActionEnum.PoisonOn;
            }
        }
Example #52
0
 public CellWorldAction(ActionEnum action)
 {
     this._action = action;
 }
Example #53
0
        private void InitalProvider(IDBNode idbNode, ActionEnum actionEnum, ref IProvider tempProvider)
        {
            string connectString = string.Empty;

            CustomDBProxyConfigManagement customDBProxyConfigManagement = new CustomDBProxyConfigManagement(idbNode.Name, idbNode.GroupType);

            switch (customDBProxyConfigManagement.CurrentDBGroup.GroupTypeEnum)
            {
                case GroupTypeEnum.MSSQLServer:
                    connectString = customDBProxyConfigManagement.GetMSSQLServerConnectionString(actionEnum, idbNode.Name);
                    tempProvider = new SqlProvider(connectString);
                    break;
                case GroupTypeEnum.OracleServer:
                    connectString = customDBProxyConfigManagement.GetOracleServerConnectionString(actionEnum, idbNode.Name);
                    tempProvider = new OrlProvider(connectString);
                    break;
            }
        }
Example #54
0
 /**
   <summary>Serializes the specified PDF file.</summary>
   <param name="file">File to serialize.</param>
   <param name="action">Generator.</param>
   <param name="index">File index.</param>
 */
 private void Serialize(
     File file,
     ActionEnum action,
     int? index
     )
 {
     Serialize(
     file,
     GetType().Name + "_" + action.ToString() + (index.HasValue ? "." + index.Value : ""),
     null,
     action.ToString(),
     "managing document pages",
     action.ToString()
     );
 }
Example #55
0
 protected ActionAttribute(string actionData, ActionEnum action = ActionEnum.Callback)
     : base(50)
 {
     ActionData = actionData;
     Action = action;
 }
Example #56
0
		/////////////////////////////////////////////////////////////////////////////

		public void AssureData( IExtSvcProvider service, string fileName )
		{
			ExecutableName = ExecutableName?.Trim() ?? string.Empty;
			SaveExtension = SaveExtension.AssureLeadingDot();
			if( null == CmdLine ) {
				CmdLine = new List<string> { };
			}


			//
			// Action, ActionEnum
			//
			ActionEnum ae;
			if( Enum.TryParse<ActionEnum>( Action, true, out ae ) ) {
				ActionEnum = ae;
			}
			else {
				service.SendWarning( fileName, $"\"{Action ?? ""}\" is not a valid action name, using \"Default\"", -1, -1 );
			}
		}
Example #57
0
 public FieldConditionAttribute(string fieldOrProperty, object compareTo, bool compareFalse=false, ActionEnum action=ActionEnum.Show,object actionData=null, ActionPositionEnum position=ActionPositionEnum.Below)
     : base(fieldOrProperty,compareTo,compareFalse)
 {
     Action = action;
     ActionData = actionData;
     Position = position;
 }
Example #58
0
 public IDb GetDb(IDBNode idbNode, ActionEnum actionEnum)
 {
     IProvider tempProvider = null;
     InitalProvider(idbNode, actionEnum, ref tempProvider);
     return tempProvider.OpenDb();
 }
Example #59
0
        public bool UpdateJlData(ActionEnum action, Xm_Xmdw xmdw, List<Xm_Ss_Gcjl_Jlry> jlrys, List<Xm_Ss_Gcjl_Jlht> jlhts, List<Item_File> jlhtFiles)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;
            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(xmdw));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(xmdw));

                    //清空项目所有的文件。
                    tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode in ('{2}')";
                    tmpSql = string.Format(tmpSql, xmdw.ItemCode, (int)WorkFlowNode.ShiShi, "20");
                    sqls.Add(tmpSql);

                    Dictionary<string, string> delJlInfoCondition = new Dictionary<string, string>();
                    delJlInfoCondition.Add("itemcode", xmdw.ItemCode);

                    //清空所有监理人员记录。
                    sqls.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Gcjl_Jlry>(delJlInfoCondition));

                    //清空所有监理合同记录。
                    sqls.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Gcjl_Jlht>(delJlInfoCondition));
                    break;
            }

            //插入基本信息的文件。
            foreach (Item_File fileInfo in jlhtFiles)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }
            foreach (var jlry in jlrys)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(jlry));
            }
            foreach (var jlht in jlhts)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(jlht));
            }
            return OracleHelper.ExecuteCommand(sqls);
        }
 private void btnReset_Click(object sender, EventArgs e)
 {
     SelectedAction = (cbDeleteNewFilesAndDirectories.Checked) ? ActionEnum.ResetAndDelete : ActionEnum.Reset;
     Close();
 }