Exemple #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("������λ�����ʹ�ã����ܽ���ɾ��������");
     }
 }
Exemple #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("������λ��ʹ�ã����ܽ���ɾ��������");
     }
 }
Exemple #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);
         }
     }
 }
Exemple #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);
         }
     }
 }
Exemple #5
0
 public DataTable GetUnitClass()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         return unitDao.FindUnitClass();
     }
 }
Exemple #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);
     }
 }
Exemple #7
0
 public void SaveUnit(DataRow row)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         UnitDao unitDao = new UnitDao();
         unitDao.UpdateUnit(row);
     }
 }