Exemple #1
0
 public void AddUnit(DataRow row)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             pm.BeginTransaction();
             UnitDao unitDao = new UnitDao();
             if (unitDao.FindUnit(row["UNITCODE"].ToString()) == 0)
                 unitDao.InsertUnit(row);
             else
                 throw new Exception("������λ�Ѵ��ڣ����������롣");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
Exemple #2
0
 public DataTable GetUnit()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         return unitDao.FindUnit();
     }
 }