protected override void InitLogNeed(Salary t) { ParaList.Clear(); ParaList.Add("设置底薪"); ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName); ParaList.Add(t.Employee.EmployeeNO); }
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); }
protected override void InitLogNeed(Employee t) { ParaList.Clear(); ParaList.Add("员工"); ParaList.Add(t.EmployeeBaseInfo.EmployName); ParaList.Add(t.EmployeeNO); }
protected override void InitLogNeed(ReSignIn t) { ParaList.Clear(); ParaList.Add("补签"); ParaList.Add(t.Employee.EmployeeNO); ParaList.Add(t.Employee.EmployeeBaseInfo.EmployName); }
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); }
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; } } }
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)); } } } }
public BaseGameUnit() { this.paras = new ParaList(); this.skill = new UnitSkill(this); XYZPara xyz = new XYZPara(); xyz.SetName(POSITION); this.paras.AddPara(xyz); }
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()); }
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); } } }
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); } } } } } }
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); } }
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); } } } }
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); }
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); } }
protected override void InitLogNeed(Couple t) { ParaList.Clear(); ParaList.Add("添加夫妻关系"); }
protected override void InitLogNeed(VacationPlan t) { ParaList.Add("节假日方案"); ParaList.Add(t.PlanName); }
protected override void InitLogNeed(WageDetail t) { ParaList.Clear(); ParaList.Add("薪资更新"); }
protected override void InitLogNeed(AttendanceResult t) { ParaList.Clear(); ParaList.Add("考勤分析结果"); }
protected override void InitLogNeed(Dormitory t) { ParaList.Clear(); ParaList.Add("宿舍"); ParaList.Add(t.DormitoryNo); }
protected override void InitLogNeed(TiaoXiu t) { ParaList.Clear(); ParaList.Add("调休管理"); ParaList.Add(t.TiaoXiuNo); }
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()); } }
protected override void InitLogNeed(AskLeave t) { ParaList.Clear(); ParaList.Add("请假单"); }
protected override void InitLogNeed(SystemRole t) { ParaList.Clear(); ParaList.Add("系统角色"); ParaList.Add(t.Name); }
protected override void InitLogNeed(SystemArgument t) { ParaList.Clear(); ParaList.Add("参数"); ParaList.Add(t.ArguValue); }