Ejemplo n.º 1
0
 public BehaviorState(int behv, StartDel startDel,
                      UpdateDel updateDel, EndDel endDel, string name)
 {
     mBehaviorType      = behv;
     mBehaviorStartDel  = startDel;
     mBehaviorUpdateDel = updateDel;
     mBehaviorEndDel    = endDel;
     //mName = name;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="idFiledName">id的字段名</param>
        /// <param name="ids">ids</param>
        /// <returns></returns>
        public bool Del <R>(string idFiledName, params R[] ids) where R : struct
        {
            if (BeginDel != null)
            {
                BeginDel.Invoke(ids as int[]);
            }
            string            condition = new ConditionHelper().And(idFiledName, ids, CompareType.In).ToString();
            DynamicParameters p         = new DynamicParameters();

            p.Add($"@{idFiledName}", ids);
            if (_provider.Delete(condition, p))
            {
                if (EndDel != null)
                {
                    EndDel.Invoke();
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }