/// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.CNS_CensusMember GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.CNS_CensusMember, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.CNS_CensusMember model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.CNS_CensusMember
     {
         ID = entity.ID,
         Address = entity.Address,
         Brithday = entity.Brithday,
         CancelDate = entity.CancelDate,
         CancelReason = entity.CancelReason,
         Company = entity.Company,
         EducationID = entity.EducationID,
         Height = entity.Height,
         IDCard = entity.IDCard,
         IngoingDate = entity.IngoingDate,
         IngoingReason = entity.IngoingReason,
         IsCanceled = entity.IsCanceled,
         Marriage = entity.Marriage,
         MilitaryService = entity.MilitaryService,
         MoveOutDate = entity.MoveOutDate,
         MoveToAddress = entity.MoveToAddress,
         Name = entity.Name,
         Nationalilty = entity.Nationalilty,
         Occupation = entity.Occupation,
         PoliticalID = entity.PoliticalID,
         TypeOfBlood = entity.TypeOfBlood,
         Tel = entity.Tel,
         Sex = entity.Sex,
         Religion = entity.Relation,
         OtherName = entity.OtherName,
         Relation = entity.Relation,
         PreviousAddress = entity.PreviousAddress,
         PlaceOfAncestral = entity.PlaceOfAncestral,
         PlaceOfBirth = entity.PlaceOfBirth,
         RegisterNO = entity.RegisterNO,
         Remark = entity.Remark
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }
 /// <summary>
 /// 修改
 /// </summary>
 public FineOffice.Modules.CNS_CensusMember Update(FineOffice.Modules.CNS_CensusMember model)
 {
     dal.Initialization();
     FineOffice.Entity.CNS_CensusMember entity = new Entity.CNS_CensusMember
     {
         ID               = model.ID,
         Address          = model.Address,
         Brithday         = model.Brithday,
         CancelDate       = model.CancelDate,
         CancelReason     = model.CancelReason,
         Company          = model.Company,
         EducationID      = model.EducationID,
         Height           = model.Height,
         IDCard           = model.IDCard,
         IngoingDate      = model.IngoingDate,
         IngoingReason    = model.IngoingReason,
         IsCanceled       = model.IsCanceled,
         Marriage         = model.Marriage,
         MilitaryService  = model.MilitaryService,
         MoveOutDate      = model.MoveOutDate,
         MoveToAddress    = model.MoveToAddress,
         Name             = model.Name,
         Nationalilty     = model.Nationalilty,
         Occupation       = model.Occupation,
         PoliticalID      = model.PoliticalID,
         TypeOfBlood      = model.TypeOfBlood,
         Tel              = model.Tel,
         Sex              = model.Sex,
         Religion         = model.Relation,
         OtherName        = model.OtherName,
         Relation         = model.Relation,
         PreviousAddress  = model.PreviousAddress,
         PlaceOfAncestral = model.PlaceOfAncestral,
         PlaceOfBirth     = model.PlaceOfBirth,
         RegisterNO       = model.RegisterNO,
         Remark           = model.Remark
     };
     dal.Update(entity);
     dal.Dispose();
     return(null);
 }