using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using Autofac; using Bowin.Common; using EMISOnline.Entities; using System.Linq.Expressions; using System.Data.Entity; using Bowin.Common.Linq.Entity; using EMISOnline.ViewModel; using EMISOnline.DataLogic.SystemDAL; using EMISOnline.Utility.FormValidate; using EMISOnline.Utility; namespace EMISOnline.CommonLogic { public class BaseServices : IBaseServices { public EMISOnline.DataLogic.UnitOfWork UnitOfWork { get; set; } public BaseServices() { } public void SetNewStatus(T entity) { var curUser = EMISOnline.Utility.FormValidate.CustomPrincipal.Current; var curUserID = curUser.UserID; //typeof(T).GetProperty(TableKeyDictionary.GetKeyName(entity)) // .SetValue(entity, Guid.NewGuid(), null); dynamic dyEntity = entity; dyEntity.RecordStatus = (int)SYS_STATUS.USABLE; dyEntity.CreateUserID = curUserID; dyEntity.ModifyUserID = curUserID; dyEntity.ModifyTime = dyEntity.CreateTime = DateTime.Now; } public void SetNewStatus(T entity, int recordStatus) { var curUser = EMISOnline.Utility.FormValidate.CustomPrincipal.Current; var curUserID = curUser.UserID; //typeof(T).GetProperty(TableKeyDictionary.GetKeyName(entity)) // .SetValue(entity, Guid.NewGuid(), null); dynamic dyEntity = entity; dyEntity.RecordStatus = recordStatus; dyEntity.CreateUserID = curUserID; dyEntity.ModifyUserID = curUserID; dyEntity.ModifyTime = dyEntity.CreateTime = DateTime.Now; } public void SetModifyStatus(T entity) { var curUser = EMISOnline.Utility.FormValidate.CustomPrincipal.Current; var curUserID = curUser.UserID; dynamic dyEntity = entity; dyEntity.ModifyUserID = curUserID; dyEntity.ModifyTime = DateTime.Now; } } }