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("������λ�����ʹ�ã����ܽ���ɾ��������"); } }
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("������λ��ʹ�ã����ܽ���ɾ��������"); } }
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); } } }
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); } } }
public DataTable GetUnitClass() { using (PersistentManager pm = new PersistentManager()) { UnitDao unitDao = new UnitDao(); return unitDao.FindUnitClass(); } }
public void SaveUnitClass(string classCode, string className, string memo) { using (PersistentManager pm = new PersistentManager()) { UnitDao unitDao = new UnitDao(); unitDao.UpdateUnitClass(classCode, className, memo); } }
public void SaveUnit(DataRow row) { using (PersistentManager pm = new PersistentManager()) { UnitDao unitDao = new UnitDao(); unitDao.UpdateUnit(row); } }