Exemplo n.º 1
0
 public void Update(AscmWmsMaterialLabel materialLabel)
 {
     try
     {
         using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
         {
             try
             {
                 YnDaoHelper.GetInstance().nHibernateHelper.Update <AscmWmsMaterialLabel>(materialLabel);
                 tx.Commit();//正确执行提交
             }
             catch (Exception ex)
             {
                 tx.Rollback();//回滚
                 YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmWmsMaterialLabel)", ex);
                 throw ex;
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Save AscmWmsMaterialLabel)", ex);
         throw ex;
     }
 }
Exemplo n.º 2
0
 public void Delete(AscmWmsMaterialLabel materialLabel)
 {
     try
     {
         YnDaoHelper.GetInstance().nHibernateHelper.Delete <AscmWmsMaterialLabel>(materialLabel);
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("删除失败(Delete AscmWmsMaterialLabel)", ex);
         throw ex;
     }
 }
Exemplo n.º 3
0
 public void Delete(int id)
 {
     try
     {
         AscmWmsMaterialLabel materialLabel = Get(id);
         Delete(materialLabel);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        public AscmWmsMaterialLabel Get(int id)
        {
            AscmWmsMaterialLabel materialLabel = null;

            try
            {
                materialLabel = YnDaoHelper.GetInstance().nHibernateHelper.Get <AscmWmsMaterialLabel>(id);
            }
            catch (Exception ex)
            {
                YnBaseClass2.Helper.LogHelper.GetLog().Error("查询失败(Get AscmWmsMaterialLabel)", ex);
                throw ex;
            }
            return(materialLabel);
        }