Beispiel #1
0
        public void Update(Kehu kehu)
        {
            KehuDataModel model = NHibernateHelper.CurrentSession.Get <KehuDataModel>(kehu.Id);

            this.SetModel(model, kehu);

            NHibernateHelper.CurrentSession.Update(model);
            NHibernateHelper.CurrentSession.Flush();
        }
Beispiel #2
0
        public void Insert(Kehu kehu)
        {
            KehuDataModel model = new KehuDataModel();

            this.SetModel(model, kehu);

            NHibernateHelper.CurrentSession.Save(model);
            NHibernateHelper.CurrentSession.Flush();
        }
Beispiel #3
0
        public void Delete(Kehu kehu)
        {
            List <Dingdan> dingdanList = this._coreManager.DingdanManager.GetDingdan(kehu);

            if (dingdanList.Count > 0)
            {
                throw new Exception(string.Format("无法删除,{0}有{1}个订单", kehu.Name, dingdanList.Count));
            }

            KehuDataModel model = NHibernateHelper.CurrentSession.Get <KehuDataModel>(kehu.Id);

            NHibernateHelper.CurrentSession.Delete(model);
            NHibernateHelper.CurrentSession.Flush();
        }
Beispiel #4
0
 private void SetModel(KehuDataModel model, Kehu kehu)
 {
     ClassPropertyHelper.ChangeProperty(model, kehu);
     model.Yewuyuan = kehu.Yewuyuan.Account;
 }