Пример #1
0
        public void Delete(Dingdan dingdan)
        {
            DingdanDataModel model = NHibernateHelper.CurrentSession.Get <DingdanDataModel>(dingdan.Id);

            NHibernateHelper.CurrentSession.Delete(model);
            NHibernateHelper.CurrentSession.Flush();
        }
Пример #2
0
 private void SetModel(DingdanDataModel model, Dingdan dingdan)
 {
     ClassPropertyHelper.ChangeProperty(model, dingdan);
     model.Yewuyuan         = dingdan.Yewuyuan.Account;
     model.KehuId           = dingdan.Kehu.Id;
     model.MingxiListJson   = JsonConvert.SerializeObject(dingdan.MingxiList.Select(m => this.GetMingxiModel(m)).ToList());
     model.ShoukuanListJson = JsonConvert.SerializeObject(dingdan.ShoukuanList.Select(s => new ShoukuanDataModel(s)).ToList());
 }
Пример #3
0
        public void Update(Dingdan dingdan)
        {
            DingdanDataModel model = NHibernateHelper.CurrentSession.Get <DingdanDataModel>(dingdan.Id);

            this.SetModel(model, dingdan);

            NHibernateHelper.CurrentSession.Update(model);
            NHibernateHelper.CurrentSession.Flush();
        }
Пример #4
0
        public void Insert(Dingdan dingdan)
        {
            DingdanDataModel model = new DingdanDataModel();

            this.SetModel(model, dingdan);

            NHibernateHelper.CurrentSession.Save(model);
            NHibernateHelper.CurrentSession.Flush();
        }