Esempio n. 1
0
 /// <summary>
 /// 填充用户
 /// </summary>
 /// <param name="info"></param>
 protected virtual void FillAuditorAccounts(UserEntity info)
 {
     info.AuditorAccounts = new List <AuditorAccountEntity>();
     foreach (GridViewRow gvr in gvRole.Rows)
     {
         if (gvr.RowType != DataControlRowType.DataRow)
         {
             continue;
         }
         var ckSelect = gvr.FindControl("ckSelect") as System.Web.UI.HtmlControls.HtmlInputCheckBox;
         if (ckSelect == null || !ckSelect.Checked)
         {
             continue;
         }
         var auditorAccount = new AuditorAccountEntity
         {
             Auditor = new AuditorEntity {
                 Id = ckSelect.Value.Convert <long>()
             },
             Account  = info.Account,
             SaveType = SaveType.Add,
         };
         info.AuditorAccounts.Add(auditorAccount);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 重写
        /// </summary>
        /// <typeparam name="TEntityType"></typeparam>
        /// <param name="id"></param>
        /// <param name="saveType"></param>
        /// <returns></returns>
        protected override TEntityType CreateSaveEntity <TEntityType>(long id, SaveType saveType)
        {
            var info = new AuditorAccountEntity
            {
                SaveType = saveType,
                Auditor  = new AuditorEntity {
                    Id = id
                },
                Account = new AccountEntity {
                    Id = AccountId
                }
            };

            return(info as TEntityType);
        }