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(); }
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); }
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(); }