Esempio n. 1
0
 public void DeleteUnitClass(string classCode)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         if (unitDao.FindUnitClass(classCode) == 0)
             unitDao.DeleteUnitClass(classCode);
         else
             throw new Exception("������λ�����ʹ�ã����ܽ���ɾ��������");
     }
 }
Esempio n. 2
0
 public void DeleteUnit(string unitCode)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         ProductDao productDao = new ProductDao();
         UnitDao unitDao = new UnitDao();
         unitDao.DeleteUnit(unitCode);
         //if (productDao.FindUnit(unitCode) == 0)
         //    unitDao.DeleteUnit(unitCode);
         //else
         //    throw new Exception("������λ��ʹ�ã����ܽ���ɾ��������");
     }
 }
Esempio n. 3
0
 public void AddUnitClass(string classCode, string className, string memo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             pm.BeginTransaction();
             UnitDao unitDao = new UnitDao();
             if (unitDao.FindUnitClass(classCode) == 0)
                 unitDao.InsertUnitClass(classCode, className, memo);
             else
                 throw new Exception("������λ����Ѵ��ڣ����������롣");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
Esempio n. 4
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);
         }
     }
 }
Esempio n. 5
0
 public DataTable GetUnitClass()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         return unitDao.FindUnitClass();
     }
 }
Esempio n. 6
0
 public void SaveUnitClass(string classCode, string className, string memo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         unitDao.UpdateUnitClass(classCode, className, memo);
     }
 }
Esempio n. 7
0
 public void SaveUnit(DataRow row)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         unitDao.UpdateUnit(row);
     }
 }