示例#1
0
 protected override void InitLogNeed(Salary t)
 {
     ParaList.Clear();
     ParaList.Add("设置底薪");
     ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
     ParaList.Add(t.Employee.EmployeeNO);
 }
示例#2
0
 private void AddTo(string[] fields, IParable target, ParaList to)
 {
     foreach (string field in fields)
     {
         FieldPair fp = FieldPair.Parse(field)[0];
         ParaList  tp = target.GetParameters();
         if (tp.HasPara(fp.GetFrom()))
         {
             IPara para = tp.Get(fp.GetFrom());
             if (para != null)
             {
                 IPara clone = (IPara)para.Copy();
                 clone.SetName(fp.GetTo());
                 if (@override || !to.HasPara(fp.GetTo()))
                 {
                     to.AddPara(clone);
                 }
                 else
                 {
                     to.AddPara(clone);
                 }
             }
         }
     }
 }
 protected override void InitLogNeed(CardFillRecord t)
 {
     ParaList.Clear();
     ParaList.Add("补卡");
     ParaList.Add(t.Employee.EmployeeNO);
     ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
 }
 protected override void InitLogNeed(BusinessTrip t)
 {
     ParaList.Clear();
     ParaList.Add("出差");
     ParaList.Add(t.Employee.EmployeeNO);
     ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
 }
 protected override void InitLogNeed(Department t)
 {
     ParaList.Clear();
     ParaList.Add("部门");
     ParaList.Add(t.DepartName);
     ParaList.Add(t.DepartNo);
 }
示例#6
0
 protected override void InitLogNeed(Employee t)
 {
     ParaList.Clear();
     ParaList.Add("员工");
     ParaList.Add(t.EmployeeBaseInfo.EmployName);
     ParaList.Add(t.EmployeeNO);
 }
示例#7
0
 protected override void InitLogNeed(ReSignIn t)
 {
     ParaList.Clear();
     ParaList.Add("补签");
     ParaList.Add(t.Employee.EmployeeNO);
     ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
 }
示例#8
0
 protected override void InitLogNeed(OverWork t)
 {
     ParaList.Clear();
     ParaList.Add("加班");
     ParaList.Add(t.Employee.EmployeeNO);
     ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
 }
 protected override void InitLogNeed(OperatingPost t)
 {
     ParaList.Clear();
     ParaList.Add("岗位");
     ParaList.Add(t.OperatingPostNo);
     ParaList.Add(t.OperatingPostName);
 }
示例#10
0
                public Signature(string signature)
                {
                    Regex regex = new Regex(@"^(?<static>!?)(?<type>.+)\.(?<method>.+)\((?<paras>.*)\)$");
                    Match match = regex.Match(signature);

                    if (!match.Success)
                    {
                        throw new FaultInjectionException();
                    }

                    declaringType = new TypeName(match.Groups["type"].Value);
                    method        = new MethodName(match.Groups["method"].Value);
                    if (match.Groups["paras"].Value != string.Empty)
                    {
                        parameters = new ParaList(match.Groups["paras"].Value);
                    }

                    // Is static method?
                    isStatic = (match.Groups["static"].Value != string.Empty);
                    // Is constructor?
                    if (declaringType.arraySuffix == null)
                    {
                        string methodName = method.name.identifier;
                        string className  = declaringType.plainTypeName.className;
                        if (className == methodName)
                        {
                            isConstructor = true;
                        }
                    }
                }
示例#11
0
            public ParaList GetParameters()
            {
                ParaList pl = new ParaList();

                pl.AddPara(new IntPara("a", 1));
                pl.AddPara(new IntPara("b", 1));
                return(pl);
            }
        public override void DoAction(IEventArgs args)
        {
            ParaList target = GetTarget(args);
            object   source = GetSource(args);

            if (fields != null && source != null && target != null)
            {
                foreach (FieldPair fN in FieldPair.Parse(fields))
                {
                    string[] ffs = new string[2];
                    ffs[0] = fN.GetFrom();
                    ffs[1] = fN.GetTo();
                    try
                    {
                        FieldInfo    f    = ReflectionCache.GetField(source, ffs[0].Trim());
                        AbstractPara para = null;
                        string       type = f.GetType().Name.ToLower();
                        if ("long".Equals(type))
                        {
                            para = new LongPara(ffs[1].Trim());
                        }
                        if ("int".Equals(type))
                        {
                            para = new IntPara(ffs[1].Trim());
                        }
                        if ("float".Equals(type))
                        {
                            para = new FloatPara(ffs[1].Trim());
                        }
                        if ("double".Equals(type))
                        {
                            para = new DoublePara(ffs[1].Trim());
                        }
                        if ("string".Equals(type))
                        {
                            para = new StringPara(ffs[1].Trim());
                        }
                        if ("boolean".Equals(type))
                        {
                            para = new BoolPara(ffs[1].Trim());
                        }
                        if (para == null)
                        {
                            throw new GameConfigExpception(ffs[1].Trim() + "'s type '" + type + "' is not supported.");
                        }

                        para.SetValue(f.GetValue(source));

                        target.AddPara(para);
                    }
                    catch (Exception e)
                    {
                        throw new GameConfigExpception(fN + " is not a valid field.\n" + ExceptionUtil.GetExceptionContent(e));
                    }
                }
            }
        }
示例#13
0
        public BaseGameUnit()
        {
            this.paras = new ParaList();
            this.skill = new UnitSkill(this);
            XYZPara xyz = new XYZPara();

            xyz.SetName(POSITION);
            this.paras.AddPara(xyz);
        }
示例#14
0
        public void ParaListTest()
        {
            ParaList paraList = new ParaList("Block ?x, Block ?y, Car ?z");

            Assert.AreEqual("?x", paraList.Vars[0]);
            Assert.AreEqual("?y", paraList.Vars[1]);
            Assert.AreEqual("?z", paraList.Vars[2]);

            Assert.AreEqual("Block", paraList.Types[0]);
            Assert.AreEqual("Block", paraList.Types[1]);
            Assert.AreEqual("Car", paraList.Types[2]);

            Assert.AreEqual("Block ?x, Block ?y, Car ?z", paraList.ToString());
        }
示例#15
0
        public override void DoAction(IEventArgs args)
        {
            ParaList list = args.GetDefault().GetParameters();

            if (list.HasPara("resetpos"))
            {
                resetpos = (int)list.Get("resetpos").GetValue();
                var poss = args.FreeContext.Poss;
                if (!poss.ExsitIndex(TYPE, resetpos))
                {
                    poss.Remove(TYPE, resetpos);
                }
            }
        }
示例#16
0
        public override void DoAction(IEventArgs args)
        {
            if (StringUtil.IsNullOrEmpty(key))
            {
                key = BaseEventArgs.DEFAULT;
            }
            IParable unit = args.GetUnit(key);

            if (unit != null)
            {
                IPara sort = unit.GetParameters().Get(sorter);
                if (sort != null)
                {
                    ParaListSet pls = (ParaListSet)sort;
                    if (action != null)
                    {
                        Iterator <ParaList> it = pls.Iterator();
                        int i = 1;
                        while (it.HasNext())
                        {
                            ParaList pl = it.Next();
                            args.TempUse("element", new SimpleParable(pl));
                            args.GetDefault().GetParameters().TempUse(new IntPara("index", i++));
                            if (condition == null || condition.Meet(args))
                            {
                                if (action != null)
                                {
                                    action.Act(args);
                                }
                                if (FreeUtil.ReplaceBool(remove, args))
                                {
                                    it.Remove();
                                }
                            }
                            args.GetDefault().GetParameters().Resume("index");
                            args.Resume("element");
                        }
                        if (i == 1)
                        {
                            if (noneAction != null)
                            {
                                noneAction.Act(args);
                            }
                        }
                    }
                }
            }
        }
示例#17
0
 private void SetArg(IEventArgs fr, long s)
 {
     foreach (string key in map[s].Keys)
     {
         IParable pa = map[s][key];
         ParaList snapshotParaList = vMap[s][key];
         if (pa != null && snapshotParaList != null)
         {
             foreach (string field in snapshotParaList.GetFields())
             {
                 pa.GetParameters().TempUse(snapshotParaList.Get(field));
             }
         }
         fr.TempUse(key, pa);
     }
 }
示例#18
0
 private void ResumeArg(IEventArgs fr, long s)
 {
     foreach (string key in map[s].Keys)
     {
         fr.Resume(key);
         IParable pa = map[s][key];
         ParaList snapshotParaList = vMap[s][key];
         if (pa != null && snapshotParaList != null)
         {
             foreach (string field in snapshotParaList.GetFields())
             {
                 pa.GetParameters().Resume(field);
             }
         }
     }
 }
示例#19
0
 protected override void InitLogNeed(EmployeePostAdjust t)
 {
     ParaList.Clear();
     ParaList.Add("岗位调整 for");
     if (t.PrevOperatingPost != null)
     {
         ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName);
     }
     ParaList.Add("原岗位");
     if (t.PrevOperatingPost != null)
     {
         ParaList.Add(t.PrevOperatingPost.OperatingPostName);
     }
     ParaList.Add("现岗位");
     ParaList.Add(t.CurOperatingPost.OperatingPostName);
 }
示例#20
0
 public bool UpDataEntity()
 {
     try
     {
         var effect = Factory.Update();
         ParaList.Add(effect.ToString());
         WriteLog("更新成功,更新记录");
         StatusConsole.WriteLine("已更新记录");
         return(true);
     }
     catch (Exception e)
     {
         WriteLogFalse("更新失败", e);
         StatusConsole.WriteLine("更新失败");
         return(false);
     }
 }
示例#21
0
 protected override void InitLogNeed(Couple t)
 {
     ParaList.Clear();
     ParaList.Add("添加夫妻关系");
 }
 protected override void InitLogNeed(VacationPlan t)
 {
     ParaList.Add("节假日方案");
     ParaList.Add(t.PlanName);
 }
示例#23
0
 protected override void InitLogNeed(WageDetail t)
 {
     ParaList.Clear();
     ParaList.Add("薪资更新");
 }
示例#24
0
 protected override void InitLogNeed(AttendanceResult t)
 {
     ParaList.Clear();
     ParaList.Add("考勤分析结果");
 }
示例#25
0
 protected override void InitLogNeed(Dormitory t)
 {
     ParaList.Clear();
     ParaList.Add("宿舍");
     ParaList.Add(t.DormitoryNo);
 }
示例#26
0
 protected override void InitLogNeed(TiaoXiu t)
 {
     ParaList.Clear();
     ParaList.Add("调休管理");
     ParaList.Add(t.TiaoXiuNo);
 }
示例#27
0
        public virtual IPara GetPara(IEventArgs args)
        {
            IParable parable = args.GetUnit(unit);

            if (parable != null)
            {
                ParaList pl = args.GetUnit(unit).GetParameters();
                if (pl.HasPara(para))
                {
                    return(pl.Get(para));
                }
                else
                {
                    bool     has  = (para.IndexOf('[') > -1);
                    bool     has2 = (para.IndexOf(']') > -1);
                    string[] vs   = Split(GetPara(), 1);

                    if (has && has2)
                    {
                        vs = new string[] { para };
                    }
                    if (vs.Length != 4)
                    {
                        if (has && has2 && para.Contains("[@") && para.Contains("']/@")) /* ¼õÉÙContainsµ÷ÓÃ */
                        {
                            vs = Split(GetPara(), 2);
                        }
                    }
                    if (vs.Length == 4)
                    {
                        IPara p = pl.Get(vs[0].Trim());
                        if (p != null && p is ParaListSet)
                        {
                            ParaListSet pls = (ParaListSet)p;
                            ParaList    sub = pls.GetParaList(vs[1].Trim(), vs[2].Trim(), args);
                            if (sub != null && sub.HasPara(vs[3].Trim()))
                            {
                                return(sub.Get(vs[3].Trim()));
                            }
                        }
                    }
                    else
                    {
                        if (has && has2)
                        {
                            vs = Split(para, 3);
                            if (vs.Length == 3 && StringUtil.IsNullOrEmpty(vs[2]))
                            {
                                IPara p = pl.Get(vs[0].Trim());
                                if (p != null && (p is MapPara || p is StringPara))
                                {
                                    if (p is MapPara)
                                    {
                                        MapPara mp = (MapPara)p;
                                        if (vs[1].Trim().Equals("length"))
                                        {
                                            return(new IntPara(p.GetName(), mp.Size()));
                                        }
                                        return(mp.GetValue(vs[1].Trim()));
                                    }
                                    if (p is StringPara)
                                    {
                                        if ("length".Equals(vs[1].Trim()))
                                        {
                                            return(new IntPara(p.GetName(), p.GetValue().ToString().Length));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return(null);
            }
            else
            {
                throw new GameConfigExpception("unit " + unit + " is not existed.\n" + GetUnit() + "." + GetPara());
            }
        }
示例#28
0
 protected override void InitLogNeed(AskLeave t)
 {
     ParaList.Clear();
     ParaList.Add("请假单");
 }
示例#29
0
 protected override void InitLogNeed(SystemRole t)
 {
     ParaList.Clear();
     ParaList.Add("系统角色");
     ParaList.Add(t.Name);
 }
示例#30
0
 protected override void InitLogNeed(SystemArgument t)
 {
     ParaList.Clear();
     ParaList.Add("参数");
     ParaList.Add(t.ArguValue);
 }