//private void DeletePartJob(dynamic dynamicData) //{ // if (dynamicData.ContainsKey("EmpCode") && dynamicData.ContainsKey("IsMainJob")) // { // int pt = Convert.ToInt32(dynamicData.IsMainJob); // if (pt == 1) // { // string empCode = dynamicData.EmpCode; // IEnumerable<dynamic> employees = _dbContext.QueryWhere("Employee", "IsMainJob=0 and EmpCode='" + empCode + "'", null, false, _dbSession); // if (employees.Count() > 0) // { // var dynEmps = employees.ToFapDynamicObjectList("Employee"); // _dbContext.DeleteDynamicDataBatch(dynEmps, _dbSession); // } // } // } //} /// <summary> /// 更新兼职 /// </summary> /// <param name="dynamicData"></param> /// <param name="empCode"></param> //private void UpdatePartJob(dynamic dynamicData, string empCode) //{ // var employees = _dbContext.QueryWhere("Employee", "IsMainJob=0 and EmpCode='" + empCode + "'", null, false, _dbSession); // if (employees.Count() > 0) // { // string[] partJobCols = { "DeptUid", "DeptCode", "EmpPosition", "EmpJob", "IsMainJob", "JobGrade" }; // foreach (var emp in employees) // { // IDictionary<string, object> dataDict = dynamicData as IDictionary<string, object>; // var dynEmployee = dataDict.ToFapDynamicObject("Employee"); // _dbContext.UpdateDynamicData(dynEmployee, _dbSession); // } // } //} /// <summary> /// 同步 /// </summary> /// <param name="dynamicData"></param> /// <param name="oper"></param> private void DataSynchEntity(List <object> list, DataChangeTypeEnum oper) { EventDataTracker tracker = _provider.GetService <EventDataTracker>(); if (tracker != null) { EventData data = new EventData(); data.ChangeDataType = oper.ToString(); data.EntityName = TableName; data.ChangeData = list; tracker.TrackEventData(data); } }
private void DataSynchDynamicObject(object orgDept, DataChangeTypeEnum oper) { EventDataTracker tracker = _provider.GetService <EventDataTracker>(); if (tracker != null) { EventData data = new EventData(); data.ChangeDataType = oper.ToString(); data.EntityName = TableName; List <object> users = new List <object>(); users.Add(orgDept); data.ChangeData = users; tracker.TrackEventData(data); } }
private void DataSynchDynamicObject(FapDynamicObject user, DataChangeTypeEnum oper) { if (user.ContainsKey("UserPassword")) { user.Remove("UserPassword", out _); } EventDataTracker tracker = _provider.GetService <EventDataTracker>(); if (tracker != null) { EventData data = new EventData(); data.ChangeDataType = oper.ToString(); data.EntityName = TableName; List <dynamic> users = new List <dynamic>(); users.Add(user); data.ChangeData = users; tracker.TrackEventData(data); } }
private void DataSynchEntity(object entity, DataChangeTypeEnum oper) { EventDataTracker tracker = _provider.GetService <EventDataTracker>(); if (tracker != null) { EventData data = new EventData(); data.ChangeDataType = oper.ToString(); data.EntityName = TableName; if (entity is FapUser) { List <FapUser> users = new List <FapUser>(); users.Add(entity as FapUser); data.ChangeData = users; } else if (entity is List <FapUser> ) { data.ChangeData = entity as List <FapUser>; } tracker.TrackEventData(data); } }