1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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>(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>(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>(T entity)
- {
- var curUser = EMISOnline.Utility.FormValidate.CustomPrincipal.Current;
- var curUserID = curUser.UserID;
- dynamic dyEntity = entity;
- dyEntity.ModifyUserID = curUserID;
- dyEntity.ModifyTime = DateTime.Now;
- }
- }
- }
|