Esempio n. 1
0
        public void Save()
        {
            SqlConnection cnn = new SqlConnection(this.DbConnString);

            cnn.Open();
            SqlTransaction tr = cnn.BeginTransaction();

            try
            {
                SqlCommand cmd = this.GetCmdSave();
                SqlHelper.ExecuteNonQuery(tr, cmd);
                string err = cmd.Parameters["@err"].Value.ToString();
                if (!string.IsNullOrEmpty(err))
                {
                    throw new Exception("升级错误:" + err);
                }
                if (_DataSourceInfor.DataSourceBO != null)
                {
                    SaveDataSourceEngine.SaveByDataEngineService(_DataSourceInfor, tr);
                }
                tr.Commit();
            }
            catch (Exception e)
            {
                tr.Rollback();
                throw e;
            }
        }
Esempio n. 2
0
        public void SaveBO()
        {
            SqlConnection cnn = new SqlConnection(this.DbConnString);

            cnn.Open();
            SqlTransaction tr = cnn.BeginTransaction();

            try
            {
                SqlCommand cmd = this.GetCmdCleanBO();
                SqlHelper.ExecuteNonQuery(tr, cmd);
                if (_DataSourceInfor.DataSourceBO != null)
                {
                    SaveDataSourceEngine.SaveByDataEngineService(_DataSourceInfor, tr);
                }
                tr.Commit();
            }
            catch (Exception e)
            {
                tr.Rollback();
                throw e;
            }
        }