Exemple #1
0
        public void Update(SqlTransaction trans)
        {
            if (!CanUpdate(this.UserName))
            {
                throw new AccessException(this.UserName, "Update");
            }

            string spName = "usp_ExternalNumber_Update";
            ExternalNumberParamsHelper helper = new ExternalNumberParamsHelper(this);

            helper.InitParamsForSP(spName);
            SqlParameter[] parameters = helper.ParamList.Params;
            SPHelper.ExecuteNonQuery(trans, spName, parameters);
            helper.SetPropValues();
        }
Exemple #2
0
        public int Insert(SqlTransaction trans)
        {
            if (!CanInsert(this.UserName))
            {
                throw new AccessException(this.UserName, "Insert");
            }

            string spName = "usp_ExternalNumber_Insert";
            ExternalNumberParamsHelper helper = new ExternalNumberParamsHelper(this);

            helper.InitParamsForSP(spName);
            SqlParameter[] parameters = helper.ParamList.Params;
            SPHelper.ExecuteNonQuery(trans, spName, parameters);
            helper.SetPropValues();

            return(this._id);
        }
Exemple #3
0
        private void Init(SqlTransaction trans, int id)
        {
            if (!CanView(this.UserName))
            {
                throw new AccessException(this.UserName, "Init");
            }
            this.ID = id;
            string spName = "usp_ExternalNumber_Get";
            ExternalNumberParamsHelper helper = new ExternalNumberParamsHelper(this);

            helper.InitParamsForSP(spName);
            SqlParameter[] parameters = helper.ParamList.Params;
            if (trans == null)
            {
                SPHelper.ExecuteNonQuery(spName, parameters);
            }
            else
            {
                SPHelper.ExecuteNonQuery(trans, spName, parameters);
            }
            helper.SetPropValues();
        }