public bool AddEdmTest(EdmTestQuery query,out int msg) { ArrayList arryList = new ArrayList(); query.Replace4MySQL(); msg = 0; try { _edmemailDao.GetData(query.email_address, out largestid, out id, out name); if (id != 0) { query.email_id = id; if (_etestDao.SelectExists(id))//存在id是true 不存在是false { msg = 1; return false; } else { if (name != query.test_username) { arryList.Add(_etestDao.UpdateEdmEmailName(query)); } arryList.Add(_etestDao.InsertEdmTest(query)); } } else { query.email_id = largestid + 1; arryList.Add(_etestDao.InsertEdmEmail(query)); arryList.Add(_etestDao.InsertEdmTest(query)); } } catch (Exception ex) { throw new Exception("EdmTestMgr-->AddEdmTest-->", ex); } return _mysqlDao.ExcuteSqls(arryList); }
public bool EditEdmTest(EdmTestQuery query,out int msg) { query.Replace4MySQL(); msg = 0; ArrayList arryList = new ArrayList(); try { arryList.Add(_etestDao.UpdateEdmEmailName(query)); EdmEmail e = _edmemailDao.GetModel(query.email_address); if (e == null || e.email_id == query.email_id) { arryList.Add(_etestDao.UpdateEdmEmailAddress(query)); arryList.Add(_etestDao.UpdateEdmTest(query)); } else { msg = 1; return false; } } catch (Exception ex) { throw new Exception("EdmTestMgr-->EditEdmTest-->", ex); } return _mysqlDao.ExcuteSqls(arryList); }