//public virtual MemberDetails PUser //{ // get { return _PUser; } // set { _PUser = value; } //} protected bool Equals(MemberAbout entity) { if (entity == null) return false; if (!base.Equals(entity)) return false; if (!Equals(_Id, entity._Id)) return false; return true; }
public ActionResult BioData(Data.Entity.MemberAbout model) { System.Collections.IList obj = Data.Helper.NHibernateHelper.Find("from MemberAbout m where m.Id=?", LoggedInUserKey, NHibernate.NHibernateUtil.Int32, false); try { //AutoMapper.Mapper.CreateMap<MemberBiodataModel, MemberBiodata>(); //AutoMapper.Mapper.Map<MemberBiodataModel, MemberBiodata>(model); MemberAbout addBio = new MemberAbout(); if ((null != obj) && (obj.Count != 0)) { addBio = Data.Helper.NHibernateHelper.ConvertToListOf<MemberAbout>(obj)[0]; addBio.AboutText = model.AboutText; Data.Helper.NHibernateHelper.Update<MemberAbout>(addBio); } else { //addBio.PUser = m_PersistenceManager.UniqueResult<MemberDetails>(null, "Id", LoggedInUserKey); addBio.Id = LoggedInUserKey; addBio.AboutText = model.AboutText; Data.Helper.NHibernateHelper.Save<MemberAbout>(addBio); } TempData["message"] = "Bio Data added"; } catch (Exception ex1) { TempData["message"] = "Error adding bio-data" + ex1.Message; } return View(model); }