//public FinancialRecordViewModel(YuShang.ERP.Entities.Finances.IAccountsRecord record, // PrivilegeFramework.ExtendedIdentityDbContext db) //{ // this.m_record = record; //} public FinancialRecordViewModel(IAccountsRecord accountsRecord, //IEnumerable<AccountsRecordRelation> relations, YuShang.ERP.Entities.Privileges.SysUser sysUser) { this.m_record = accountsRecord; //this.relations = relations; this.sysUser = sysUser; //if (this.relations == null || relations.Count() < 1) //{ // this.EventType = AccountingEventType.Others; //} //else //{ // var tmp = from one in this.relations // where one.RelatedObjectType == FinancialRelatedObjectType.AccountsPayRecord_To_AccountsPayable // || one.RelatedObjectType == FinancialRelatedObjectType.AccountsReceiveRecord_To_AccountsReceivable // select one; // if (tmp == null || tmp.Count() < 1) // this.EventType = AccountingEventType.Others; // else // { // var tmp2 = tmp.First(); // if (tmp2.RelatedObjectType == FinancialRelatedObjectType.AccountsPayRecord_To_AccountsPayable) // this.EventType = db.AccountsPayables.Find(tmp2.RelatedObjectId).EventType; // else if (tmp2.RelatedObjectType == FinancialRelatedObjectType.AccountsReceiveRecord_To_AccountsReceivable) // { // this.EventType = db.AccountsReceivables.Find(tmp2.RelatedObjectId).EventType; // } // else this.EventType = AccountingEventType.Others; // } //} }
public SysUserViewModel(YuShang.ERP.Entities.Privileges.SysUser m) { this.Id = m.Id; this.UserName = m.UserName; this.Email = m.Email; this.Photo = m.Photo; this.PhoneNumber = m.PhoneNumber; this.Address = m.Address; this.QQ_or_WeChat = m.QQ_or_WeChat; this.Name = m.Name; this.CreatorUserName = m.CreatorUserName; this.CTIME = m.CTIME; }